View Issue Details

IDProjectCategoryView StatusLast Update
0000682Subversion for OS/2 & eCSBugpublic2019-01-01 19:25
ReporterSteven LevineAssigned Topsmedley 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformOS2/eCSOSOS/2 or eComstationOS Version1.x 2.x or 4.5
Summary0000682: svn cat traps for version 1.7.21
DescriptionThe testcase was generated for the nepmd repository, but the command will trap for any repository for any file.
v1.6.23 traps similarly, so this is not a regression.

I am pretty sure this is a known kLIBC issue that has been fixed in recent LIBC066.DLL builds with changes to os2safe.h which give DosWrite to the console special handling for high memory buffers.

A rebuild of svn.exe with the most recent LIBC066.DLL might be sufficient to avoid the trap.
Steps To ReproduceGiven:

>svn info ^/trunk
Path: trunk
URL: http://svn.netlabs.org/repos/nepmd/trunk
Repository Root: http://svn.netlabs.org/repos/nepmd
Repository UUID: 72c63837-6175-e011-9ffd-00145e329d72
Revision: 3365
Node Kind: directory
Last Changed Author: aschn
Last Changed Rev: 3365
Last Changed Date: 2018-12-18 11:38:49 +0000 (Tue, 18 Dec 2018)

>svn cat ^/trunk/readme.cmd

Killed by SIGSEGV
pid=0x3d40 ppid=0x3d18 tid=0x0001 slot=0x00f1 pri=0x0200 mc=0x0001 ps=0x0010
D:\USR2\BIN\SVN.EXE
cs:eip=fff7:00005003 ss:esp=0287:0050f72e ebp=0050f73a
 ds=e7e7 es=0000 fs=150b gs=e7bf efl=00012202
eax=0287e7e7 ebx=00634e94 ecx=00000051 edx=0050e7df edi=00000051 esi=2007d178
Process dumping was disabled, use DUMPPROC / PROCDUMP to enable it.

Redirecting the output with:

>svn cat ^/trunk/readme.cmd | less

avoids the trap.

TagsNo tags attached.

Activities

psmedley

2018-12-21 16:45

administrator   ~0003211

i'd assume you mean rebuilding against the updated os2safe.h might be sufficient? I'll try look at this soon.

Steven Levine

2018-12-21 17:57

manager   ~0003212

Maybe. The last os2safe.h updates added DosOpen and DosDevIOCtl to the API list as a result of:

  http://trac.netlabs.org/libc/ticket/294
  http://trac.netlabs.org/libc/ticket/282

However, the trap, IIRC, occurred because DosWrite is not safe when the handle points to the console. I will capture a process dump to verify exactly where the trap is occuring.

psmedley

2018-12-22 07:39

administrator   ~0003213

Last edited: 2018-12-22 07:41

View 2 revisions

svn cat works fine here. However, I'm running a newer build of svn.exe than is publicly available.

http://smedley.id.au/tmp/subversion-1.7.21-os2-20181221.zip

LewisR

2018-12-25 12:16

developer   ~0003215

Hmmm... Might warrant a fresh ticket:

svn: E175002: OPTIONS of 'https://svn.netlabs.org/repos/vxapps/projects/itheme':
 SSL handshake failed: SSL disabled due to library version mismatch (https://svn.netlabs.org)

(This is with the 20181221 1.7.21.)

Steven Levine

2018-12-25 13:35

manager   ~0003216

Lewis, this may be a regression Any attempt ot use the https scheme fails exactly as you described. So far, I have tried:

>svn ls https://svn.netlabs.org/repos/vxapps/projects/itheme
>svn ls https://svn.arcanoae.com/arcaos/trunk

Paul, I'm still trapping here. Did you test with exactly the commands I provided? The reason I ask is that

  svn cat readme.cmd

has always works. The failure occurs when using

  svn cat ^/trunk/readme.cmd

or the more verbose:

  svn cat http://svn.netlabs.org/repos/nepmd/trunk/readme.cmd

The former requires a workspace so that svn to expand the ^. The later does not.

Both of the above cat from the remote repository, not the local workspace.

Steven Levine

2018-12-25 19:08

manager   ~0003217

I have confirmed that the trap is caused by attempting to write from a high memory buffer to the console via VIOWriteTTY. Please provide a map file, I will identify the function that is allocated the buffer that needs to be moved to low memory.

psmedley

2018-12-25 19:19

administrator   ~0003218

http://smedley.id.au/tmp/svn.map - meanwhile, I'll try fix the ssl issue

Steven Levine

2018-12-25 20:22

manager   ~0003219

As you know, svn has lots of static functions and data, so this is why some of the offset are large.

# %findsym 0059F700 l900
Finding from 0059f700 to 005a0000 by dword
59f710: 00010007 = _text + 7
59f714: 00530000 = SEG0002_dummy + 80000 (0003:00090000)
59f71c: 00513c90 = SEG0002_dummy + 63C90 (0003:00073c90)
59f740: 0059f748 = SEG0002_dummy + EF748 (0003:000ff748)
59f748: 0059f778 = SEG0002_dummy + EF778 (0003:000ff778)
59f76c: 0059f7fc = SEG0002_dummy + EF7FC (0003:000ff7fc)
59f774: 00080042 = svn_ra_open4 + 2B2
59f778: 0059f7d8 = SEG0002_dummy + EF7D8 (0003:000ff7d8)
59f77c: 00116ada = apr_file_write + 4A call Dos32Write
59f78c: 0059f7b0 = SEG0002_dummy + EF7B0 (0003:000ff7b0)
59f7d8: 0059f818 = SEG0002_dummy + EF818 (0003:000ff818)
59f7dc: 000b5a6c = apr_file_write_full + 2C
59f7e8: 0059f7fc = SEG0002_dummy + EF7FC (0003:000ff7fc)
59f7f8: 0059f854 = SEG0002_dummy + EF854 (0003:000ff854)
59f80c: 0059f8f0 = SEG0002_dummy + EF8F0 (0003:000ff8f0)
59f818: 0059f858 = SEG0002_dummy + EF858 (0003:000ff858)
59f81c: 0007145c = svn_io_file_write_full + 2C
59f82c: 0059f8f0 = SEG0002_dummy + EF8F0 (0003:000ff8f0)
59f838: 0059f868 = SEG0002_dummy + EF868 (0003:000ff868)
59f83c: 0059f930 = SEG0002_dummy + EF930 (0003:000ff930)
59f840: 0059f960 = SEG0002_dummy + EF960 (0003:000ff960)
59f848: 0059f888 = SEG0002_dummy + EF888 (0003:000ff888)
59f84c: 0059f8f0 = SEG0002_dummy + EF8F0 (0003:000ff8f0)
59f858: 0059f888 = SEG0002_dummy + EF888 (0003:000ff888)
59f85c: 00044735 = svn_error__malfunction + 31B5 (0001:00034735)
59f86c: 0059f8f0 = SEG0002_dummy + EF8F0 (0003:000ff8f0)
59f874: 0059f960 = SEG0002_dummy + EF960 (0003:000ff960)
59f878: 0059f8a8 = SEG0002_dummy + EF8A8 (0003:000ff8a8)
59f888: 0059fa08 = SEG0002_dummy + EFA08 (0003:000ffa08)
59f88c: 000857a8 = svn_client_list2 + 1618 (0001:000757a8)
59f898: 0059f8f0 = SEG0002_dummy + EF8F0 (0003:000ff8f0)
59f8f8: 0059f938 = SEG0002_dummy + EF938 (0003:000ff938)
59f8fc: 1d28ab0a = _um_alloc_no_lock + 6A
59f918: 0059fa48 = SEG0002_dummy + EFA48 (0003:000ffa48)
59f91c: 002b1c10 = ne_request_dispatch + 544
59f930: 0059f990 = SEG0002_dummy + EF990 (0003:000ff990)
59f938: 0059f9e8 = SEG0002_dummy + EF9E8 (0003:000ff9e8)
59f93c: 0013ee32 = apr_sha1_base64 + A56
59f968: 0059f998 = SEG0002_dummy + EF998 (0003:000ff998)
59f998: 0059f9b8 = SEG0002_dummy + EF9B8 (0003:000ff9b8)
59f99c: 1d2d0881 = _std_free + 21
59f9a8: 0059fa60 = SEG0002_dummy + EFA60 (0003:000ffa60)
59f9b8: 0059f9f8 = SEG0002_dummy + EF9F8 (0003:000ff9f8)
59f9bc: 002b0e20 = ne_get_response_header + 84
59f9d4: 0059fa38 = SEG0002_dummy + EFA38 (0003:000ffa38)
59f9d8: 0059fa08 = SEG0002_dummy + EFA08 (0003:000ffa08)
59f9dc: 00085fcd = svn_client_list2 + 1E3D (0001:00075fcd)
59f9e8: 0059fa08 = SEG0002_dummy + EFA08 (0003:000ffa08)
59f9ec: 00083072 = svn_checksum_update + 52
59fa08: 0059fa28 = SEG0002_dummy + EFA28 (0003:000ffa28)
59fa0c: 0017cbf3 = svn_ra_neon__vcc_prop + 1F3
59fa18: 0059fa38 = SEG0002_dummy + EFA38 (0003:000ffa38)
59fa28: 0059fa48 = SEG0002_dummy + EFA48 (0003:000ffa48)
59fa2c: 002ac817 = svn_ra_neon__xml_collect_cdata + 6D7
59fa30: 0059fb84 = SEG0002_dummy + EFB84 (0003:000ffb84)
59fa48: 0059faa8 = SEG0002_dummy + EFAA8 (0003:000ffaa8)
59fa4c: 002b1149 = ne_read_response_block + 61
59fa68: 0059faa8 = SEG0002_dummy + EFAA8 (0003:000ffaa8)
59fa6c: 001858d8 = ne__ssl_exit + 118
59fa84: 003119e0 = __emutls_register_common + B11
59fa88: 0059faa8 = SEG0002_dummy + EFAA8 (0003:000ffaa8)
59faa8: 0059fae8 = SEG0002_dummy + EFAE8 (0003:000ffae8)
59faac: 002b1710 = ne_request_dispatch + 44
59fac8: 0059fae8 = SEG0002_dummy + EFAE8 (0003:000ffae8)
59facc: 002ac96c = svn_ra_neon__xml_collect_cdata + 82C
59fad8: 002ac120 = apr_wait_for_io_or_timeout + 2D0
59fadc: 000409e0 = apr_pool_cleanup_null + 0
59fae8: 0059fb48 = SEG0002_dummy + EFB48 (0003:000ffb48)
59faec: 002ada24 = svn_ra_neon__request_dispatch + 1A4
59faf8: 002ac100 = apr_wait_for_io_or_timeout + 2B0
59fafc: 000409e0 = apr_pool_cleanup_null + 0
59fb08: 0059fb28 = SEG0002_dummy + EFB28 (0003:000ffb28)
59fb0c: 00040750 = apr_pool_cleanup_register + 50
59fb28: 0059fb48 = SEG0002_dummy + EFB48 (0003:000ffb48)
59fb2c: 002ac96c = svn_ra_neon__xml_collect_cdata + 82C
59fb38: 002ac120 = apr_wait_for_io_or_timeout + 2D0
59fb48: 0059fba8 = SEG0002_dummy + EFBA8 (0003:000ffba8)
59fb4c: 0017cf27 = svn_ra_neon__vcc_prop + 527
59fb78: 0059fba8 = SEG0002_dummy + EFBA8 (0003:000ffba8)
59fb7c: 0008300a = svn_checksum_ctx_create + 7A
59fb8c: 0059fbf4 = SEG0002_dummy + EFBF4 (0003:000ffbf4)
59fb98: 0059fba8 = SEG0002_dummy + EFBA8 (0003:000ffba8)
59fba8: 0059fc18 = SEG0002_dummy + EFC18 (0003:000ffc18)
59fbac: 0018052b = svn_ra_neon__get_file + 20B
59fbb0: 0017cba0 = svn_ra_neon__vcc_prop + 1A0
59fbb4: 0059fbf4 = SEG0002_dummy + EFBF4 (0003:000ffbf4)
59fc08: 0059fc18 = SEG0002_dummy + EFC18 (0003:000ffc18)
59fc14: 0004a3a1 = svn__strtoff + 6A1
59fc18: 0059fca8 = SEG0002_dummy + EFCA8 (0003:000ffca8)
59fc1c: 0005866c = svn_client_cat2 + 30C
59fc24: 000582f1 = svn_client__get_normalized_stream + 571
59fc44: 0059fc74 = SEG0002_dummy + EFC74 (0003:000ffc74)
59fc68: 0059fca8 = SEG0002_dummy + EFCA8 (0003:000ffca8)
59fc8c: 0004a3a1 = svn__strtoff + 6A1
59fc90: 00046d40 = svn_cmdline_handle_exit_error + D0
59fc94: 00046d63 = svn_cmdline_handle_exit_error + F3
59fca8: 0059fd18 = SEG0002_dummy + EFD18 (0003:000ffd18)
59fcac: 00011186 = svn_cl__cat + 116
59fcb8: 0059fcf4 = SEG0002_dummy + EFCF4 (0003:000ffcf4)
59fcbc: 0059fe00 = SEG0002_dummy + EFE00 (0003:000ffe00)
59fcd0: 0059fdfc = SEG0002_dummy + EFDFC (0003:000ffdfc)
59fce0: 0001a243 = svn_cl__check_cancel + 843
59fcf8: 0059fd18 = SEG0002_dummy + EFD18 (0003:000ffd18)
59fcfc: 00012059 = svn_cl__conflict_baton_make + 19
59fd18: 0059ff40 = SEG0002_dummy + EFF40 (0003:000fff40)
59fd1c: 0001bf4e = main + 1C1E (0001:0000bf4e)
59fd24: 0059fd98 = SEG0002_dummy + EFD98 (0003:000ffd98)
59fd40: 00019a00 = svn_cl__check_cancel + 0
59fd50: 0059fd8d = SEG0002_dummy + EFD8D (0003:000ffd8d)
59fd78: 00027620 = svn_cl__cmd_table + 4E0
59fd94: 0059fdac = SEG0002_dummy + EFDAC (0003:000ffdac)
59fd98: 0059fdfc = SEG0002_dummy + EFDFC (0003:000ffdfc)
59fdb4: 0059fddc = SEG0002_dummy + EFDDC (0003:000ffddc)
59fdb8: 18921053 = InitOptions + 63
59fdc0: 0059fdd8 = SEG0002_dummy + EFDD8 (0003:000ffdd8)
59fdd4: 0059fdfc = SEG0002_dummy + EFDFC (0003:000ffdfc)
59fdd8: 18921262 = InstallExceptq + 72
59fddc: 0059ff5c = SEG0002_dummy + EFF5C (0003:000fff5c)
59fde0: 18921208 = InstallExceptq + 18
59fde8: 0059fdf8 = SEG0002_dummy + EFDF8 (0003:000ffdf8)
59fdec: 0059fdf4 = SEG0002_dummy + EFDF4 (0003:000ffdf4)
59ff34: 0059ff78 = SEG0002_dummy + EFF78 (0003:000fff78)
59ff40: 0059ff6c = SEG0002_dummy + EFF6C (0003:000fff6c)
59ff44: 00010037 = _text + 37
59ff4c: 0059ff8c = SEG0002_dummy + EFF8C (0003:000fff8c)
59ff54: 0059ff84 = SEG0002_dummy + EFF84 (0003:000fff84)
59ff5c: 0059ff84 = SEG0002_dummy + EFF84 (0003:000fff84)
59ff60: 18921270 = MYHANDLER
59ff64: 1d291304 = __init + D4
59ff68: 0059ff78 = SEG0002_dummy + EFF78 (0003:000fff78)
59ff6c: 0059ffe0 = SEG0002_dummy + EFFE0 (0003:000fffe0)
59ff74: 0059ff78 = SEG0002_dummy + EFF78 (0003:000fff78)
59ff7c: 0059ff8c = SEG0002_dummy + EFF8C (0003:000fff8c)
59ff88: 1d2c6e50 = _libc_Back_exceptionHandler + 10
59ff8c: 0059ff9d = SEG0002_dummy + EFF9D (0003:000fff9d)
59ff90: 0059ffb2 = SEG0002_dummy + EFFB2 (0003:000fffb2)
59ff94: 0059ffb7 = SEG0002_dummy + EFFB7 (0003:000fffb7)
59ffd4: 1d291292 = __init + 62
59ffe4: 1d2a89ab = _sys_init_ret + F
5a0010: 00363532 = ssl3_ctrl + 2B3
5a0024: 00535953 = SEG0002_dummy + 85953 (0003:00095953)
5a0050: 00494e49 = ssl3_ciphers + B49
Scan stopped at 5a0080 stopaddr 5a0000

In the above:

59f77c: 00116ada = apr_file_write + 4A call Dos32Write

this is the call the eventually traps.

If we annotate the stack dump in the .trp file:

                                ebp eip
 0059F770 : 0000 0000 0042 0008 F7D8 0059 6ADA 0011 : ....B.....Y..j..
            stdout pBuffer cb pWrite
 0059F780 : 0001 0000 A5BA 2008 0000 0000 F7B0 0059 : ....... ......Y.

we find a DosWrite to STDOUT from address 0x2008a5ba for 0 bytes. This will trap once the code reaches VIOWRITETTY because the VIO functions are not highmem safe.

I've not looked at the code to see if the buffer is allocated by svn_io_file_write_full or by a fuction further up in the call chain.

psmedley

2018-12-26 16:35

administrator   ~0003220

OK, I fixed the SSL issue by rebuilding the neon libs against my current SSL. I can now reproduce the trap - out of curiosity, I built without -Zhigh-mem and got the same error? Does this make any sense?

Steven Levine

2018-12-27 03:08

manager   ~0003221

Yes, as of libcx 0.6.1, there was a change to the default behaviour of the kLIBC high memory heap voting process. See \usr\share\doc\libcx-0.6.3\README.md for the details. The current default behaviour is to use high memory if any of the EXEs or DLLs are built with -Zhigh-mem. In general, this causes less problems than forcing the heap to low memory just because some kLIBC app was accidentally built without -Zhigh-mem.

To verify that the problem buffer is coming from the kLIBC heap and to override the new default, use:

  set LIBCX_HIGHMEM=0

to force the heap into low memory. This should make the trap go away with your new build since it is linked with libcx0.dll. It does not avoid the trap for the 2015 version of svn 1.7.21 because it predates libcx.

There is a case where LIBCX_HIGHMEM=0 will not be effective. This will occur if the buffer comes from a code or data segment in the exectuable and someone has marked the segment to load high using highmem.exe.

psmedley

2018-12-27 14:09

administrator   ~0003222

OK that makes sense. Looks like the buffer is assigned somewhere else. I need to find out where svn_io_file_write_full is called from, and how the buffer is allocated.

Steven Levine

2018-12-28 07:29

manager   ~0003223

I wrote a nice long analysis and wandered off to do a honey-do and mantis timed out my post.

The management overview is you should be able to use isatty() is apr_write() to copy to data to a low memory buffer. Apr_read() will need the same treatment. The equivalent kLIBC code is at

  src\emx\src\lib\sys\__write.c:36
    if (!pFH->pOps)

psmedley

2018-12-28 11:21

administrator   ~0003224

Hi Steven, thanks for this - I'll investigate the mantis time out when I get a change, probably a PHP setting that can be tweaked.
I must be missing something. I've modified apr's readwrite.c per http://smedley.id.au/tmp/readwrite.c

When I run svn I'm getting a message confirming the new code is running, but it still traps.
[U:\DEV\subversion-1.7.21]subversion\svn\svn.exe cat http://svn.netlabs.org/repos/nepmd/trunk/readme.cmd
is tty
Creating 38A6_01.TRP

Any suggestions?

Steven Levine

2018-12-28 13:04

manager   ~0003225

Does

   set LIBCX_HIGHMEM=0

make the trap go away?

Your code looks OK. Please attach a copy of the .trp file to the ticket. A link to the test build and the map file would allow me to make my own .trp file.

I recommend you add the address of the new buffer to the fprintf output, just in case the behavior of _lmalloc changed unexpectely with the recent libcx changes. This could not occur, but one never knows.

BTW, I think you missed the

        if (pvBuf_safe)
            free(pvBuf_safe);





FWIW, the last .diff I have is from 1.7.18-2014-10-14. If there are any significant changes to the diff for 1.7.21, a fresh diff might be helpful too.

psmedley

2018-12-28 13:38

administrator   ~0003226

Updates as follows:
http://smedley.id.au/tmp/apr-1.6.5.diff
http://smedley.id.au/tmp/subversion-1.7.21.diff
http://smedley.id.au/tmp/subversion-1.7.21-os2-20181228.zip
TRP = http://smedley.id.au/tmp/38a8_01.trp

Now to wait for the pizza and drink some more wine

Steven Levine

2018-12-28 18:52

manager   ~0003227

I get a 404 for http://smedley.id.au/tmp/subversion-1.7.21.diff.

I got a 404 for this http://smedley.id.au/tmp/38a8_01.trp, but corrected the case to resolve this.

The code trapped doing a memcpy because it overran the source buffer, probably due to some sort of math error calculating the byte count. At the time of the trap the source was 20060000 (ESI) and the destination was
0076A868 (EDI) and the remaining count was 0016390D (ECX). Since we don't know the initial count, we don't know the buffer start address.

There are a couple of odd things going on. ECX points to valid memory. This is not impossible, but it is unlikely.

It appears something went wrong with the code that calculated the count.

The likely culprit is the memcpy() in apr_file_write() at:

readwrite.c:178
  memcpy(thefile->buffer + thefile->bufpos, pos, blocksize);

which will call memcpy() in libc066. apr_file_write() does not show in the stack trace because memcpy does not create a stack frame.

Please install libc066.xqs so that we know for sure where in libc066 the trap occurred.

Also, please check the svn.map in the zip file. The file dates differs from the date of svn.exe.

psmedley

2018-12-28 19:06

administrator   ~0003228

Apologies.... I'd had a few wines before posting :)

zip updated with new map file

new trp = http://smedley.id.au/tmp/CC1B_01.TRP
 Trap -> 1EC54D45 LIBC066 0001:00054D45 between __std_memcpy + 15 and __std_memicmp - 1B (in memcpy.obj and memicmp.obj)

Steven Levine

2018-12-30 05:00

manager   ~0003229

Please check http://smedley.id.au/tmp/subversion-1.7.21-os2-20181228.zip. I don't think it got updated with the most recent svn.exe. It still traps in check_dbc() which is expected for the original readwrite.c.

I occurs to me that since we are using os2/readwrite.c and unix/fullrw.c, perhaps the parameter order is out of sync.

psmedley

2018-12-30 07:09

administrator   ~0003230

Hey Steven,

Try http://smedley.id.au/tmp/subversion-1.7.21-os2-20181230.zip

Note that things do work OK with set LIBCX_HIGHMEM=0 - perhaps something is still using highmem ?

Steven Levine

2018-12-30 12:09

manager   ~0003231

While, LIBC_HIGHMEM=0 appears to bypass the trap, I suspect this is only because the memory layout differs.

There appears to be a code generation problem of some sort. Take a look at the attached 02e9_01.trp near line 221. It shows that memcpy is being called with a pointer to the buffer length not the buffer length. This is wrong. I don't see anything obviously wrong in the apr_file_write() source code, so I have to suspect an object code generation error. apr_file_write() is called with a pointer to nbytes, but this get dereferenced into size in the source code.

I would check that both fullrw.c andreadwrite.c are using the same apr_arch_file_io.h.

I will generate a process dump later today and see if I can se where the code goes wrong.

02e9_01.trp (35,577 bytes)

Steven Levine

2018-12-30 12:33

manager   ~0003232

I found it. I was a bit brain-dead and looking at the wrong memcpy. The dump file made this obvious.

This:

file_io\os2\readwrite.c:198
                pvBuf_safe = _lmalloc(nbytes);
                if (!pvBuf_safe)
                {
                    errno = ENOMEM;
                return APR_FROM_OS_ERROR(errno);
                }
                memcpy(pvBuf_safe, buf, nbytes);
                buf = pvBuf_safe;

should be
file_io\os2\readwrite.c:198
                pvBuf_safe = _lmalloc(*nbytes);
                if (!pvBuf_safe)
                {
                    errno = ENOMEM;
                return APR_FROM_OS_ERROR(errno);
                }
                memcpy(pvBuf_safe, buf, *nbytes);
                buf = pvBuf_safe;

I suspect one of the wines convinced you to ignore the compiler warnings.

psmedley

2018-12-30 14:42

administrator   ~0003233

OK http://smedley.id.au/tmp/subversion-1.7.21-os2-20181230.zip is refreshed.
I'll update the diffs later this afternoon. Thanks for your help in investigating this.

Steven Levine

2018-12-30 18:35

manager   ~0003234

So far, this build looks good.

If you make a copy of the build log available, I can check for any warnings that may need attention.

psmedley

2018-12-31 18:41

administrator   ~0003235

Updated APR diff and build log attached

aprbuild.log (84,414 bytes)
apr-1.6.5.diff (123,077 bytes)
Only in apr-1.6.5: .make.dirs
Only in apr-1.6.5: a.out
Only in apr-1.6.5: apr-1-config
Only in apr-1.6.5: apr.pc
Only in apr-1.6.5: aprbuild.log
Only in apr-1.6.5/atomic/unix: builtins.lo
Only in apr-1.6.5/atomic/unix: builtins.o
Only in apr-1.6.5/atomic/unix: ia32.lo
Only in apr-1.6.5/atomic/unix: ia32.o
Only in apr-1.6.5/atomic/unix: mutex.lo
Only in apr-1.6.5/atomic/unix: mutex.o
Only in apr-1.6.5/atomic/unix: ppc.lo
Only in apr-1.6.5/atomic/unix: ppc.o
Only in apr-1.6.5/atomic/unix: s390.lo
Only in apr-1.6.5/atomic/unix: s390.o
Only in apr-1.6.5/atomic/unix: solaris.lo
Only in apr-1.6.5/atomic/unix: solaris.o
diff -ur apr-1.6.5-o/build/aplibtool.c apr-1.6.5/build/aplibtool.c
--- apr-1.6.5-o/build/aplibtool.c	2011-10-16 07:56:14.000000000 +1030
+++ apr-1.6.5/build/aplibtool.c	2018-10-31 19:14:44.000000000 +1030
@@ -36,7 +36,11 @@
 #  define CC         "gcc"
 #  define GEN_EXPORTS "emxexp"
 #  define DEF2IMPLIB_CMD "emximp"
-#  define SHARE_SW   "-Zdll -Zmtd"
+#if 1
+#  define SHARE_SW   "-Zdll -Zmap -Zhigh-mem"
+#else
+#  define SHARE_SW   "-Zdll -Zmap"
+#endif
 #  define USE_OMF true
 #  define TRUNCATE_DLL_NAME
 #  define DYNAMIC_LIB_EXT "dll"
@@ -45,7 +49,7 @@
 #  if USE_OMF
      /* OMF is the native format under OS/2 */
 #    define STATIC_LIB_EXT "lib"
-#    define OBJECT_EXT     "obj"
+#    define OBJECT_EXT     "o"
 #    define LIBRARIAN      "emxomfar"
 #  else
      /* but the alternative, a.out, can fork() which is sometimes necessary */
@@ -262,7 +266,7 @@
     if (strcmp(ext, "la") == 0) {
         newarg = (char *)malloc(strlen(arg) + 10);
         strcpy(newarg, arg);
-        newarg[pathlen] = 0;
+        newarg[name - arg] = 0;
         strcat(newarg, ".libs/");
 
         if (strncmp(name, "lib", 3) == 0) {
@@ -353,7 +357,6 @@
           newarg = truncate_dll_name(newarg);
         }
 #endif
-
         cmd_data->arglist[cmd_data->num_args++] = newarg;
         cmd_data->output_name = newarg;
         return true;
Only in apr-1.6.5/build: aplibtool.exe
Only in apr-1.6.5/build: apr_rules.mk
Only in apr-1.6.5/build/pkg: pkginfo
Only in apr-1.6.5: build.cmd
Only in apr-1.6.5: build.log
Only in apr-1.6.5: conf.cmd
Only in apr-1.6.5: config.log
Only in apr-1.6.5: config.nice
Only in apr-1.6.5: config.status
diff -ur apr-1.6.5-o/configure.in apr-1.6.5/configure.in
--- apr-1.6.5-o/configure.in	2018-08-26 00:26:56.000000000 +0930
+++ apr-1.6.5/configure.in	2018-10-31 19:14:44.000000000 +1030
@@ -243,6 +243,23 @@
     echo "using aplibtool"
     LIBTOOL="$srcdir/build/aplibtool"
     gcc $CFLAGS $CPPFLAGS -o $LIBTOOL.exe $LIBTOOL.c
+    # Determine ECHO
+    # Test print first, because it will be a builtin if present.
+    if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+       test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+        ECHO='print -r --'
+    elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+        ECHO='printf %s\n'
+    else
+        # Use this function as a fallback that always works.
+        func_fallback_echo ()
+        {
+            eval 'cat <<_ACEOF
+$1
+_ACEOF'
+        }
+        ECHO='func_fallback_echo'
+    fi
     ;;
 *)
     if test "x$LTFLAGS" = "x"; then
Only in apr-1.6.5: configure.log
diff -ur apr-1.6.5-o/dso/os2/dso.c apr-1.6.5/dso/os2/dso.c
--- apr-1.6.5-o/dso/os2/dso.c	2006-08-03 20:25:30.000000000 +0930
+++ apr-1.6.5/dso/os2/dso.c	2018-10-31 19:14:44.000000000 +1030
@@ -18,6 +18,7 @@
 #include "apr_strings.h"
 #include "apr_portable.h"
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 
 #if APR_HAS_DSO
@@ -50,13 +51,23 @@
     (*res_handle)->load_error = APR_SUCCESS;
     (*res_handle)->failed_module = NULL;
 
-    if ((rc = DosLoadModule(failed_module, sizeof(failed_module), path, &handle)) != 0) {
+    rc = DosLoadModule(failed_module, sizeof(failed_module), path, &handle);
+
+   if ((rc != 0)&&(rc!=87)) {
         (*res_handle)->load_error = APR_FROM_OS_ERROR(rc);
         (*res_handle)->failed_module = apr_pstrdup(ctx, failed_module);
         return APR_FROM_OS_ERROR(rc);
     }
 
+   if (rc==87){
+        int rc2;
+        HMODULE handle2;
+        rc2=DosQueryModuleHandle(path,&handle2);
+        (*res_handle)->handle  = handle2;
+        }
+   if (rc==0) 
     (*res_handle)->handle  = handle;
+
     apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null);
     return APR_SUCCESS;
 }
@@ -80,7 +91,16 @@
     if (symname == NULL || ressym == NULL)
         return APR_ESYMNOTFOUND;
 
-    if ((rc = DosQueryProcAddr(handle->handle, 0, symname, &func)) != 0) {
+#if defined(__INNOTEK_LIBC__)
+    void *retval;
+    char *symbol = (char*)malloc(sizeof(char)*(strlen(symname)+2));
+    sprintf(symbol, "_%s", symname);
+    rc = DosQueryProcAddr(handle->handle, 0, symbol, &func);
+    free(symbol);
+#else
+    rc = DosQueryProcAddr(handle->handle, 0, symname, &func);
+#endif
+    if (rc != 0) {
         handle->load_error = APR_FROM_OS_ERROR(rc);
         return handle->load_error;
     }
Only in apr-1.6.5/dso/os2: dso.lo
Only in apr-1.6.5/dso/os2: dso.o
Only in apr-1.6.5/encoding: apr_escape.lo
Only in apr-1.6.5/encoding: apr_escape.o
Only in apr-1.6.5: env.cmd
Only in apr-1.6.5/file_io/os2: buffer.lo
Only in apr-1.6.5/file_io/os2: buffer.o
Only in apr-1.6.5/file_io/os2: copy.lo
Only in apr-1.6.5/file_io/os2: copy.o
Only in apr-1.6.5/file_io/os2: dir_make_recurse.lo
Only in apr-1.6.5/file_io/os2: dir_make_recurse.o
diff -ur apr-1.6.5-o/file_io/os2/dir.c apr-1.6.5/file_io/os2/dir.c
--- apr-1.6.5-o/file_io/os2/dir.c	2006-08-03 20:25:30.000000000 +0930
+++ apr-1.6.5/file_io/os2/dir.c	2018-11-04 07:40:46.000000000 +1030
@@ -21,6 +21,16 @@
 #include "apr_portable.h"
 #include <string.h>
 
+#if ( defined(__INNOTEK_LIBCxx__) || defined(__WATCOMC__) )
+/* Paul - I didn't see F_OK defined in io.h so I add this incase - asking Bird
+ * says in fcntl.h or unistd.h
+ */
+#ifndef F_OK
+#define F_OK  0
+#endif
+#include <io.h>
+#endif
+
 static apr_status_t dir_cleanup(void *thedir)
 {
     apr_dir_t *dir = thedir;
@@ -46,6 +56,14 @@
     thedir->validentry = FALSE;
     *new = thedir;
     apr_pool_cleanup_register(pool, thedir, dir_cleanup, apr_pool_cleanup_null);
+    /* In testdir, a call to a non-existent directory and the expected return is
+     * APR_ENOENT. I am adding a quick access( ), which is supported by new gcc and
+     * Open Watcom. If the dir doesn' exist we bug-out with the correct error.
+     */
+#if ( defined(__INNOTEK_LIBC__) || defined(__WATCOMC__) )
+    if(access(dirname, F_OK) != 0) return APR_ENOENT;
+#endif
+
     return APR_SUCCESS;
 }
 
Only in apr-1.6.5/file_io/os2: dir.lo
Only in apr-1.6.5/file_io/os2: dir.o
diff -ur apr-1.6.5-o/file_io/os2/filedup.c apr-1.6.5/file_io/os2/filedup.c
--- apr-1.6.5-o/file_io/os2/filedup.c	2013-10-04 00:05:18.000000000 +0930
+++ apr-1.6.5/file_io/os2/filedup.c	2018-10-31 19:14:44.000000000 +1030
@@ -51,6 +51,7 @@
     dup_file->flags = old_file->flags & ~APR_INHERIT;
     /* TODO - dup pipes correctly */
     dup_file->pipe = old_file->pipe;
+    dup_file->ungetchar = old_file->ungetchar;
 
     if (*new_file == NULL) {
         apr_pool_cleanup_register(dup_file->pool, dup_file, apr_file_cleanup,
diff -ur apr-1.6.5-o/file_io/os2/filestat.c apr-1.6.5/file_io/os2/filestat.c
--- apr-1.6.5-o/file_io/os2/filestat.c	2006-08-03 20:25:30.000000000 +0930
+++ apr-1.6.5/file_io/os2/filestat.c	2018-10-31 19:14:44.000000000 +1030
@@ -84,7 +84,123 @@
     return APR_FROM_OS_ERROR(rc);
 }
 
+#ifdef __KLIBC__
+static apr_filetype_e filetype_from_mode(mode_t mode)
+{
+    apr_filetype_e type;
+
+    switch (mode & S_IFMT) {
+    case S_IFREG:
+        type = APR_REG;  break;
+    case S_IFDIR:
+        type = APR_DIR;  break;
+    case S_IFLNK:
+        type = APR_LNK;  break;
+    case S_IFCHR:
+        type = APR_CHR;  break;
+    case S_IFBLK:
+        type = APR_BLK;  break;
+#if defined(S_IFFIFO)
+    case S_IFFIFO:
+        type = APR_PIPE; break;
+#endif
+#if !defined(BEOS) && defined(S_IFSOCK)
+    case S_IFSOCK:
+        type = APR_SOCK; break;
+#endif
+
+    default:
+	/* Work around missing S_IFxxx values above
+         * for Linux et al.
+         */
+#if !defined(S_IFFIFO) && defined(S_ISFIFO)
+    	if (S_ISFIFO(mode)) {
+            type = APR_PIPE;
+	} else
+#endif
+#if !defined(BEOS) && !defined(S_IFSOCK) && defined(S_ISSOCK)
+    	if (S_ISSOCK(mode)) {
+            type = APR_SOCK;
+	} else
+#endif
+        type = APR_UNKFILE;
+    }
+    return type;
+}
+
+static void fill_out_finfo(apr_finfo_t *finfo, struct_stat *info,
+                           apr_int32_t wanted)
+{ 
+    finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK
+                 | APR_FINFO_OWNER | APR_FINFO_PROT;
+    finfo->protection = apr_unix_mode2perms(info->st_mode);
+    finfo->filetype = filetype_from_mode(info->st_mode);
+    finfo->user = info->st_uid;
+    finfo->group = info->st_gid;
+    finfo->size = info->st_size;
+    finfo->inode = info->st_ino;
+    finfo->device = info->st_dev;
+    finfo->nlink = info->st_nlink;
+    apr_time_ansi_put(&finfo->atime, info->st_atime);
+#ifdef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
+    finfo->atime += info->st_atim.tv_nsec / APR_TIME_C(1000);
+#elif defined(HAVE_STRUCT_STAT_ST_ATIMENSEC)
+    finfo->atime += info->st_atimensec / APR_TIME_C(1000);
+#elif defined(HAVE_STRUCT_STAT_ST_ATIME_N)
+    finfo->ctime += info->st_atime_n / APR_TIME_C(1000);
+#endif
+
+    apr_time_ansi_put(&finfo->mtime, info->st_mtime);
+#ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
+    finfo->mtime += info->st_mtim.tv_nsec / APR_TIME_C(1000);
+#elif defined(HAVE_STRUCT_STAT_ST_MTIMENSEC)
+    finfo->mtime += info->st_mtimensec / APR_TIME_C(1000);
+#elif defined(HAVE_STRUCT_STAT_ST_MTIME_N)
+    finfo->ctime += info->st_mtime_n / APR_TIME_C(1000);
+#endif
+
+    apr_time_ansi_put(&finfo->ctime, info->st_ctime);
+#ifdef HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC
+    finfo->ctime += info->st_ctim.tv_nsec / APR_TIME_C(1000);
+#elif defined(HAVE_STRUCT_STAT_ST_CTIMENSEC)
+    finfo->ctime += info->st_ctimensec / APR_TIME_C(1000);
+#elif defined(HAVE_STRUCT_STAT_ST_CTIME_N)
+    finfo->ctime += info->st_ctime_n / APR_TIME_C(1000);
+#endif
+
+#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
+#ifdef DEV_BSIZE
+    finfo->csize = (apr_off_t)info->st_blocks * (apr_off_t)DEV_BSIZE;
+#else
+    finfo->csize = (apr_off_t)info->st_blocks * (apr_off_t)512;
+#endif
+    finfo->valid |= APR_FINFO_CSIZE;
+#endif
+}
+
+apr_status_t apr_file_info_get_locked(apr_finfo_t *finfo, apr_int32_t wanted,
+                                      apr_file_t *thefile)
+{
+
+    struct_stat info;
 
+    if (thefile->buffered) {
+        apr_status_t rv = apr_file_flush_locked(thefile);
+        if (rv != APR_SUCCESS)
+            return rv;
+    }
+
+    if (fstat(thefile->filedes, &info) == 0) {
+        finfo->pool = thefile->pool;
+        finfo->fname = thefile->fname;
+        fill_out_finfo(finfo, &info, wanted);
+        return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS;
+    }
+    else {
+        return errno;
+    }
+}
+#endif
 
 APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, 
                                    apr_file_t *thefile)
@@ -130,6 +246,29 @@
     return APR_ENOTIMPL;
 }
 
+/* duplciated from dir_make_recurse.c */
+
+#define IS_SEP(c) (c == '/' || c == '\\')
+
+/* Remove trailing separators that don't affect the meaning of PATH. */
+static const char *path_canonicalize(const char *path, apr_pool_t *pool)
+{
+    /* At some point this could eliminate redundant components.  For
+     * now, it just makes sure there is no trailing slash. */
+    apr_size_t len = strlen(path);
+    apr_size_t orig_len = len;
+
+    while ((len > 0) && IS_SEP(path[len - 1])) {
+        len--;
+    }
+
+    if (len != orig_len) {
+        return apr_pstrndup(pool, path, len);
+    }
+    else {
+        return path;
+    }
+}
 
 APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname,
                               apr_int32_t wanted, apr_pool_t *cont)
@@ -140,8 +279,10 @@
     finfo->protection = 0;
     finfo->filetype = APR_NOFILE;
     finfo->name = NULL;
-    rc = DosQueryPathInfo(fname, FIL_STANDARD, &fstatus, sizeof(fstatus));
-    
+
+    /* remove trailing / from any paths, otherwise DosQueryPathInfo will fail */
+    const char *newfname = path_canonicalize(fname, cont);
+    rc = DosQueryPathInfo(newfname, FIL_STANDARD, &fstatus, sizeof(fstatus));
     if (rc == 0) {
         FS3_to_finfo(finfo, &fstatus);
         finfo->fname = fname;
@@ -172,7 +313,12 @@
         return APR_FROM_OS_ERROR(rc);
     }
 
+#ifndef __INNOTEK_LIBC__
     return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS;
+#else
+    return APR_SUCCESS;
+#endif
+
 }
 
 
diff -ur apr-1.6.5-o/file_io/os2/maperrorcode.c apr-1.6.5/file_io/os2/maperrorcode.c
--- apr-1.6.5-o/file_io/os2/maperrorcode.c	2006-08-03 20:25:30.000000000 +0930
+++ apr-1.6.5/file_io/os2/maperrorcode.c	2018-10-31 19:14:44.000000000 +1030
@@ -18,8 +18,8 @@
 #include "apr_arch_file_io.h"
 #include "apr_file_io.h"
 #include <errno.h>
-#include <string.h>
 #include "apr_errno.h"
+#include <string.h>
 
 static int errormap[][2] = {
     { NO_ERROR,                   APR_SUCCESS      },
@@ -37,7 +37,7 @@
     { ERROR_NEGATIVE_SEEK,        APR_ESPIPE       },
     { ERROR_NO_SIGNAL_SENT,       ESRCH            },
     { ERROR_NO_DATA,              APR_EAGAIN       },
-    { SOCEINTR,                 EINTR           },
+    { SOCEINTR,         	EINTR           },
     { SOCEWOULDBLOCK,           EWOULDBLOCK     },
     { SOCEINPROGRESS,           EINPROGRESS     },
     { SOCEALREADY,              EALREADY        },
@@ -70,7 +70,8 @@
     { SOCEHOSTDOWN,             EHOSTDOWN       },
     { SOCEHOSTUNREACH,          EHOSTUNREACH    },
     { SOCENOTEMPTY,             ENOTEMPTY       },
-    { SOCEPIPE,                 EPIPE           }
+    { SOCEPIPE,                 EPIPE           },
+    { SOCEFAULT,		EFAULT		}
 };
 
 #define MAPSIZE (sizeof(errormap)/sizeof(errormap[0]))
@@ -81,15 +82,13 @@
 
     if (err < APR_OS_START_SYSERR)
         return err;
-
     err -= APR_OS_START_SYSERR;
-
     for (index=0; index<MAPSIZE && errormap[index][0] != err; index++);
     
     if (index<MAPSIZE)
         rv = errormap[index][1];
     else
-        fprintf(stderr, "apr_canonical_error: Unknown OS/2 error code %d\n", err );
+        fprintf(stderr, "apr_canonical_error: Unknown OS/2 error code %d\n",err);
         
     return rv;
 }
diff -ur apr-1.6.5-o/file_io/os2/open.c apr-1.6.5/file_io/os2/open.c
--- apr-1.6.5-o/file_io/os2/open.c	2013-11-02 22:06:02.000000000 +1030
+++ apr-1.6.5/file_io/os2/open.c	2018-10-31 19:14:44.000000000 +1030
@@ -28,6 +28,59 @@
     return apr_file_close(file);
 }
 
+#ifdef __INNOTEK_LIBC__
+static apr_status_t file_cleanup(apr_file_t *file)
+{
+    apr_status_t rv = APR_SUCCESS;
+
+    if (close(file->filedes) == 0) {
+        file->filedes = -1;
+        if (file->flags & APR_DELONCLOSE) {
+            unlink(file->fname);
+        }
+#if APR_HAS_THREADS
+        if (file->mutex) {
+            rv = apr_thread_mutex_destroy(file->mutex);
+        }
+#endif
+    }
+    else {
+        /* Are there any error conditions other than EINTR or EBADF? */
+        rv = errno;
+    }
+#ifndef WAITIO_USES_POLL
+    if (file->pollset != NULL) {
+        int pollset_rv = apr_pollset_destroy(file->pollset);
+        /* If the file close failed, return its error value,
+         * not apr_pollset_destroy()'s.
+         */
+        if (rv == APR_SUCCESS) {
+            rv = pollset_rv;
+        }
+    }
+#endif /* !WAITIO_USES_POLL */
+    return rv;
+}
+
+apr_status_t apr_unix_file_cleanup(void *thefile)
+{
+    apr_file_t *file = thefile;
+    apr_status_t flush_rv = APR_SUCCESS, rv = APR_SUCCESS;
+
+    if (file->buffered) {
+        flush_rv = apr_file_flush(file);
+    }
+
+    rv = file_cleanup(file);
+
+    return rv != APR_SUCCESS ? rv : flush_rv;
+}
+
+apr_status_t apr_unix_child_file_cleanup(void *thefile)
+{
+    return file_cleanup(thefile);
+}
+#endif
 
 
 APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag,  apr_fileperms_t perm, apr_pool_t *pool)
@@ -36,6 +89,9 @@
     int mflags = OPEN_FLAGS_FAIL_ON_ERROR|OPEN_SHARE_DENYNONE|OPEN_FLAGS_NOINHERIT;
     int rv;
     ULONG action;
+    ULONG    CurMaxFH      = 0;          /* Current count of handles         */
+    LONG     ReqCount      = 0;          /* Number to adjust file handles    */
+
     apr_file_t *dafile = (apr_file_t *)apr_palloc(pool, sizeof(apr_file_t));
 
     if (flag & APR_FOPEN_NONBLOCK) {
@@ -89,7 +145,16 @@
     }
     
     rv = DosOpen(fname, &(dafile->filedes), &action, 0, 0, oflags, mflags, NULL);
-    
+
+    if (rv == ERROR_TOO_MANY_OPEN_FILES) {
+	rv = DosSetRelMaxFH(&ReqCount,     /* Using 0 here will return the       */
+                      &CurMaxFH);    /* current number of file handles     */
+	ReqCount      = 10L;         /* Want 10 more file handles         */
+	rv = DosSetRelMaxFH(&ReqCount,&CurMaxFH);     /* Change handle maximum */
+
+	rv = DosOpen(fname, &(dafile->filedes), &action, 0, 0, oflags, mflags, NULL);
+    }    
+
     if (rv == 0 && (flag & APR_FOPEN_APPEND)) {
         ULONG newptr;
         rv = DosSetFilePtr(dafile->filedes, 0, FILE_END, &newptr );
@@ -100,7 +165,7 @@
     
     if (rv != 0)
         return APR_FROM_OS_ERROR(rv);
-    
+   
     dafile->isopen = TRUE;
     dafile->fname = apr_pstrdup(pool, fname);
     dafile->filePtr = 0;
@@ -108,6 +173,8 @@
     dafile->dataRead = 0;
     dafile->direction = 0;
     dafile->pipe = FALSE;
+    dafile->ungetchar = -1;
+
 
     if (!(flag & APR_FOPEN_NOCLEANUP)) {
         apr_pool_cleanup_register(dafile->pool, dafile, apr_file_cleanup, apr_file_cleanup);
@@ -127,6 +194,12 @@
     if (file && file->isopen) {
         /* XXX: flush here is not mutex protected */
         status = apr_file_flush(file);
+
+	/* 2014-11-18 SHL ensure client sees ERROR_BROKEN_PIPE */
+        if (file->pipe == 1) {
+            DosCloseEventSem(file->pipeSem);
+            DosDisConnectNPipe(file->filedes);
+        }
         rc = DosClose(file->filedes);
     
         if (rc == 0) {
@@ -197,6 +270,7 @@
     (*file)->flags = flags;
     (*file)->pipe = FALSE;
     (*file)->buffered = (flags & APR_FOPEN_BUFFERED) > 0;
+    (*file)->ungetchar = -1;
 
     if ((*file)->buffered) {
         apr_status_t rv;
@@ -279,11 +353,9 @@
     ULONG state;
 
     rv = DosQueryFHState(thefile->filedes, &state);
-
     if (rv == 0 && (state & OPEN_FLAGS_NOINHERIT) != 0) {
         rv = DosSetFHState(thefile->filedes, state & ~OPEN_FLAGS_NOINHERIT);
     }
-
     return APR_FROM_OS_ERROR(rv);
 }
 
@@ -295,10 +367,14 @@
     ULONG state;
 
     rv = DosQueryFHState(thefile->filedes, &state);
-
     if (rv == 0 && (state & OPEN_FLAGS_NOINHERIT) == 0) {
-        rv = DosSetFHState(thefile->filedes, state | OPEN_FLAGS_NOINHERIT);
+/*        rv = DosSetFHState(thefile->filedes, state | OPEN_FLAGS_NOINHERIT);*/
     }
-
     return APR_FROM_OS_ERROR(rv);
 }
+
+APR_DECLARE(apr_status_t) apr_file_link(const char *from_path, 
+                                          const char *to_path)
+{
+    return APR_ENOTIMPL;;
+}
diff -ur apr-1.6.5-o/file_io/os2/pipe.c apr-1.6.5/file_io/os2/pipe.c
--- apr-1.6.5-o/file_io/os2/pipe.c	2016-03-25 11:58:12.000000000 +1030
+++ apr-1.6.5/file_io/os2/pipe.c	2018-10-31 19:14:44.000000000 +1030
@@ -31,9 +31,11 @@
     ULONG rc, action;
     static int id = 0;
     char pipename[50];
+    ULONG    CurMaxFH      = 0;          /* Current count of handles         */
+    LONG     ReqCount      = 0;          /* Number to adjust file handles    */
 
     sprintf(pipename, "/pipe/%d.%d", getpid(), id++);
-    rc = DosCreateNPipe(pipename, filedes, NP_ACCESS_INBOUND, NP_NOWAIT|1, 4096, 4096, 0);
+    rc = DosCreateNPipe(pipename, filedes, NP_ACCESS_INBOUND, NP_NOWAIT|0x01, 4096, 4096, 0);
 
     if (rc)
         return APR_FROM_OS_ERROR(rc);
@@ -49,6 +51,18 @@
                   OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW,
                   OPEN_ACCESS_WRITEONLY | OPEN_SHARE_DENYREADWRITE,
                   NULL);
+    if (rc == ERROR_TOO_MANY_OPEN_FILES) {
+	rc = DosSetRelMaxFH(&ReqCount,     /* Using 0 here will return the       */
+                      &CurMaxFH);    /* current number of file handles     */
+	ReqCount      = 10L;         /* Want 10 more file handles         */
+	rc = DosSetRelMaxFH(&ReqCount,&CurMaxFH);     /* Change handle maximum */
+
+	rc = DosOpen (pipename, filedes+1, &action, 0, FILE_NORMAL,
+                  OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW,
+                  OPEN_ACCESS_WRITEONLY | OPEN_SHARE_DENYREADWRITE,
+                  NULL);
+
+    }    
 
     if (rc) {
         DosClose(filedes[0]);
@@ -85,6 +99,7 @@
     (*in)->flags = 0;
     (*in)->pipe = 1;
     (*in)->timeout = -1;
+    (*in)->ungetchar = -1;
     (*in)->blocking = BLK_ON;
     apr_pool_cleanup_register(pool_in, *in, apr_file_cleanup,
             apr_pool_cleanup_null);
@@ -96,7 +111,8 @@
     (*out)->isopen = TRUE;
     (*out)->buffered = FALSE;
     (*out)->flags = 0;
-    (*out)->pipe = 1;
+    (*out)->pipe = 2;			// 2014-11-17 SHL mark as client pipe
+    (*out)->ungetchar = -1;
     (*out)->timeout = -1;
     (*out)->blocking = BLK_ON;
     apr_pool_cleanup_register(pool_out, *out, apr_file_cleanup,
@@ -173,23 +189,24 @@
 
 APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout)
 {
+    int rc = 0;
+
     if (thepipe->pipe == 1) {
         thepipe->timeout = timeout;
 
-        if (thepipe->timeout >= 0) {
-            if (thepipe->blocking != BLK_OFF) {
+        if ((thepipe->timeout >= 0) && (thepipe->blocking != BLK_OFF) ) {
                 thepipe->blocking = BLK_OFF;
-                return APR_FROM_OS_ERROR(DosSetNPHState(thepipe->filedes, NP_NOWAIT));
-            }
+            rc = DosSetNPHState(thepipe->filedes, NP_NOWAIT);
         }
-        else if (thepipe->timeout == -1) {
-            if (thepipe->blocking != BLK_ON) {
+        else if ( (thepipe->timeout == -1) && (thepipe->blocking != BLK_ON) ) {
                 thepipe->blocking = BLK_ON;
-                return APR_FROM_OS_ERROR(DosSetNPHState(thepipe->filedes, NP_WAIT));
-            }
-        }
+            rc = DosSetNPHState(thepipe->filedes, NP_WAIT);
     }
-    return APR_EINVAL;
+
+        return APR_FROM_OS_ERROR(rc);
+
+    } else return APR_EINVAL;
+
 }
 
 
@@ -216,6 +233,7 @@
     (*file)->pipe = 1;
     (*file)->blocking = BLK_UNKNOWN; /* app needs to make a timeout call */
     (*file)->timeout = -1;
+    (*file)->ungetchar = -1;
     (*file)->filedes = *thefile;
 
     if (register_cleanup) {
diff -ur apr-1.6.5-o/file_io/os2/readwrite.c apr-1.6.5/file_io/os2/readwrite.c
--- apr-1.6.5-o/file_io/os2/readwrite.c	2011-02-18 21:54:40.000000000 +1030
+++ apr-1.6.5/file_io/os2/readwrite.c	2018-12-30 13:28:56.000000000 +1030
@@ -24,20 +24,34 @@
 
 #include <malloc.h>
 
-APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes)
+APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *len)
 {
     ULONG rc = 0;
-    ULONG bytesread;
+    ULONG bytes_read = 0;
 
-    if (!thefile->isopen) {
-        *nbytes = 0;
-        return APR_EBADF;
+    if (*len <= 0) {
+        *len = 0;
+        return APR_SUCCESS;
     }
-
+#if 1
+    /* Handle the ungetchar if there is one */
+    /* copied from win32/readwrite.c */
+    if (thefile->ungetchar != -1) {
+        bytes_read = 1;
+        *(char *)buf = (char)thefile->ungetchar;
+        buf = (char *)buf + 1;
+        (*len)--;
+        thefile->ungetchar = -1;
+        if (*len == 0) {
+            *len = bytes_read;
+            return APR_SUCCESS;
+        }
+    }
+#endif
     if (thefile->buffered) {
         char *pos = (char *)buf;
         ULONG blocksize;
-        ULONG size = *nbytes;
+        ULONG size = *len;
 
         apr_thread_mutex_lock(thefile->mutex);
 
@@ -56,20 +70,20 @@
 
         while (rc == 0 && size > 0) {
             if (thefile->bufpos >= thefile->dataRead) {
-                ULONG bytesread;
+                ULONG bytes_read;
                 rc = DosRead(thefile->filedes, thefile->buffer,
-                             thefile->bufsize, &bytesread);
-
-                if (bytesread == 0) {
+                             thefile->bufsize, &bytes_read);
+                if (bytes_read == 0) {
                     if (rc == 0)
                         thefile->eof_hit = TRUE;
                     break;
                 }
-
-                thefile->dataRead = bytesread;
+		else {
+	                thefile->dataRead = bytes_read;
                 thefile->filePtr += thefile->dataRead;
                 thefile->bufpos = 0;
             }
+            }
 
             blocksize = size > thefile->dataRead - thefile->bufpos ? thefile->dataRead - thefile->bufpos : size;
             memcpy(pos, thefile->buffer + thefile->bufpos, blocksize);
@@ -78,40 +92,50 @@
             size -= blocksize;
         }
 
-        *nbytes = rc == 0 ? pos - (char *)buf : 0;
+        *len = rc == 0 ? pos - (char *)buf : 0;
         apr_thread_mutex_unlock(thefile->mutex);
 
-        if (*nbytes == 0 && rc == 0 && thefile->eof_hit) {
+        if (*len == 0 && rc == 0 && thefile->eof_hit) {
             return APR_EOF;
         }
 
         return APR_FROM_OS_ERROR(rc);
     } else {
-        if (thefile->pipe)
-            DosResetEventSem(thefile->pipeSem, &rc);
+        /* Unbuffered i/o */
+        apr_size_t nbytes;
 
-        rc = DosRead(thefile->filedes, buf, *nbytes, &bytesread);
-
-        if (rc == ERROR_NO_DATA && thefile->timeout != 0) {
-            int rcwait = DosWaitEventSem(thefile->pipeSem, thefile->timeout >= 0 ? thefile->timeout / 1000 : SEM_INDEFINITE_WAIT);
-
-            if (rcwait == 0) {
-                rc = DosRead(thefile->filedes, buf, *nbytes, &bytesread);
+        // 2014-11-11 SHL reworked to support ERROR_MORE_DATA etc.
+	for (;;) {
+	    int post_count;
+        if (thefile->pipe)
+		DosResetEventSem(thefile->pipeSem, &post_count);
+	    rc = DosRead(thefile->filedes, buf, *len, &nbytes);
+	    if (!thefile->pipe)
+		break;			// Blocking i/o - we are done
+	    if (rc == ERROR_MORE_DATA) {
+		// Buffer is full - caller will read more eventually
+		rc = NO_ERROR;
+		break;
             }
-            else if (rcwait == ERROR_TIMEOUT) {
-                *nbytes = 0;
+	    if (thefile->timeout == 0)
+		break;
+	    if (rc != ERROR_NO_DATA)
+		break;
+	    rc = DosWaitEventSem(thefile->pipeSem, thefile->timeout >= 0 ? thefile->timeout / 1000 : SEM_INDEFINITE_WAIT);
+	    if (rc == ERROR_TIMEOUT) {
+		*len = 0;
                 return APR_TIMEUP;
             }
-        }
+	} // for
 
         if (rc) {
-            *nbytes = 0;
+	    *len = 0;
             return APR_FROM_OS_ERROR(rc);
         }
 
-        *nbytes = bytesread;
+	*len = nbytes;
         
-        if (bytesread == 0) {
+	if (nbytes == 0) {
             thefile->eof_hit = TRUE;
             return APR_EOF;
         }
@@ -126,17 +150,14 @@
 {
     ULONG rc = 0;
     ULONG byteswritten;
-
     if (!thefile->isopen) {
         *nbytes = 0;
         return APR_EBADF;
     }
-
     if (thefile->buffered) {
         char *pos = (char *)buf;
         int blocksize;
         int size = *nbytes;
-
         apr_thread_mutex_lock(thefile->mutex);
 
         if ( thefile->direction == 0 ) {
@@ -147,40 +168,68 @@
             thefile->bufpos = thefile->dataRead = 0;
             thefile->direction = 1;
         }
-
         while (rc == 0 && size > 0) {
-            if (thefile->bufpos == thefile->bufsize) /* write buffer is full */
+	    if (thefile->bufpos == thefile->bufsize){ /* write buffer is full */
                 /* XXX bug; - rc is double-transformed os->apr below */
                 rc = apr_file_flush(thefile);
-
-            blocksize = size > thefile->bufsize - thefile->bufpos ? thefile->bufsize - thefile->bufpos : size;
+		}
+	    blocksize = size > thefile->bufsize - thefile->bufpos ? 
+	                       thefile->bufsize - thefile->bufpos : size;
             memcpy(thefile->buffer + thefile->bufpos, pos, blocksize);
             thefile->bufpos += blocksize;
             pos += blocksize;
             size -= blocksize;
         }
-
         apr_thread_mutex_unlock(thefile->mutex);
         return APR_FROM_OS_ERROR(rc);
     } else {
+/* new stuff */
+        void *pvBuf_safe = NULL;
+
+        /*
+         * Devices doesn't like getting high addresses.
+         */
+        if (isatty(thefile->filedes)
+            &&  (unsigned)buf >= 512*1024*1024)
+        {
+            if (*nbytes > 256)
+            {   /* use heap for large buffers */
+                pvBuf_safe = _lmalloc(*nbytes);
+                if (!pvBuf_safe)
+                {
+                    errno = ENOMEM;
+	            return APR_FROM_OS_ERROR(errno);
+                }
+                memcpy(pvBuf_safe, buf, *nbytes);
+                buf = pvBuf_safe;
+            }
+            else
+            {   /* use stack for small buffers */
+                pvBuf_safe = alloca(*nbytes);
+                memcpy(pvBuf_safe, buf, *nbytes);
+                buf = pvBuf_safe;
+                pvBuf_safe = NULL;
+            }
+        }
+/* end new stuff */
         if (thefile->flags & APR_FOPEN_APPEND) {
             FILELOCK all = { 0, 0x7fffffff };
             ULONG newpos;
             rc = DosSetFileLocks(thefile->filedes, NULL, &all, -1, 0);
-
             if (rc == 0) {
                 rc = DosSetFilePtr(thefile->filedes, 0, FILE_END, &newpos);
-
                 if (rc == 0) {
-                    rc = DosWrite(thefile->filedes, buf, *nbytes, &byteswritten);
+	            rc = DosWrite(thefile->filedes, (PVOID)buf, *nbytes, &byteswritten);
                 }
-
                 DosSetFileLocks(thefile->filedes, &all, NULL, -1, 0);
             }
         } else {
             rc = DosWrite(thefile->filedes, buf, *nbytes, &byteswritten);
         }
-
+/* new stuff */
+        if (pvBuf_safe)
+            free(pvBuf_safe);
+/* end new stuff */
         if (rc) {
             *nbytes = 0;
             return APR_FROM_OS_ERROR(rc);
@@ -193,92 +242,82 @@
 
 
 
-#ifdef HAVE_WRITEV
-
 APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes)
 {
-    int bytes;
+    apr_status_t rv = APR_SUCCESS;
+    apr_size_t i;
+    apr_size_t bwrote = 0;
+    char *buf;
 
-    if (thefile->buffered) {
-        apr_status_t rv = apr_file_flush(thefile);
+    *nbytes = 0;
+    for (i = 0; i < nvec; i++) {
+	buf = vec[i].iov_base;
+	bwrote = vec[i].iov_len;
+	rv = apr_file_write(thefile, buf, &bwrote);
+	*nbytes += bwrote;
         if (rv != APR_SUCCESS) {
-            return rv;
+	    break;
         }
     }
-
-    if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) {
-        *nbytes = 0;
-        return errno;
-    }
-    else {
-        *nbytes = bytes;
-        return APR_SUCCESS;
+    return rv;
     }
-}
-#endif
 
 
 
 APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile)
 {
-    ULONG rc;
-    ULONG byteswritten;
+    apr_size_t nbytes = 1;
 
-    if (!thefile->isopen) {
-        return APR_EBADF;
+    return apr_file_write(thefile, &ch, &nbytes);
     }
 
-    rc = DosWrite(thefile->filedes, &ch, 1, &byteswritten);
 
-    if (rc) {
-        return APR_FROM_OS_ERROR(rc);
-    }
     
-    return APR_SUCCESS;
-}
-
-
-
 APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile)
 {
-    apr_off_t offset = -1;
-    return apr_file_seek(thefile, APR_CUR, &offset);
+    thefile->ungetchar = (unsigned char)ch;
+    return APR_SUCCESS; 
 }
 
 
 APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile)
 {
-    ULONG rc;
-    apr_size_t bytesread;
+    apr_size_t nbytes = 1;
+
+    return apr_file_read(thefile, ch, &nbytes);
 
-    if (!thefile->isopen) {
-        return APR_EBADF;
     }
 
-    bytesread = 1;
-    rc = apr_file_read(thefile, ch, &bytesread);
 
-    if (rc) {
-        return rc;
-    }
     
-    if (bytesread == 0) {
-        thefile->eof_hit = TRUE;
-        return APR_EOF;
+APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile)
+{
+    return apr_file_write_full(thefile, str, strlen(str), NULL);
     }
     
-    return APR_SUCCESS;
-}
-
 
 
-APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile)
+apr_status_t apr_file_flush_locked(apr_file_t *thefile)
 {
-    apr_size_t len;
+    apr_status_t rv = APR_SUCCESS;
+
+    if (thefile->direction == 1 && thefile->bufpos) {
+	apr_ssize_t written;
 
-    len = strlen(str);
-    return apr_file_write(thefile, str, &len); 
+	do {
+	    written = write(thefile->filedes, thefile->buffer, thefile->bufpos);
+	} while (written == -1 && errno == EINTR);
+	if (written == -1) {
+	    rv = errno;
+	} else {
+	    thefile->filePtr += written;
+	    thefile->bufpos = 0;
 }
+    }
+
+    return rv;
+}
+
 
 
 APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile)
@@ -349,10 +388,61 @@
 }
 
 
+/* Pull from unix code to start a sync up */
+#if (defined(__INNOTEK_LIBC__) || defined(__WATCOMC__) )
+
+struct apr_file_printf_data {
+    apr_vformatter_buff_t vbuff;
+    apr_file_t *fptr;
+    char *buf;
+};
+
+static int file_printf_flush(apr_vformatter_buff_t *buff)
+{
+    struct apr_file_printf_data *data = (struct apr_file_printf_data *)buff;
+
+    if (apr_file_write_full(data->fptr, data->buf,
+	                    data->vbuff.curpos - data->buf, NULL)) {
+	return -1;
+    }
+
+    data->vbuff.curpos = data->buf;
+    return 0;
+}
 
 APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, 
                                         const char *format, ...)
 {
+    struct apr_file_printf_data data;
+    va_list ap;
+    int count;
+
+    /* don't really need a HUGE_STRING_LEN anymore */
+    data.buf = malloc(HUGE_STRING_LEN);
+    if (data.buf == NULL) {
+	return -1;
+    }
+    data.vbuff.curpos = data.buf;
+    data.vbuff.endpos = data.buf + HUGE_STRING_LEN;
+    data.fptr = fptr;
+    va_start(ap, format);
+    count = apr_vformatter(file_printf_flush,
+	                   (apr_vformatter_buff_t *)&data, format, ap);
+    /* apr_vformatter does not call flush for the last bits */
+    if (count >= 0) file_printf_flush((apr_vformatter_buff_t *)&data);
+
+    va_end(ap);
+
+    free(data.buf);
+
+    return count;
+}
+
+#else
+
+APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, 
+	                                const char *format, ...)
+{
     int cc;
     va_list ap;
     char *buf;
@@ -369,7 +459,7 @@
     free(buf);
     return (cc == APR_SUCCESS) ? len : -1;
 }
-
+#endif
 
 
 apr_status_t apr_file_check_read(apr_file_t *fd)
diff -ur apr-1.6.5-o/file_io/os2/seek.c apr-1.6.5/file_io/os2/seek.c
--- apr-1.6.5-o/file_io/os2/seek.c	2006-08-03 20:25:30.000000000 +0930
+++ apr-1.6.5/file_io/os2/seek.c	2018-10-31 19:14:44.000000000 +1030
@@ -55,6 +55,7 @@
 
 APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset)
 {
+#ifndef __KLIBC__
     if (!thefile->isopen) {
         return APR_EBADF;
     }
@@ -100,6 +101,51 @@
 
         return APR_FROM_OS_ERROR(DosSetFilePtr(thefile->filedes, *offset, where, (ULONG *)offset));
     }
+#else
+    apr_off_t rv;
+
+    thefile->eof_hit = 0;
+
+    if (thefile->buffered) {
+        int rc = EINVAL;
+        apr_finfo_t finfo;
+
+        file_lock(thefile);
+
+        switch (where) {
+        case APR_SET:
+            rc = setptr(thefile, *offset);
+            break;
+
+        case APR_CUR:
+            rc = setptr(thefile, thefile->filePtr - thefile->dataRead + thefile->bufpos + *offset);
+            break;
+
+        case APR_END:
+            rc = apr_file_info_get_locked(&finfo, APR_FINFO_SIZE, thefile);
+            if (rc == APR_SUCCESS)
+                rc = setptr(thefile, finfo.size + *offset);
+            break;
+        }
+
+        *offset = thefile->filePtr - thefile->dataRead + thefile->bufpos;
+
+        file_unlock(thefile);
+
+        return rc;
+    }
+    else {
+        rv = lseek(thefile->filedes, *offset, where);
+        if (rv == -1) {
+            *offset = -1;
+            return errno;
+        }
+        else {
+            *offset = rv;
+            return APR_SUCCESS;
+        }
+    }
+#endif
 }
 
 
diff -ur apr-1.6.5-o/file_io/unix/fileacc.c apr-1.6.5/file_io/unix/fileacc.c
--- apr-1.6.5-o/file_io/unix/fileacc.c	2006-08-03 20:25:30.000000000 +0930
+++ apr-1.6.5/file_io/unix/fileacc.c	2018-10-31 19:14:44.000000000 +1030
@@ -31,7 +31,7 @@
     return f->flags;
 }
 
-#if !defined(OS2) && !defined(WIN32)
+#if (!defined(OS2) && !defined(WIN32)) || defined (__KLIBC__)
 mode_t apr_unix_perms2mode(apr_fileperms_t perms)
 {
     mode_t mode = 0;
diff -ur apr-1.6.5-o/file_io/unix/mktemp.c apr-1.6.5/file_io/unix/mktemp.c
--- apr-1.6.5-o/file_io/unix/mktemp.c	2014-02-13 05:52:46.000000000 +1030
+++ apr-1.6.5/file_io/unix/mktemp.c	2018-10-31 19:14:44.000000000 +1030
@@ -81,7 +81,9 @@
 #include <fcntl.h>
 #endif
 #include <stdio.h>
+#ifndef __INNOTEK_LIBC__
 #include <stdlib.h>
+#endif
 #include <string.h>
 #include <ctype.h>
 #ifdef HAVE_TIME_H
@@ -189,6 +191,11 @@
 #else
     fd = mkstemp(template);
 #endif
+
+#ifdef __INNOTEK_LIBC__
+          setmode(fd, O_BINARY);
+#endif 
+
     
     if (fd == -1) {
         return errno;
diff -ur apr-1.6.5-o/include/apr_errno.h apr-1.6.5/include/apr_errno.h
--- apr-1.6.5-o/include/apr_errno.h	2016-03-04 02:41:16.000000000 +1030
+++ apr-1.6.5/include/apr_errno.h	2018-10-31 19:14:44.000000000 +1030
@@ -853,7 +853,7 @@
 
 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
 #define APR_TO_OS_ERROR(e)   (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
-
+#define apr_get_os_error()    (errno)
 #define INCL_DOSERRORS
 #define INCL_DOS
 
@@ -934,7 +934,7 @@
                 || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED)
 #define APR_STATUS_IS_ENAMETOOLONG(s)   ((s) == APR_ENAMETOOLONG \
                 || (s) == APR_OS_START_SYSERR + ERROR_FILENAME_EXCED_RANGE \
-                || (s) == APR_OS_START_SYSERR + SOCENAMETOOLONG)
+                || (s) == APR_OS_START_SYSERR + SOCENAMETOOLONG  || (s) == SOCENAMETOOLONG)
 #define APR_STATUS_IS_ENOENT(s)         ((s) == APR_ENOENT \
                 || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \
                 || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \
@@ -954,9 +954,12 @@
                 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION)
 #define APR_STATUS_IS_ESPIPE(s)         ((s) == APR_ESPIPE \
                 || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK)
+/* 2015-02-06 SHL SHL Add more */
 #define APR_STATUS_IS_EAGAIN(s)         ((s) == APR_EAGAIN \
                 || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \
                 || (s) == APR_OS_START_SYSERR + SOCEWOULDBLOCK \
+                || (s) == APR_OS_START_SYSERR + ENOBUFS \
+                || (s) == APR_OS_START_SYSERR + SOCENOBUFS \
                 || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION)
 #define APR_STATUS_IS_EINTR(s)          ((s) == APR_EINTR \
                 || (s) == APR_OS_START_SYSERR + SOCEINTR)
diff -ur apr-1.6.5-o/include/apr_network_io.h apr-1.6.5/include/apr_network_io.h
--- apr-1.6.5-o/include/apr_network_io.h	2016-03-03 22:40:40.000000000 +1030
+++ apr-1.6.5/include/apr_network_io.h	2018-10-31 19:14:44.000000000 +1030
@@ -21,6 +21,11 @@
  * @brief APR Network library
  */
 
+#ifdef __KLIBC__
+/* we don't want to include nerror.h from types.h - define this so it doesn't get included */
+#define _NERROR_H_ 1
+#endif
+
 #include "apr.h"
 #include "apr_pools.h"
 #include "apr_file_io.h"
diff -ur apr-1.6.5-o/include/apr_poll.h apr-1.6.5/include/apr_poll.h
--- apr-1.6.5-o/include/apr_poll.h	2016-03-25 11:49:34.000000000 +1030
+++ apr-1.6.5/include/apr_poll.h	2018-10-31 19:14:44.000000000 +1030
@@ -279,8 +279,9 @@
  * @remark If the pollset was not created with APR_POLLSET_WAKEABLE the
  *         return value is APR_EINIT.
  */
+#ifndef __OS2__
 APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset);
-
+#endif
 /**
  * Poll the descriptors in the poll structure
  * @param aprset The poll structure we will be using. 
@@ -305,14 +306,17 @@
  * Return a printable representation of the pollset method.
  * @param pollset The pollset to use
  */
+#ifndef __OS2__
 APR_DECLARE(const char *) apr_pollset_method_name(apr_pollset_t *pollset);
+#endif
 
 /**
  * Return a printable representation of the default pollset method
  * (APR_POLLSET_DEFAULT).
  */
+#ifndef __OS2__
 APR_DECLARE(const char *) apr_poll_method_defname(void);
-
+#endif
 /** Opaque structure used for pollcb API */
 typedef struct apr_pollcb_t apr_pollcb_t;
 
@@ -352,12 +356,13 @@
  * @remark Pollcb is only supported on some platforms; the apr_pollcb_create_ex()
  *         call will fail with APR_ENOTIMPL on platforms where it is not supported.
  */
+#ifndef __OS2__
 APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **pollcb,
                                                apr_uint32_t size,
                                                apr_pool_t *p,
                                                apr_uint32_t flags,
                                                apr_pollset_method_e method);
-
+#endif
 /**
  * Add a socket or file descriptor to a pollcb
  * @param pollcb The pollcb to which to add the descriptor
diff -ur apr-1.6.5-o/include/apr_portable.h apr-1.6.5/include/apr_portable.h
--- apr-1.6.5-o/include/apr_portable.h	2018-08-26 19:35:36.000000000 +0930
+++ apr-1.6.5/include/apr_portable.h	2018-10-31 19:14:44.000000000 +1030
@@ -406,7 +406,7 @@
  * to by sock will be reused and updated with the given socket.
  * @param sock The pool to use.
  * @param thesock The socket to convert to.
- * @param cont The socket we are converting to an apr type.
+ * @param cont The pool to use.
  * @remark If it is a true socket, it is best to call apr_os_sock_make()
  *         and provide APR with more information about the socket.
  */
@@ -415,6 +415,14 @@
                                           apr_pool_t *cont);
 
 /**
+ * Deregister socket cleanup function for socket.
+ * Ensures sockets not owned by process are not closed during pool cleanup.
+ * Supports use case where httpd mpm passes listen sockets to child process.
+ * @param sock The socket to have cleanup deregistered.
+ */
+APR_DECLARE(void) apr_sock_cleanup_kill(apr_socket_t *sock);
+
+/**
  * Create a socket from an existing descriptor and local and remote
  * socket addresses.
  * @param apr_sock The new socket that has been set up
diff -ur apr-1.6.5-o/include/apr_support.h apr-1.6.5/include/apr_support.h
--- apr-1.6.5-o/include/apr_support.h	2006-08-03 20:25:30.000000000 +0930
+++ apr-1.6.5/include/apr_support.h	2018-10-31 19:14:44.000000000 +1030
@@ -45,7 +45,7 @@
  *        otherwise wait for data to be able to be written. 
  * @return APR_TIMEUP if we run out of time.
  */
-apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s,
+APR_DECLARE(apr_status_t) apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s,
                                         int for_read);
 
 /** @} */
Only in apr-1.6.5/include: apr.h
diff -ur apr-1.6.5-o/include/apr.h.in apr-1.6.5/include/apr.h.in
--- apr-1.6.5-o/include/apr.h.in	2017-05-24 02:06:02.000000000 +0930
+++ apr-1.6.5/include/apr.h.in	2018-10-31 19:14:44.000000000 +1030
@@ -185,6 +185,10 @@
 #ifdef OS2
 #define INCL_DOS
 #define INCL_DOSERRORS
+#define INCL_EXAPIS
+#ifdef __KLIBC__
+#include <os2safe.h>
+#endif
 #include <os2.h>
 #endif
 
diff -ur apr-1.6.5-o/include/arch/os2/apr_arch_file_io.h apr-1.6.5/include/arch/os2/apr_arch_file_io.h
--- apr-1.6.5-o/include/arch/os2/apr_arch_file_io.h	2011-02-18 21:54:40.000000000 +1030
+++ apr-1.6.5/include/arch/os2/apr_arch_file_io.h	2018-10-31 19:14:44.000000000 +1030
@@ -25,11 +25,17 @@
 #include "apr_errno.h"
 #include "apr_poll.h"
 
+#ifdef __KLIBC__
+#include <sys/stat.h>
+#endif
+
 /* We have an implementation of mkstemp but it's not very multi-threading 
  * friendly & is part of the POSIX emulation rather than native so don't
  * use it.
  */
+#ifndef __INNOTEK_LIBC__x
 #undef HAVE_MKSTEMP
+#endif
 
 #define APR_FILE_DEFAULT_BUFSIZE 4096
 #define APR_FILE_BUFSIZE APR_FILE_DEFAULT_BUFSIZE
@@ -37,25 +43,32 @@
 struct apr_file_t {
     apr_pool_t *pool;
     HFILE filedes;
+    int pipe;
+    HEV pipeSem;
+    int timeout;
+    apr_int32_t flags;
+
+    /* File specific info */
     char * fname;
     int isopen;
-    int buffered;
     int eof_hit;
-    apr_int32_t flags;
-    int timeout;
-    int pipe;
-    HEV pipeSem;
+    int buffered;
+    int ungetchar;    /* Last char provided by an unget op. (-1 = no char)*/
     enum { BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking;
 
     /* Stuff for buffered mode */
     char *buffer;
-    apr_size_t bufsize;        /* Read/Write position in buffer             */
     apr_size_t bufpos;         /* Read/Write position in buffer             */
-    unsigned long dataRead;    /* amount of valid data read into buffer     */
+    apr_size_t bufsize;        /* Read/Write position in buffer             */
+    apr_size_t dataRead;    /* amount of valid data read into buffer     */
     int direction;             /* buffer being used for 0 = read, 1 = write */
-    unsigned long filePtr;     /* position in file of handle                */
+    apr_off_t filePtr;     /* position in file of handle                */
     apr_thread_mutex_t *mutex; /* mutex semaphore, must be owned to access
                                   the above fields                          */
+#ifndef WAITIO_USES_POLL
+    /* if there is a timeout set, then this pollset is used */
+    apr_pollset_t *pollset;
+#endif
 };
 
 struct apr_dir_t {
@@ -66,6 +79,26 @@
     int validentry;
 };
 
+#ifdef __INNOTEK_LIBC__
+apr_status_t apr_unix_file_cleanup(void *);
+apr_status_t apr_unix_child_file_cleanup(void *);
+#if APR_HAS_THREADS
+#define file_lock(f)   do { \
+                           if ((f)->mutex) \
+                               apr_thread_mutex_lock((f)->mutex); \
+                       } while (0)
+#define file_unlock(f) do { \
+                           if ((f)->mutex) \
+                               apr_thread_mutex_unlock((f)->mutex); \
+                       } while (0)
+#else
+#define file_lock(f)   do {} while (0)
+#define file_unlock(f) do {} while (0)
+#endif
+typedef struct stat struct_stat;
+#endif
+
+
 apr_status_t apr_file_cleanup(void *);
 apr_status_t apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2date, 
                                       FTIME os2time);
@@ -81,6 +114,10 @@
 apr_status_t filepath_drive_get(char **rootpath, char drive, 
                                 apr_int32_t flags, apr_pool_t *p);
 apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p);
-
+#ifdef __KLIBC__
+apr_status_t apr_file_flush_locked(apr_file_t *thefile);
+apr_status_t apr_file_info_get_locked(apr_finfo_t *finfo, apr_int32_t wanted,
+                                      apr_file_t *thefile);
+#endif
 #endif  /* ! FILE_IO_H */
 
diff -ur apr-1.6.5-o/include/arch/os2/apr_arch_os2calls.h apr-1.6.5/include/arch/os2/apr_arch_os2calls.h
--- apr-1.6.5-o/include/arch/os2/apr_arch_os2calls.h	2006-08-03 20:25:30.000000000 +0930
+++ apr-1.6.5/include/arch/os2/apr_arch_os2calls.h	2018-10-31 19:14:44.000000000 +1030
@@ -14,10 +14,14 @@
  * limitations under the License.
  */
 
+#ifndef APR_ARCH_OS2CALLS_H
+#define APR_ARCH_OS2CALLS_H
+#warning xxx
 #include "apr_errno.h"
 #include <sys/types.h>
 #include <sys/socket.h>
 
+//#ifdef TCPV40HDRS
 extern int (*apr_os2_socket)(int, int, int);
 extern int (*apr_os2_select)(int *, int, int, int, long);
 extern int (*apr_os2_sock_errno)();
@@ -57,3 +61,5 @@
 #define writev apr_os2_writev
 #define sendto apr_os2_sendto
 #define recvfrom apr_os2_recvfrom
+//#endif
+#endif /* !defined APR_ARCH_OS2CALLS_H */
diff -ur apr-1.6.5-o/include/arch/os2/apr_arch_proc_mutex.h apr-1.6.5/include/arch/os2/apr_arch_proc_mutex.h
--- apr-1.6.5-o/include/arch/os2/apr_arch_proc_mutex.h	2006-08-03 20:25:30.000000000 +0930
+++ apr-1.6.5/include/arch/os2/apr_arch_proc_mutex.h	2018-10-31 19:14:44.000000000 +1030
@@ -26,6 +26,5 @@
     TID owner;
     int lock_count;
 };
-
 #endif  /* PROC_MUTEX_H */
 
diff -ur apr-1.6.5-o/include/arch/os2/apr_arch_threadproc.h apr-1.6.5/include/arch/os2/apr_arch_threadproc.h
--- apr-1.6.5-o/include/arch/os2/apr_arch_threadproc.h	2006-08-03 20:25:30.000000000 +0930
+++ apr-1.6.5/include/arch/os2/apr_arch_threadproc.h	2018-10-31 19:14:44.000000000 +1030
@@ -16,6 +16,7 @@
 
 #include "apr_thread_proc.h"
 #include "apr_file_io.h"
+#include <pthread.h>
 
 #ifndef THREAD_PROC_H
 #define THREAD_PROC_H
@@ -34,9 +35,10 @@
 struct apr_thread_t {
     apr_pool_t *pool;
     struct apr_threadattr_t *attr;
+    pthread_t *td;
     unsigned long tid;
-    apr_thread_start_t func;
     void *data;
+    apr_thread_start_t func;
     apr_status_t exitval;
 };
 
diff -ur apr-1.6.5-o/include/arch/unix/apr_arch_poll_private.h apr-1.6.5/include/arch/unix/apr_arch_poll_private.h
--- apr-1.6.5-o/include/arch/unix/apr_arch_poll_private.h	2017-09-12 00:53:22.000000000 +0930
+++ apr-1.6.5/include/arch/unix/apr_arch_poll_private.h	2018-10-31 19:14:44.000000000 +1030
@@ -17,6 +17,7 @@
 #ifndef APR_ARCH_POLL_PRIVATE_H
 #define APR_ARCH_POLL_PRIVATE_H
 
+#ifndef __KLIBC__
 #if HAVE_POLL_H
 #include <poll.h>
 #endif
@@ -24,6 +25,7 @@
 #if HAVE_SYS_POLL_H
 #include <sys/poll.h>
 #endif
+#endif
 
 #ifdef HAVE_PORT_CREATE
 #include <port.h>
Only in apr-1.6.5/include/arch/unix: apr_private.h
Only in apr-1.6.5/include/private: apr_escape_test_char.h
diff -ur apr-1.6.5-o/locks/os2/proc_mutex.c apr-1.6.5/locks/os2/proc_mutex.c
--- apr-1.6.5-o/locks/os2/proc_mutex.c	2017-06-02 08:12:00.000000000 +0930
+++ apr-1.6.5/locks/os2/proc_mutex.c	2018-10-31 19:14:44.000000000 +1030
@@ -85,9 +85,11 @@
     ULONG rc;
     char *semname;
 
+#if 0
     if (mech != APR_LOCK_DEFAULT) {
         return APR_ENOTIMPL;
     }
+#endif
 
     new = (apr_proc_mutex_t *)apr_palloc(pool, sizeof(apr_proc_mutex_t));
     new->pool       = pool;
@@ -120,6 +122,13 @@
     new->owner      = 0;
     new->lock_count = 0;
 
+#ifdef __INNOTEK_LIBC__
+    if (!fname) {
+        /* Reinitializing unnamed mutexes is a noop in the Unix code. */
+        return APR_SUCCESS;
+    }
+#endif
+
     semname = fixed_name(fname, pool);
     rc = DosOpenMutexSem(semname, &(new->hMutex));
     *mutex = new;
diff -ur apr-1.6.5-o/locks/os2/thread_rwlock.c apr-1.6.5/locks/os2/thread_rwlock.c
--- apr-1.6.5-o/locks/os2/thread_rwlock.c	2006-08-03 20:25:30.000000000 +0930
+++ apr-1.6.5/locks/os2/thread_rwlock.c	2018-10-31 19:14:44.000000000 +1030
@@ -118,6 +118,7 @@
 
         if (rc)
             DosReleaseMutexSem(rwlock->write_lock);
+
     }
 
     return APR_FROM_OS_ERROR(rc);
diff -ur apr-1.6.5-o/memory/unix/apr_pools.c apr-1.6.5/memory/unix/apr_pools.c
--- apr-1.6.5-o/memory/unix/apr_pools.c	2018-04-05 02:11:28.000000000 +0930
+++ apr-1.6.5/memory/unix/apr_pools.c	2018-12-26 19:22:20.000000000 +1030
@@ -407,6 +407,8 @@
 #elif APR_ALLOCATOR_USES_MMAP
     if ((node = mmap(NULL, size, PROT_READ|PROT_WRITE,
                      MAP_PRIVATE|MAP_ANON, -1, 0)) == MAP_FAILED)
+#elif defined(__KLIBC__) /* must use _lmalloc here or calls to DosReadQueue fail */
+    if ((node = _lmalloc(size)) == NULL)
 #else
     if ((node = malloc(size)) == NULL)
 #endif
@@ -971,7 +973,8 @@
     }
 
     *active->ref = NULL;
-    allocator_free(pool->allocator, active->next);
+    if (active->next)
+        allocator_free(pool->allocator, active->next);
     active->next = active;
     active->ref = &active->next;
 
diff -ur apr-1.6.5-o/misc/unix/errorcodes.c apr-1.6.5/misc/unix/errorcodes.c
--- apr-1.6.5-o/misc/unix/errorcodes.c	2018-08-30 12:19:36.000000000 +0930
+++ apr-1.6.5/misc/unix/errorcodes.c	2018-10-31 19:14:44.000000000 +1030
@@ -145,9 +145,8 @@
 }
 
 
-#ifdef OS2
+#if defined(OS2) 
 #include <ctype.h>
-
 int apr_canonical_error(apr_status_t err);
 
 static char *apr_os_strerror(char* buf, apr_size_t bufsize, int err)
diff -ur apr-1.6.5-o/misc/unix/rand.c apr-1.6.5/misc/unix/rand.c
--- apr-1.6.5-o/misc/unix/rand.c	2007-07-04 19:31:04.000000000 +0930
+++ apr-1.6.5/misc/unix/rand.c	2018-10-31 19:14:44.000000000 +1030
@@ -122,7 +122,7 @@
     
     close(fd);
 #elif defined(OS2)
-    static UCHAR randbyte();
+    UCHAR randbyte();
     unsigned int idx;
 
     for (idx=0; idx<length; idx++)
diff -ur apr-1.6.5-o/misc/unix/randbyte_os2.inc apr-1.6.5/misc/unix/randbyte_os2.inc
--- apr-1.6.5-o/misc/unix/randbyte_os2.inc	2006-08-03 20:25:30.000000000 +0930
+++ apr-1.6.5/misc/unix/randbyte_os2.inc	2018-10-31 19:14:44.000000000 +1030
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+#ifndef __KLIBC__ /* KLIBC has a random() function - use it */
 /* The high resolution timer API provides access to the hardware timer 
  * running at around 1.1MHz. The amount this changes in a time slice is
  * varies randomly due to system events, hardware interrupts etc
@@ -62,8 +63,10 @@
  * which is why it's run-time linked.
  */
 
+#ifndef __INNOTEK_LIBC__
 static APIRET APIENTRY(*DosPerfSysCall) (ULONG ulCommand, ULONG ulParm1,
                                          ULONG ulParm2, ULONG ulParm3) = NULL;
+#endif
 static HMODULE hDoscalls = 0;
 #define   CMD_KI_RDCNT    (0x63)
 
@@ -85,6 +88,7 @@
     CPUUTIL util;
     int c;
 
+#ifndef __INNOTEK_LIBC__
     if (hDoscalls == 0) {
         char failed_module[20];
         ULONG rc;
@@ -111,13 +115,28 @@
             DosPerfSysCall = NULL;
         }
     }
-
+#endif
     return byte;
 }
 
 
 
-static UCHAR randbyte()
+UCHAR randbyte()
 {
     return randbyte_hrtimer() ^ randbyte_sysinfo() ^ randbyte_perf();
 }
+#else /* __KLIBC__ */
+UCHAR randbyte()
+{
+    int c;
+    UCHAR byte;
+    ULONG ulrandom;
+    ulrandom = random();
+     
+    for (c = 0; c < sizeof(ulrandom); c++) {
+        byte ^= ((UCHAR *)&ulrandom)[c];
+    }
+
+    return byte;
+}
+#endif
diff -ur apr-1.6.5-o/misc/unix/start.c apr-1.6.5/misc/unix/start.c
--- apr-1.6.5-o/misc/unix/start.c	2006-08-03 20:25:30.000000000 +0930
+++ apr-1.6.5/misc/unix/start.c	2018-10-31 19:14:44.000000000 +1030
@@ -23,7 +23,6 @@
 #include "apr_arch_proc_mutex.h" /* for apr_proc_mutex_unix_setup_lock() */
 #include "apr_arch_internal_time.h"
 
-
 APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, 
                                              const char * const * *argv, 
                                              const char * const * *env)
Only in apr-1.6.5: Makefile
diff -ur apr-1.6.5-o/network_io/os2/os2calls.c apr-1.6.5/network_io/os2/os2calls.c
--- apr-1.6.5-o/network_io/os2/os2calls.c	2006-08-03 20:25:30.000000000 +0930
+++ apr-1.6.5/network_io/os2/os2calls.c	2018-10-31 19:14:44.000000000 +1030
@@ -44,6 +44,7 @@
 
 static HMODULE hSO32DLL;
 
+#ifdef TCPV40HDRS
 static int os2_fn_link()
 {
     DosEnterCritSec(); /* Stop two threads doing this at the same time */
@@ -90,7 +91,7 @@
             rc = DosQueryProcAddr(hSO32DLL, 0, "LISTEN", &apr_os2_listen);
 
         if (!rc)
-            rc = DosQueryProcAddr(hSO32DLL, 0, "RECV", &apr_os2_recv);
+            rc = DosQueryProcAddr(hSO32DLL, 0, "RECV", (PFN *) &apr_os2_recv);
 
         if (!rc)
             rc = DosQueryProcAddr(hSO32DLL, 0, "SEND", &apr_os2_send);
@@ -120,9 +121,86 @@
     DosExitCritSec();
     return APR_SUCCESS;
 }
+#else
+static HMODULE hTCPIP32;
 
+static int os2_fn_link()
+{
+    DosEnterCritSec(); /* Stop two threads doing this at the same time */
+
+    if (apr_os2_socket == os2_socket_init) {
+        ULONG rc;
+        char errorstr[200];
+
+        rc = DosLoadModule(errorstr, sizeof(errorstr), "TCPIP32", &hTCPIP32);
+
+        if (rc)
+            return APR_OS2_STATUS(rc);
+
+        rc = DosQueryProcAddr(hTCPIP32, 0, "SOCKET", &apr_os2_socket);
+
+        if (!rc)
+            rc = DosQueryProcAddr(hTCPIP32, 0, "SELECT", &apr_os2_select);
+
+        if (!rc)
+            rc = DosQueryProcAddr(hTCPIP32, 0, "SOCK_ERRNO", &apr_os2_sock_errno);
+
+        if (!rc)
+            rc = DosQueryProcAddr(hTCPIP32, 0, "ACCEPT", &apr_os2_accept);
+
+        if (!rc)
+            rc = DosQueryProcAddr(hTCPIP32, 0, "BIND", &apr_os2_bind);
+
+        if (!rc)
+            rc = DosQueryProcAddr(hTCPIP32, 0, "CONNECT", &apr_os2_connect);
+
+        if (!rc)
+            rc = DosQueryProcAddr(hTCPIP32, 0, "GETPEERNAME", &apr_os2_getpeername);
+
+        if (!rc)
+            rc = DosQueryProcAddr(hTCPIP32, 0, "GETSOCKNAME", &apr_os2_getsockname);
+
+        if (!rc)
+            rc = DosQueryProcAddr(hTCPIP32, 0, "GETSOCKOPT", &apr_os2_getsockopt);
+
+        if (!rc)
+            rc = DosQueryProcAddr(hTCPIP32, 0, "IOCTL", &apr_os2_ioctl);
+
+        if (!rc)
+            rc = DosQueryProcAddr(hTCPIP32, 0, "LISTEN", &apr_os2_listen);
+
+        if (!rc)
+            rc = DosQueryProcAddr(hTCPIP32, 0, "RECV", &apr_os2_recv);
 
+        if (!rc)
+            rc = DosQueryProcAddr(hTCPIP32, 0, "SEND", &apr_os2_send);
+
+        if (!rc)
+            rc = DosQueryProcAddr(hTCPIP32, 0, "SETSOCKOPT", &apr_os2_setsockopt);
+
+        if (!rc)
+            rc = DosQueryProcAddr(hTCPIP32, 0, "SHUTDOWN", &apr_os2_shutdown);
+
+        if (!rc)
+            rc = DosQueryProcAddr(hTCPIP32, 0, "SOCLOSE", &apr_os2_soclose);
 
+        if (!rc)
+            rc = DosQueryProcAddr(hTCPIP32, 0, "WRITEV", &apr_os2_writev);
+
+        if (!rc)
+            rc = DosQueryProcAddr(hTCPIP32, 0, "SENDTO", &apr_os2_sendto);
+
+        if (!rc)
+            rc = DosQueryProcAddr(hTCPIP32, 0, "RECVFROM", &apr_os2_recvfrom);
+
+        if (rc)
+            return APR_OS2_STATUS(rc);
+    }
+
+    DosExitCritSec();
+    return APR_SUCCESS;
+}
+#endif
 static int os2_socket_init(int domain, int type, int protocol)
 {
     int rc = os2_fn_link();
diff -ur apr-1.6.5-o/network_io/os2/sendrecv_udp.c apr-1.6.5/network_io/os2/sendrecv_udp.c
--- apr-1.6.5-o/network_io/os2/sendrecv_udp.c	2006-08-03 20:25:30.000000000 +0930
+++ apr-1.6.5/network_io/os2/sendrecv_udp.c	2018-10-31 19:14:44.000000000 +1030
@@ -94,6 +94,10 @@
         (*len) = 0;
         return APR_FROM_OS_ERROR(serrno);
     }
+#ifdef __KLIBC__
+    apr_sockaddr_vars_set(from, from->sa.sin.sin_family, 
+                          ntohs(from->sa.sin.sin_port));
+#endif
 
     (*len) = rv;
 
diff -ur apr-1.6.5-o/network_io/os2/sendrecv.c apr-1.6.5/network_io/os2/sendrecv.c
--- apr-1.6.5-o/network_io/os2/sendrecv.c	2006-08-03 20:25:30.000000000 +0930
+++ apr-1.6.5/network_io/os2/sendrecv.c	2018-11-11 17:59:08.000000000 +1030
@@ -20,6 +20,7 @@
 #include "apr_network_io.h"
 #include "apr_lib.h"
 #include <sys/time.h>
+#include <stdlib.h>
 
 APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf,
                                           apr_size_t *len)
@@ -27,9 +28,11 @@
     apr_ssize_t rv;
     int fds, err = 0;
 
+#ifndef __INNOTEK_LIBC__
     if (*len > 65536) {
         *len = 65536;
     }
+#endif 
 
     do {
         if (!sock->nonblock || err == SOCEWOULDBLOCK) {
@@ -103,8 +106,6 @@
     return rv == 0 ? APR_EOF : APR_SUCCESS;
 }
 
-
-
 APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock, 
                                            const struct iovec *vec, 
                                            apr_int32_t nvec, apr_size_t *len)
@@ -114,11 +115,17 @@
     int fds, err = 0;
     int nv_tosend, total = 0;
 
+#ifndef __INNOTEK_LIBC__
     /* Make sure writev() only gets fed 64k at a time */
     for ( nv_tosend = 0; nv_tosend < nvec && total + vec[nv_tosend].iov_len < 65536; nv_tosend++ ) {
         total += vec[nv_tosend].iov_len;
     }
-
+#else
+    /* workaround for writev() not required with libc */
+    for ( nv_tosend = 0; nv_tosend < nvec; nv_tosend++ ) {
+        total += vec[nv_tosend].iov_len;
+    }
+#endif
     tmpvec = alloca(sizeof(struct iovec) * nv_tosend);
     memcpy(tmpvec, vec, sizeof(struct iovec) * nv_tosend);
 
@@ -143,7 +150,10 @@
 
         rv = writev(sock->socketdes, tmpvec, nv_tosend);
         err = rv < 0 ? sock_errno() : 0;
-    } while (err == SOCEINTR || err == SOCEWOULDBLOCK);
+        /* 2015-02-06 SHL Allow SOCENOBUFS and delay if out of resources */
+        if (err == SOCEWOULDBLOCK || err == SOCENOBUFS)
+          apr_sleep(100 * 1000);        /* 100 mSec */
+    } while (err == SOCEINTR || err == SOCEWOULDBLOCK || err == SOCENOBUFS);
 
     if (err) {
         *len = 0;
diff -ur apr-1.6.5-o/network_io/os2/sockaddr.c apr-1.6.5/network_io/os2/sockaddr.c
--- apr-1.6.5-o/network_io/os2/sockaddr.c	2004-11-25 09:21:50.000000000 +1030
+++ apr-1.6.5/network_io/os2/sockaddr.c	2018-10-31 19:14:44.000000000 +1030
@@ -1 +1,3 @@
+
 #include "../unix/sockaddr.c"
+#include "../unix/multicast.c"
diff -ur apr-1.6.5-o/network_io/os2/sockets.c apr-1.6.5/network_io/os2/sockets.c
--- apr-1.6.5-o/network_io/os2/sockets.c	2006-11-29 07:54:40.000000000 +1030
+++ apr-1.6.5/network_io/os2/sockets.c	2018-10-31 19:14:44.000000000 +1030
@@ -30,6 +30,10 @@
 #include <netdb.h>
 #include "apr_arch_os2calls.h"
 
+#ifdef __KLIBC__x
+static char generic_inaddr_any[16] = {0}; /* big enough for IPv4 or IPv6 */
+#endif
+
 static apr_status_t socket_cleanup(void *sock)
 {
     apr_socket_t *thesocket = sock;
@@ -38,6 +42,9 @@
         return APR_EINVALSOCK;
     }
 
+    /* Add this shutdown call. */
+    shutdown (thesocket->socketdes, 2);
+
     if (soclose(thesocket->socketdes) == 0) {
         thesocket->socketdes = -1;
         return APR_SUCCESS;
@@ -82,9 +89,6 @@
 APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int family, int type,
                                             int protocol, apr_pool_t *cont)
 {
-    int downgrade = (family == AF_UNSPEC);
-    apr_pollfd_t pfd;
-
     if (family == AF_UNSPEC) {
 #if APR_HAVE_IPV6
         family = AF_INET6;
@@ -96,12 +100,6 @@
     alloc_socket(new, cont);
 
     (*new)->socketdes = socket(family, type, protocol);
-#if APR_HAVE_IPV6
-    if ((*new)->socketdes < 0 && downgrade) {
-        family = AF_INET;
-        (*new)->socketdes = socket(family, type, protocol);
-    }
-#endif
 
     if ((*new)->socketdes < 0) {
         return APR_OS2_STATUS(sock_errno());
@@ -163,6 +161,7 @@
                                             apr_socket_t *sock,
                                             apr_pool_t *connection_context)
 {
+
     alloc_socket(new, connection_context);
     set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM, sock->protocol);
 
@@ -177,15 +176,60 @@
         return APR_OS2_STATUS(sock_errno());
     }
 
+#ifndef __KLIBC__x
     *(*new)->local_addr = *sock->local_addr;
     (*new)->local_addr->pool = connection_context;
     (*new)->remote_addr->port = ntohs((*new)->remote_addr->sa.sin.sin_port);
+#else
+    (*new)->remote_addr_unknown = 0;
 
+    *(*new)->local_addr = *sock->local_addr;
+
+    /* The above assignment just overwrote the pool entry. Setting the local_addr 
+       pool for the accepted socket back to what it should be.  Otherwise all 
+       allocations for this socket will come from a server pool that is not
+       freed until the process goes down.*/
+    (*new)->local_addr->pool = connection_context;
+#endif
     /* fix up any pointers which are no longer valid */
     if (sock->local_addr->sa.sin.sin_family == AF_INET) {
         (*new)->local_addr->ipaddr_ptr = &(*new)->local_addr->sa.sin.sin_addr;
     }
 
+#ifdef __KLIBC__x
+    (*new)->remote_addr->port = ntohs((*new)->remote_addr->sa.sin.sin_port);
+    if (sock->local_port_unknown) {
+        /* not likely for a listening socket, but theoretically possible :) */
+        (*new)->local_port_unknown = 1;
+    }
+
+#if APR_TCP_NODELAY_INHERITED
+    if (apr_is_option_set(sock, APR_TCP_NODELAY) == 1) {
+        apr_set_option(*new, APR_TCP_NODELAY, 1);
+    }
+#endif /* TCP_NODELAY_INHERITED */
+#if APR_O_NONBLOCK_INHERITED
+    if (apr_is_option_set(sock, APR_SO_NONBLOCK) == 1) {
+        apr_set_option(*new, APR_SO_NONBLOCK, 1);
+    }
+#endif /* APR_O_NONBLOCK_INHERITED */
+
+    if (sock->local_interface_unknown ||
+        !memcmp(sock->local_addr->ipaddr_ptr,
+                generic_inaddr_any,
+                sock->local_addr->ipaddr_len)) {
+        /* If the interface address inside the listening socket's local_addr wasn't 
+         * up-to-date, we don't know local interface of the connected socket either.
+         *
+         * If the listening socket was not bound to a specific interface, we
+         * don't know the local_addr of the connected socket.
+         */
+        (*new)->local_interface_unknown = 1;
+    }
+
+    (*new)->inherit = 0;
+
+#endif
     apr_pool_cleanup_register((*new)->pool, (void *)(*new), 
                         socket_cleanup, apr_pool_cleanup_null);
     return APR_SUCCESS;
@@ -194,6 +238,7 @@
 APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock,
                                              apr_sockaddr_t *sa)
 {
+#ifndef __KLIBC__x
     if ((connect(sock->socketdes, (struct sockaddr *)&sa->sa.sin, 
                  sa->salen) < 0) &&
         (sock_errno() != SOCEINPROGRESS)) {
@@ -206,6 +251,68 @@
         sock->remote_addr = sa;
         return APR_SUCCESS;
     }
+#else
+    int rc;        
+
+    do {
+        rc = connect(sock->socketdes,
+                     (const struct sockaddr *)&sa->sa.sin,
+                     sa->salen);
+    } while (rc == -1 && errno == EINTR);
+
+    /* we can see EINPROGRESS the first time connect is called on a non-blocking
+     * socket; if called again, we can see EALREADY
+     */
+    if ((rc == -1) && (errno == EINPROGRESS || errno == EALREADY)
+                   && (sock->timeout > 0)) {
+        rc = apr_wait_for_io_or_timeout(NULL, sock, 0);
+        if (rc != APR_SUCCESS) {
+            return rc;
+        }
+
+#ifdef SO_ERROR
+        {
+            int error;
+            apr_socklen_t len = sizeof(error);
+            if ((rc = getsockopt(sock->socketdes, SOL_SOCKET, SO_ERROR, 
+                                 (char *)&error, &len)) < 0) {
+                return errno;
+            }
+            if (error) {
+                return error;
+            }
+        }
+#endif /* SO_ERROR */
+    }
+
+    if (rc == -1 && errno != EISCONN) {
+        return errno;
+    }
+
+    if (memcmp(sa->ipaddr_ptr, generic_inaddr_any, sa->ipaddr_len)) {
+        /* A real remote address was passed in.  If the unspecified
+         * address was used, the actual remote addr will have to be
+         * determined using getpeername() if required. */
+        /* ### this should probably be a structure copy + fixup as per
+         * _accept()'s handling of local_addr */
+        sock->remote_addr = sa;
+        sock->remote_addr_unknown = 0;
+    }
+
+    if (sock->local_addr->port == 0) {
+        /* connect() got us an ephemeral port */
+        sock->local_port_unknown = 1;
+    }
+    if (!memcmp(sock->local_addr->ipaddr_ptr,
+                generic_inaddr_any,
+                sock->local_addr->ipaddr_len)) {
+        /* not bound to specific local interface; connect() had to assign
+         * one for the socket
+         */
+        sock->local_interface_unknown = 1;
+    }
+    return APR_SUCCESS;
+#endif
 }
 
 APR_DECLARE(apr_status_t) apr_socket_type_get(apr_socket_t *sock, int *type)
@@ -309,9 +416,38 @@
     return APR_SUCCESS;
 }
 
+
+/**
+ * Kill cleanup function registered by apr_socket_create
+ * @added 2014-12-27 SHL
+ */
+
+APR_DECLARE(void) apr_sock_cleanup_kill(apr_socket_t *apr_sock)
+{
+    apr_pool_cleanup_kill(apr_sock->pool, (void *)(apr_sock),
+                          socket_cleanup);
+}
+
 APR_POOL_IMPLEMENT_ACCESSOR(socket);
 
+#ifndef __KLIBC__
 APR_IMPLEMENT_INHERIT_SET(socket, inherit, pool, socket_cleanup)
 
 APR_IMPLEMENT_INHERIT_UNSET(socket, inherit, pool, socket_cleanup)
+#else
+/* Sockets cannot be inherited through the standard sockets
+ * inheritence.  WSADuplicateSocket must be used.
+ * This is not trivial to implement.
+ */
+
+APR_DECLARE(apr_status_t) apr_socket_inherit_set(apr_socket_t *socket)    
+{    
+    return APR_ENOTIMPL;
+}    
+
+APR_DECLARE(apr_status_t) apr_socket_inherit_unset(apr_socket_t *socket)    
+{    
+    return APR_ENOTIMPL;
+}    
+#endif
 
diff -ur apr-1.6.5-o/network_io/os2/sockopt.c apr-1.6.5/network_io/os2/sockopt.c
--- apr-1.6.5-o/network_io/os2/sockopt.c	2011-10-16 07:41:40.000000000 +1030
+++ apr-1.6.5/network_io/os2/sockopt.c	2018-10-31 19:14:44.000000000 +1030
@@ -24,9 +24,11 @@
 #include <sys/socket.h>
 #include <netinet/tcp.h>
 #include <netinet/in.h>
+#ifndef __INNOTEK_LIBC__
 #include <unistd.h>
+#endif
 #include <netdb.h>
-#include <sys/so_ioctl.h>
+#include <sys/ioctl.h>
 
 
 APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, 
@@ -107,10 +109,51 @@
 APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock, 
                                              apr_int32_t opt, apr_int32_t *on)
 {
-    switch(opt) {
-    default:
-        return APR_EINVAL;
+    int optval = 0;
+    int optlen = sizeof(optval);
+
+    struct linger  li;
+//    struct timeval ti;
+
+    if (opt & APR_SO_DEBUG) {
+        if (getsockopt(sock->socketdes, SOL_SOCKET, SO_DEBUG, (char *) &optval, &optlen) == -1) {
+            return APR_OS2_STATUS(sock_errno());
+        } else *on = (optval > 0);
+    }
+    if (opt & APR_SO_KEEPALIVE) {
+        if (getsockopt(sock->socketdes, SOL_SOCKET, SO_KEEPALIVE, (char *) &optval, &optlen) == -1) {
+            return APR_OS2_STATUS(sock_errno());
+        } else *on = (optval > 0);
+    }
+    if (opt & APR_SO_LINGER) {
+        if (getsockopt(sock->socketdes, SOL_SOCKET, SO_LINGER, (char *) &li, (int *)sizeof(struct linger)) == -1) {
+            return APR_OS2_STATUS(sock_errno());
+        } else *on = (li.l_onoff > 0);
+    }
+    if (opt & APR_SO_REUSEADDR) {
+        if (getsockopt(sock->socketdes, SOL_SOCKET, SO_REUSEADDR, (char *) &optval, &optlen) == -1) {
+            return APR_OS2_STATUS(sock_errno());
+        } else *on = (optval > 0);
+    }
+    if (opt & APR_SO_SNDBUF) {
+        if (getsockopt(sock->socketdes, SOL_SOCKET, SO_SNDBUF, (char *) &on, &optlen) == -1) {
+            return APR_OS2_STATUS(sock_errno());
+        }
+    }
+    if (opt & APR_SO_RCVBUF) {
+        if (getsockopt(sock->socketdes, SOL_SOCKET, SO_RCVBUF, (char *) &on, &optlen) == -1) {
+            return APR_OS2_STATUS(sock_errno());
+        }
+    }
+    /* have to base this on receive timeout ??? */
+    if (opt & APR_SO_NONBLOCK) {
+        return APR_ENOTIMPL;
+    }
+    /* Windows only ? */
+    if (opt & APR_SO_DISCONNECTED) {
+        return APR_ENOTIMPL;
     }
+
     return APR_SUCCESS;
 }
 
Only in apr-1.6.5/passwd: apr_getpass.lo
Only in apr-1.6.5/passwd: apr_getpass.o
Only in apr-1.6.5: patch.loh
diff -ur apr-1.6.5-o/poll/os2/poll.c apr-1.6.5/poll/os2/poll.c
--- apr-1.6.5-o/poll/os2/poll.c	2006-08-03 20:25:30.000000000 +0930
+++ apr-1.6.5/poll/os2/poll.c	2018-11-10 19:20:02.000000000 +1030
@@ -17,6 +17,7 @@
 #include "apr.h"
 #include "apr_poll.h"
 #include "apr_arch_networkio.h"
+#include <stdlib.h>
 
 APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num,
                       apr_int32_t *nsds, apr_interval_time_t timeout)
@@ -103,3 +104,51 @@
 
     return APR_SUCCESS;
 }
+
+APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **ret_pollcb,
+                                               apr_uint32_t size,
+                                               apr_pool_t *p,
+                                               apr_uint32_t flags,
+                                               apr_pollset_method_e method)
+{
+    return APR_ENOTIMPL;
+}
+
+APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb,
+                                            apr_uint32_t size,
+                                            apr_pool_t *p,
+                                            apr_uint32_t flags)
+{
+    return APR_ENOTIMPL;
+}
+
+APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb,
+                                         apr_pollfd_t *descriptor)
+{
+    return APR_ENOTIMPL;
+}
+
+APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb,
+                                            apr_pollfd_t *descriptor)
+{
+    return APR_ENOTIMPL;
+}
+
+
+APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb,
+                                          apr_interval_time_t timeout,
+                                          apr_pollcb_cb_t func,
+                                          void *baton)
+{
+    return APR_ENOTIMPL;
+}
+
+APR_DECLARE(apr_status_t) apr_pollcb_wakeup(apr_pollcb_t *pollcb)
+{
+    return APR_ENOTIMPL;
+}
+
+APR_DECLARE(const char *) apr_pollcb_method_name(apr_pollcb_t *pollcb)
+{
+    return APR_ENOTIMPL;
+}
Only in apr-1.6.5: sh-thd-1540948
Only in apr-1.6.5: sh-thd-1540949
Only in apr-1.6.5: sh-thd-1540950
Only in apr-1.6.5: sh-thd-1540951
Only in apr-1.6.5: sh-thd-1540952
Only in apr-1.6.5: sh-thd-1540953
Only in apr-1.6.5: sh-thd-1540954
Only in apr-1.6.5: sh-thd-1540955
Only in apr-1.6.5: sh-thd-1540956
Only in apr-1.6.5: sh-thd-1540957
Only in apr-1.6.5: sh-thd-1540958
Only in apr-1.6.5: sh-thd-1540959
Only in apr-1.6.5: sh-thd-1540960
Only in apr-1.6.5: sh-thd-1540961
Only in apr-1.6.5: sh-thd-1540962
Only in apr-1.6.5: sh-thd-1540963
Only in apr-1.6.5: sh-thd-1540964
Only in apr-1.6.5: sh-thd-1540965
Only in apr-1.6.5: sh-thd-1540966
Only in apr-1.6.5: sh-thd-1540967
Only in apr-1.6.5: sh-thd-1540968
Only in apr-1.6.5: sh-thd-1540969
Only in apr-1.6.5: sh-thd-1540970
Only in apr-1.6.5: sh-thd-1540971
Only in apr-1.6.5: sh-thd-1540972
Only in apr-1.6.5: sh-thd-1540973
Only in apr-1.6.5: sh-thd-1540974
Only in apr-1.6.5: sh-thd-1540975
Only in apr-1.6.5: sh-thd-1540976
Only in apr-1.6.5: sh-thd-1540977
Only in apr-1.6.5: sh-thd-1540978
Only in apr-1.6.5: sh-thd-1540979
Only in apr-1.6.5: sh-thd-1540980
Only in apr-1.6.5: sh-thd-1573126
Only in apr-1.6.5: sh-thd-1573127
Only in apr-1.6.5: sh-thd-1573128
Only in apr-1.6.5: sh-thd-1573129
Only in apr-1.6.5: sh-thd-1573131
Only in apr-1.6.5: sh-thd-1573132
Only in apr-1.6.5: sh-thd-1573133
Only in apr-1.6.5: sh-thd-1573135
Only in apr-1.6.5: sh-thd-1573137
Only in apr-1.6.5: sh-thd-1573139
Only in apr-1.6.5: sh-thd-1573140
Only in apr-1.6.5: sh-thd-1573141
Only in apr-1.6.5: sh-thd-1573143
Only in apr-1.6.5: sh-thd-1573144
Only in apr-1.6.5: sh-thd-1573147
Only in apr-1.6.5: sh-thd-1573148
Only in apr-1.6.5: sh-thd-1573149
Only in apr-1.6.5: sh-thd-1573150
Only in apr-1.6.5: sh-thd-1573151
Only in apr-1.6.5: sh-thd-1573152
Only in apr-1.6.5: sh-thd-1573153
Only in apr-1.6.5: sh-thd-1573154
Only in apr-1.6.5: sh-thd-1573155
Only in apr-1.6.5: sh-thd-1573156
Only in apr-1.6.5: sh-thd-1573157
Only in apr-1.6.5: sh-thd-1573158
Only in apr-1.6.5: sh-thd-1573160
Only in apr-1.6.5: sh-thd-1573162
Only in apr-1.6.5: sh-thd-1573164
Only in apr-1.6.5: sh-thd-1573165
Only in apr-1.6.5: sh-thd-1573167
Only in apr-1.6.5: sh-thd-1573168
Only in apr-1.6.5: sh-thd-1573169
Only in apr-1.6.5: sh-thd-1573171
Only in apr-1.6.5: sh-thd-1573172
Only in apr-1.6.5: sh-thd-1573173
Only in apr-1.6.5: sh-thd-1573176
Only in apr-1.6.5: sh-thd-1573177
Only in apr-1.6.5: sh-thd-1573179
Only in apr-1.6.5: sh-thd-1573180
Only in apr-1.6.5: sh-thd-1573181
Only in apr-1.6.5: sh-thd-1573182
Only in apr-1.6.5: sh-thd-1573183
Only in apr-1.6.5: sh-thd-1573184
Only in apr-1.6.5: sh-thd-1573185
Only in apr-1.6.5: sh-thd-1573186
Only in apr-1.6.5: sh-thd-1573188
Only in apr-1.6.5: sh-thd-1573189
Only in apr-1.6.5: sh-thd-1573191
Only in apr-1.6.5: sh-thd-1573193
Only in apr-1.6.5: sh-thd-1573195
Only in apr-1.6.5: sh-thd-1573196
Only in apr-1.6.5: sh-thd-1573197
Only in apr-1.6.5: sh-thd-1573199
Only in apr-1.6.5: sh-thd-1573200
Only in apr-1.6.5: sh-thd-1573203
Only in apr-1.6.5: sh-thd-1573206
Only in apr-1.6.5: sh-thd-1573207
Only in apr-1.6.5: sh-thd-1573208
Only in apr-1.6.5: sh-thd-1573209
Only in apr-1.6.5: sh-thd-1573210
Only in apr-1.6.5: sh-thd-1573211
Only in apr-1.6.5: sh-thd-1573213
Only in apr-1.6.5: sh-thd-1573217
Only in apr-1.6.5: sh-thd-1573218
Only in apr-1.6.5: sh-thd-1573219
Only in apr-1.6.5: sh-thd-1573221
Only in apr-1.6.5: sh-thd-1573222
Only in apr-1.6.5: sh-thd-1573223
Only in apr-1.6.5: sh-thd-1573224
Only in apr-1.6.5: sh-thd-1573225
Only in apr-1.6.5: sh-thd-1573226
Only in apr-1.6.5: sh-thd-1573227
Only in apr-1.6.5: sh-thd-1573228
Only in apr-1.6.5: sh-thd-1573231
Only in apr-1.6.5: sh-thd-1573232
Only in apr-1.6.5: sh-thd-1573234
Only in apr-1.6.5: sh-thd-1573235
Only in apr-1.6.5: sh-thd-1573236
Only in apr-1.6.5: sh-thd-1573237
Only in apr-1.6.5: sh-thd-1573238
Only in apr-1.6.5: sh-thd-1573239
Only in apr-1.6.5: sh-thd-1573240
Only in apr-1.6.5: sh-thd-1573241
Only in apr-1.6.5: sh-thd-1573242
Only in apr-1.6.5: sh-thd-1573244
Only in apr-1.6.5: sh-thd-1573245
Only in apr-1.6.5: sh-thd-1573246
Only in apr-1.6.5: sh-thd-1573247
Only in apr-1.6.5: sh-thd-1573249
Only in apr-1.6.5: sh-thd-1573250
Only in apr-1.6.5: sh-thd-1573252
Only in apr-1.6.5: sh-thd-1573253
Only in apr-1.6.5: sh-thd-1573254
Only in apr-1.6.5: sh-thd-1573256
Only in apr-1.6.5: sh-thd-1573257
Only in apr-1.6.5: sh-thd-1573258
Only in apr-1.6.5: sh-thd-1573259
Only in apr-1.6.5: sh-thd-1573260
Only in apr-1.6.5: sh-thd-1573262
Only in apr-1.6.5: sh-thd-1573263
Only in apr-1.6.5: sh-thd-1573264
Only in apr-1.6.5: sh-thd-1573265
Only in apr-1.6.5: sh-thd-1573266
Only in apr-1.6.5: sh-thd-1573269
Only in apr-1.6.5: sh-thd-1573270
Only in apr-1.6.5: sh-thd-1573272
Only in apr-1.6.5: sh-thd-1573273
Only in apr-1.6.5: sh-thd-1573274
Only in apr-1.6.5: sh-thd-1573275
Only in apr-1.6.5: sh-thd-1573276
Only in apr-1.6.5: sh-thd-1573277
Only in apr-1.6.5: sh-thd-1573279
Only in apr-1.6.5: sh-thd-1573281
Only in apr-1.6.5: sh-thd-1573282
Only in apr-1.6.5: sh-thd-1573283
Only in apr-1.6.5: sh-thd-1573284
Only in apr-1.6.5: sh-thd-1573285
Only in apr-1.6.5: sh-thd-1573286
Only in apr-1.6.5: sh-thd-1573287
Only in apr-1.6.5: sh-thd-1573288
Only in apr-1.6.5: sh-thd-1573289
Only in apr-1.6.5: sh-thd-1573290
Only in apr-1.6.5: sh-thd-1573291
Only in apr-1.6.5: sh-thd-1573292
Only in apr-1.6.5: sh-thd-1573293
Only in apr-1.6.5: sh-thd-1573294
Only in apr-1.6.5: sh-thd-1573297
Only in apr-1.6.5: sh-thd-1573298
Only in apr-1.6.5: sh-thd-1573300
Only in apr-1.6.5: sh-thd-1573302
Only in apr-1.6.5: sh-thd-1573303
Only in apr-1.6.5: sh-thd-1573304
Only in apr-1.6.5: sh-thd-1573306
Only in apr-1.6.5: sh-thd-1573307
Only in apr-1.6.5: sh-thd-1573310
Only in apr-1.6.5: sh-thd-1573311
Only in apr-1.6.5: sh-thd-1573312
Only in apr-1.6.5: sh-thd-1573313
Only in apr-1.6.5: sh-thd-1573314
Only in apr-1.6.5: sh-thd-1573318
Only in apr-1.6.5: sh-thd-1573319
Only in apr-1.6.5: sh-thd-1573320
Only in apr-1.6.5: sh-thd-1573321
Only in apr-1.6.5: sh-thd-1573322
Only in apr-1.6.5: sh-thd-1573324
Only in apr-1.6.5: sh-thd-1573326
Only in apr-1.6.5: sh-thd-1573327
Only in apr-1.6.5: sh-thd-1573331
Only in apr-1.6.5: sh-thd-1573333
Only in apr-1.6.5: sh-thd-1573334
Only in apr-1.6.5: sh-thd-1573338
Only in apr-1.6.5: sh-thd-1573339
Only in apr-1.6.5: sh-thd-1573340
Only in apr-1.6.5: sh-thd-1573341
Only in apr-1.6.5: sh-thd-1573342
Only in apr-1.6.5: sh-thd-1573344
Only in apr-1.6.5: sh-thd-1573346
Only in apr-1.6.5: sh-thd-1573347
Only in apr-1.6.5: sh-thd-1573348
Only in apr-1.6.5: sh-thd-1573349
Only in apr-1.6.5: sh-thd-1573354
Only in apr-1.6.5: sh-thd-1573356
Only in apr-1.6.5: sh-thd-1573357
Only in apr-1.6.5: sh-thd-1573358
Only in apr-1.6.5: sh-thd-1573360
Only in apr-1.6.5: sh-thd-1573361
Only in apr-1.6.5: sh-thd-1573365
Only in apr-1.6.5: sh-thd-1573366
Only in apr-1.6.5: sh-thd-1573368
Only in apr-1.6.5: sh-thd-1573370
Only in apr-1.6.5: sh-thd-1573371
Only in apr-1.6.5: sh-thd-1573373
Only in apr-1.6.5: sh-thd-1573376
Only in apr-1.6.5: sh-thd-1573377
Only in apr-1.6.5: sh-thd-1573379
Only in apr-1.6.5: sh-thd-1573380
Only in apr-1.6.5: sh-thd-1573381
Only in apr-1.6.5: sh-thd-1573382
Only in apr-1.6.5: sh-thd-1573383
Only in apr-1.6.5: sh-thd-1573385
Only in apr-1.6.5: sh-thd-1573386
Only in apr-1.6.5: sh-thd-1573387
Only in apr-1.6.5: sh-thd-2198733
Only in apr-1.6.5: sh-thd-2198734
Only in apr-1.6.5: sh-thd-2198735
Only in apr-1.6.5: sh-thd-2198736
Only in apr-1.6.5: sh-thd-2198737
Only in apr-1.6.5: sh-thd-2198738
Only in apr-1.6.5: sh-thd-2198739
Only in apr-1.6.5: sh-thd-2198740
Only in apr-1.6.5: sh-thd-2198741
Only in apr-1.6.5: sh-thd-2198742
Only in apr-1.6.5: sh-thd-2198743
Only in apr-1.6.5: sh-thd-2198744
Only in apr-1.6.5: sh-thd-2198745
Only in apr-1.6.5: sh-thd-2198746
Only in apr-1.6.5: sh-thd-2198747
Only in apr-1.6.5: sh-thd-2198748
Only in apr-1.6.5: sh-thd-2198749
Only in apr-1.6.5: sh-thd-2198750
Only in apr-1.6.5: sh-thd-2198751
Only in apr-1.6.5: sh-thd-2198752
Only in apr-1.6.5: sh-thd-2198753
Only in apr-1.6.5: sh-thd-2198755
Only in apr-1.6.5: sh-thd-2198756
Only in apr-1.6.5: sh-thd-2198757
Only in apr-1.6.5: sh-thd-2198758
Only in apr-1.6.5: sh-thd-2198759
Only in apr-1.6.5: sh-thd-2198760
Only in apr-1.6.5: sh-thd-2198761
Only in apr-1.6.5: sh-thd-2198762
Only in apr-1.6.5: sh-thd-2198763
Only in apr-1.6.5: sh-thd-2198764
Only in apr-1.6.5: sh-thd-2198765
Only in apr-1.6.5: sh-thd-2198766
Only in apr-1.6.5: sh-thd-2198767
Only in apr-1.6.5: sh-thd-2198768
Only in apr-1.6.5: sh-thd-2198769
Only in apr-1.6.5: sh-thd-2198770
Only in apr-1.6.5: sh-thd-2198771
Only in apr-1.6.5: sh-thd-2198772
Only in apr-1.6.5: sh-thd-2198773
Only in apr-1.6.5: sh-thd-2198774
Only in apr-1.6.5: sh-thd-2198775
Only in apr-1.6.5: sh-thd-2198776
Only in apr-1.6.5: sh-thd-2198777
Only in apr-1.6.5: sh-thd-2198778
Only in apr-1.6.5: sh-thd-2198779
Only in apr-1.6.5: sh-thd-2198780
Only in apr-1.6.5: sh-thd-2198781
Only in apr-1.6.5: sh-thd-2198782
Only in apr-1.6.5: sh-thd-2198783
Only in apr-1.6.5: sh-thd-2198784
Only in apr-1.6.5: sh-thd-2198785
Only in apr-1.6.5: sh-thd-2198786
Only in apr-1.6.5: sh-thd-2198787
Only in apr-1.6.5: sh-thd-2198788
Only in apr-1.6.5: sh-thd-2198789
Only in apr-1.6.5: sh-thd-2198790
Only in apr-1.6.5: sh-thd-2198791
Only in apr-1.6.5: sh-thd-2198792
Only in apr-1.6.5: sh-thd-2198793
Only in apr-1.6.5: sh-thd-2198794
Only in apr-1.6.5: sh-thd-2198795
Only in apr-1.6.5: sh-thd-2198796
Only in apr-1.6.5: sh-thd-2198797
Only in apr-1.6.5: sh-thd-2198798
Only in apr-1.6.5: sh-thd-2198799
Only in apr-1.6.5: sh-thd-2198800
Only in apr-1.6.5: sh-thd-2198802
Only in apr-1.6.5: sh-thd-2198803
Only in apr-1.6.5: sh-thd-2198804
Only in apr-1.6.5: sh-thd-2198805
Only in apr-1.6.5: sh-thd-2198806
Only in apr-1.6.5: sh-thd-2198807
Only in apr-1.6.5: sh-thd-2198808
Only in apr-1.6.5: sh-thd-2198809
Only in apr-1.6.5: sh-thd-2198812
Only in apr-1.6.5: sh-thd-2198813
Only in apr-1.6.5: sh-thd-2198814
Only in apr-1.6.5: sh-thd-2198815
Only in apr-1.6.5: sh-thd-2198816
Only in apr-1.6.5: sh-thd-2198817
Only in apr-1.6.5: sh-thd-2198818
Only in apr-1.6.5: sh-thd-2198819
Only in apr-1.6.5: sh-thd-2198821
Only in apr-1.6.5: sh-thd-2198822
Only in apr-1.6.5: sh-thd-2198823
Only in apr-1.6.5: sh-thd-2198824
Only in apr-1.6.5: sh-thd-2198825
Only in apr-1.6.5: sh-thd-2198827
Only in apr-1.6.5: sh-thd-2198828
Only in apr-1.6.5: sh-thd-2198829
Only in apr-1.6.5: sh-thd-2198830
Only in apr-1.6.5: sh-thd-2198831
Only in apr-1.6.5: sh-thd-2198832
Only in apr-1.6.5: sh-thd-2198833
Only in apr-1.6.5: sh-thd-2198834
Only in apr-1.6.5: sh-thd-2198835
Only in apr-1.6.5: sh-thd-2198836
Only in apr-1.6.5: sh-thd-2198838
Only in apr-1.6.5: sh-thd-2198839
Only in apr-1.6.5: sh-thd-2198840
Only in apr-1.6.5: sh-thd-2198841
Only in apr-1.6.5: sh-thd-2198842
Only in apr-1.6.5: sh-thd-2198843
Only in apr-1.6.5: sh-thd-2198844
Only in apr-1.6.5: sh-thd-2198845
Only in apr-1.6.5: sh-thd-2198846
Only in apr-1.6.5: sh-thd-2198847
Only in apr-1.6.5: sh-thd-2198848
Only in apr-1.6.5: sh-thd-2198850
Only in apr-1.6.5: sh-thd-2198851
Only in apr-1.6.5: sh-thd-2198852
Only in apr-1.6.5: sh-thd-2198853
Only in apr-1.6.5: sh-thd-2198854
Only in apr-1.6.5: sh-thd-2198855
Only in apr-1.6.5: sh-thd-2198856
Only in apr-1.6.5: sh-thd-2198857
Only in apr-1.6.5: sh-thd-2198858
Only in apr-1.6.5: sh-thd-2198859
Only in apr-1.6.5: sh-thd-2198860
Only in apr-1.6.5: sh-thd-2198861
Only in apr-1.6.5: sh-thd-2198862
Only in apr-1.6.5: sh-thd-2198863
Only in apr-1.6.5: sh-thd-2607866
Only in apr-1.6.5: sh-thd-2608026
Only in apr-1.6.5: sh-thd-2608034
Only in apr-1.6.5: sh-thd-2608037
Only in apr-1.6.5: sh-thd-2608041
Only in apr-1.6.5: sh-thd-2608175
Only in apr-1.6.5: sh-thd-2608340
Only in apr-1.6.5: sh-thd-2608364
Only in apr-1.6.5: sh-thd-2608368
Only in apr-1.6.5: sh-thd-2608466
Only in apr-1.6.5: sh-thd-2608478
Only in apr-1.6.5: sh-thd-2608481
Only in apr-1.6.5: sh-thd-2608488
Only in apr-1.6.5: sh-thd-2608499
Only in apr-1.6.5: sh-thd-2608624
Only in apr-1.6.5: sh-thd-2608692
Only in apr-1.6.5: sh-thd-2608731
Only in apr-1.6.5: sh-thd-3763341
Only in apr-1.6.5: sh-thd-3763347
Only in apr-1.6.5: sh-thd-3763348
Only in apr-1.6.5: sh-thd-3763352
Only in apr-1.6.5: sh-thd-3763354
Only in apr-1.6.5: sh-thd-3763360
Only in apr-1.6.5: sh-thd-3763366
Only in apr-1.6.5: sh-thd-3763369
Only in apr-1.6.5: sh-thd-3763378
Only in apr-1.6.5: sh-thd-3763381
Only in apr-1.6.5: sh-thd-3763383
Only in apr-1.6.5: sh-thd-3763384
Only in apr-1.6.5: sh-thd-3763388
Only in apr-1.6.5: sh-thd-3763399
Only in apr-1.6.5: sh-thd-3763406
Only in apr-1.6.5: sh-thd-3763412
Only in apr-1.6.5: sh-thd-3763414
Only in apr-1.6.5: sh-thd-3763417
Only in apr-1.6.5: sh-thd-3763423
Only in apr-1.6.5: sh-thd-3763429
Only in apr-1.6.5: sh-thd-3763430
Only in apr-1.6.5: sh-thd-3763434
Only in apr-1.6.5: sh-thd-3763438
Only in apr-1.6.5: sh-thd-3763440
Only in apr-1.6.5: sh-thd-3763443
Only in apr-1.6.5: sh-thd-3763445
Only in apr-1.6.5: sh-thd-3763452
Only in apr-1.6.5: sh-thd-3763455
Only in apr-1.6.5: sh-thd-3763458
Only in apr-1.6.5: sh-thd-3763459
Only in apr-1.6.5: sh-thd-3763460
Only in apr-1.6.5: sh-thd-3763466
Only in apr-1.6.5: sh-thd-3763467
Only in apr-1.6.5: sh-thd-3763471
Only in apr-1.6.5: sh-thd-3763472
Only in apr-1.6.5: sh-thd-3763477
Only in apr-1.6.5: sh-thd-3763478
Only in apr-1.6.5: sh-thd-3763487
Only in apr-1.6.5: sh-thd-3763499
Only in apr-1.6.5: sh-thd-3763505
Only in apr-1.6.5: sh-thd-3763506
Only in apr-1.6.5: sh-thd-3763508
Only in apr-1.6.5: sh-thd-3763512
Only in apr-1.6.5: sh-thd-3763514
Only in apr-1.6.5: sh-thd-3763515
Only in apr-1.6.5: sh-thd-3763518
Only in apr-1.6.5: sh-thd-3763524
Only in apr-1.6.5: sh-thd-3763527
Only in apr-1.6.5: sh-thd-3763537
Only in apr-1.6.5: sh-thd-3763538
Only in apr-1.6.5: sh-thd-3763548
Only in apr-1.6.5: sh-thd-3763552
Only in apr-1.6.5: sh-thd-3763575
Only in apr-1.6.5: sh-thd-3763578
Only in apr-1.6.5: sh-thd-3763579
Only in apr-1.6.5: sh-thd-3763580
Only in apr-1.6.5: sh-thd-3763589
Only in apr-1.6.5: sh-thd-3763592
Only in apr-1.6.5: sh-thd-3763604
Only in apr-1.6.5: sh-thd-3763606
Only in apr-1.6.5: sh-thd-3763624
Only in apr-1.6.5: sh-thd-3763630
Only in apr-1.6.5: sh-thd-3763631
Only in apr-1.6.5: sh-thd-3763634
Only in apr-1.6.5: sh-thd-3763638
Only in apr-1.6.5: sh-thd-3763641
Only in apr-1.6.5: sh-thd-3763645
Only in apr-1.6.5: sh-thd-3763648
Only in apr-1.6.5: sh-thd-3763656
Only in apr-1.6.5: sh-thd-3763660
Only in apr-1.6.5: sh-thd-3763665
Only in apr-1.6.5: sh-thd-3763668
Only in apr-1.6.5: sh-thd-3763669
Only in apr-1.6.5: sh-thd-3763670
Only in apr-1.6.5: sh-thd-3763675
Only in apr-1.6.5: sh-thd-3763676
Only in apr-1.6.5: sh-thd-3763677
Only in apr-1.6.5: sh-thd-3763687
Only in apr-1.6.5: sh-thd-3763688
Only in apr-1.6.5: sh-thd-3763692
Only in apr-1.6.5: sh-thd-3763694
Only in apr-1.6.5: sh-thd-3763697
Only in apr-1.6.5: sh-thd-3763703
Only in apr-1.6.5: sh-thd-3763708
Only in apr-1.6.5: sh-thd-3763712
Only in apr-1.6.5: sh-thd-3763714
Only in apr-1.6.5: sh-thd-3763717
Only in apr-1.6.5: sh-thd-3763718
Only in apr-1.6.5: sh-thd-3763720
Only in apr-1.6.5: sh-thd-3763728
Only in apr-1.6.5: sh-thd-3763731
Only in apr-1.6.5: sh-thd-3763734
Only in apr-1.6.5: sh-thd-3763740
Only in apr-1.6.5: sh-thd-3763744
Only in apr-1.6.5: sh-thd-3763756
Only in apr-1.6.5: sh-thd-3763759
Only in apr-1.6.5: sh-thd-3763763
Only in apr-1.6.5: sh-thd-3763769
Only in apr-1.6.5: sh-thd-3763770
Only in apr-1.6.5: sh-thd-3763777
Only in apr-1.6.5: sh-thd-3763778
Only in apr-1.6.5: sh-thd-3763781
Only in apr-1.6.5: sh-thd-3763787
Only in apr-1.6.5: sh-thd-3763804
Only in apr-1.6.5: sh-thd-3763806
Only in apr-1.6.5: sh-thd-3763808
Only in apr-1.6.5: sh-thd-3763812
Only in apr-1.6.5: sh-thd-3763823
Only in apr-1.6.5: sh-thd-3763826
Only in apr-1.6.5: sh-thd-3763831
Only in apr-1.6.5: sh-thd-3763832
Only in apr-1.6.5: sh-thd-3966435
Only in apr-1.6.5: sh-thd-3966436
Only in apr-1.6.5: sh-thd-3966437
Only in apr-1.6.5: sh-thd-3966438
Only in apr-1.6.5: sh-thd-3966439
Only in apr-1.6.5: sh-thd-3966440
Only in apr-1.6.5: sh-thd-3966441
Only in apr-1.6.5: sh-thd-3966442
Only in apr-1.6.5: sh-thd-3966443
Only in apr-1.6.5: sh-thd-3966444
Only in apr-1.6.5: sh-thd-3966445
Only in apr-1.6.5: sh-thd-3966446
Only in apr-1.6.5: sh-thd-3966447
Only in apr-1.6.5: sh-thd-3966448
Only in apr-1.6.5: sh-thd-3966449
Only in apr-1.6.5: sh-thd-3966450
Only in apr-1.6.5: sh-thd-3966451
Only in apr-1.6.5: sh-thd-3966452
Only in apr-1.6.5: sh-thd-3966453
Only in apr-1.6.5: sh-thd-3966454
Only in apr-1.6.5: sh-thd-3966455
Only in apr-1.6.5: sh-thd-3966456
Only in apr-1.6.5: sh-thd-3966457
Only in apr-1.6.5: sh-thd-3966458
Only in apr-1.6.5: sh-thd-3966459
Only in apr-1.6.5: sh-thd-3966460
Only in apr-1.6.5: sh-thd-3966461
Only in apr-1.6.5: sh-thd-3966462
Only in apr-1.6.5: sh-thd-3966463
Only in apr-1.6.5: sh-thd-3966464
Only in apr-1.6.5: sh-thd-3966465
Only in apr-1.6.5: sh-thd-3966466
Only in apr-1.6.5: sh-thd-3966467
Only in apr-1.6.5: sh-thd-3966468
Only in apr-1.6.5: sh-thd-3966469
Only in apr-1.6.5: sh-thd-3966470
Only in apr-1.6.5: sh-thd-3966471
Only in apr-1.6.5: sh-thd-3966472
Only in apr-1.6.5: sh-thd-3966473
Only in apr-1.6.5: sh-thd-3966474
Only in apr-1.6.5: sh-thd-3966475
Only in apr-1.6.5: sh-thd-3966476
Only in apr-1.6.5: sh-thd-3966477
Only in apr-1.6.5: sh-thd-3966478
Only in apr-1.6.5: sh-thd-3966479
Only in apr-1.6.5: sh-thd-3966480
Only in apr-1.6.5: sh-thd-3966481
Only in apr-1.6.5: sh-thd-3966482
Only in apr-1.6.5: sh-thd-3966483
Only in apr-1.6.5: sh-thd-3966484
Only in apr-1.6.5: sh-thd-3966485
Only in apr-1.6.5: sh-thd-3966486
Only in apr-1.6.5: sh-thd-3966487
Only in apr-1.6.5: sh-thd-3966488
Only in apr-1.6.5: sh-thd-3966489
Only in apr-1.6.5: sh-thd-3966490
Only in apr-1.6.5: sh-thd-3966491
Only in apr-1.6.5: sh-thd-3966492
Only in apr-1.6.5: sh-thd-3966493
Only in apr-1.6.5: sh-thd-3966494
Only in apr-1.6.5: sh-thd-3966495
Only in apr-1.6.5: sh-thd-3966496
Only in apr-1.6.5: sh-thd-3966497
Only in apr-1.6.5: sh-thd-3966498
Only in apr-1.6.5: sh-thd-3966499
Only in apr-1.6.5: sh-thd-3966500
diff -ur apr-1.6.5-o/shmem/os2/shm.c apr-1.6.5/shmem/os2/shm.c
--- apr-1.6.5-o/shmem/os2/shm.c	2014-04-28 22:45:02.000000000 +0930
+++ apr-1.6.5/shmem/os2/shm.c	2018-10-31 19:14:44.000000000 +1030
@@ -46,7 +46,12 @@
         flags |= OBJ_GETTABLE;
     }
 
-    rc = DosAllocSharedMem(&(newm->memblock), name, reqsize, flags);
+    /* First try to allocate shared memory in HMA */
+    rc = DosAllocSharedMem(&(newm->memblock), name, reqsize, flags | OBJ_ANY);
+
+    if (rc) {
+        rc = DosAllocSharedMem(&(newm->memblock), name, reqsize, flags);
+    }
 
     if (rc) {
         return APR_OS2_STATUS(rc);
@@ -67,7 +72,15 @@
 
 APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m)
 {
-    DosFreeMem(m->memblock);
+    int rc;
+
+    rc = DosFreeMem(m->memblock);
+
+    // MKG: added might not be good
+    if (rc) {
+        return APR_OS2_STATUS(rc);
+    }
+
     return APR_SUCCESS;
 }
 
@@ -92,9 +105,16 @@
     ULONG flags = PAG_READ|PAG_WRITE;
 
     newm->pool = pool;
+
+    //MKG: should be able to get unnamed memory ????
+    if (filename) {
+
     name = apr_pstrcat(pool, "\\SHAREMEM\\", filename, NULL);
 
     rc = DosGetNamedSharedMem(&(newm->memblock), name, flags);
+    } else {
+        rc = DosGetSharedMem(&(newm->memblock), flags);
+    }
 
     if (rc) {
         return APR_FROM_OS_ERROR(rc);
Only in apr-1.6.5/strings: apr_cpystrn.lo
Only in apr-1.6.5/strings: apr_cpystrn.o
Only in apr-1.6.5/strings: apr_cstr.lo
Only in apr-1.6.5/strings: apr_cstr.o
Only in apr-1.6.5/strings: apr_fnmatch.lo
Only in apr-1.6.5/strings: apr_fnmatch.o
Only in apr-1.6.5/strings: apr_snprintf.lo
Only in apr-1.6.5/strings: apr_snprintf.o
Only in apr-1.6.5/strings: apr_strings.lo
Only in apr-1.6.5/strings: apr_strings.o
Only in apr-1.6.5/strings: apr_strnatcmp.lo
Only in apr-1.6.5/strings: apr_strnatcmp.o
Only in apr-1.6.5/strings: apr_strtok.lo
Only in apr-1.6.5/strings: apr_strtok.o
diff -ur apr-1.6.5-o/support/unix/waitio.c apr-1.6.5/support/unix/waitio.c
--- apr-1.6.5-o/support/unix/waitio.c	2013-10-04 00:00:16.000000000 +0930
+++ apr-1.6.5/support/unix/waitio.c	2018-11-10 19:20:38.000000000 +1030
@@ -22,7 +22,7 @@
 
 /* The only case where we don't use wait_for_io_or_timeout is on
  * pre-BONE BeOS, so this check should be sufficient and simpler */
-#if !defined(BEOS_R5) && !defined(OS2) && APR_FILES_AS_SOCKETS
+#if (!defined(BEOS_R5) && APR_FILES_AS_SOCKETS) || defined(__KLIBC__)
 #define USE_WAIT_FOR_IO
 #endif
 
Only in apr-1.6.5/tables: apr_hash.lo
Only in apr-1.6.5/tables: apr_hash.o
Only in apr-1.6.5/tables: apr_skiplist.lo
Only in apr-1.6.5/tables: apr_skiplist.o
Only in apr-1.6.5/tables: apr_tables.lo
Only in apr-1.6.5/tables: apr_tables.o
Only in apr-1.6.5/test: 4A6A_01.TRP
diff -ur apr-1.6.5-o/test/abts.c apr-1.6.5/test/abts.c
--- apr-1.6.5-o/test/abts.c	2013-11-13 00:27:38.000000000 +1030
+++ apr-1.6.5/test/abts.c	2018-10-31 19:14:44.000000000 +1030
@@ -17,6 +17,8 @@
 #include "abts.h"
 #include "abts_tests.h"
 #include "testutil.h"
+#define INCL_LOADEXCEPTQ
+#include "exceptq.h"
 
 #define ABTS_STAT_SIZE 6
 static char status[ABTS_STAT_SIZE] = {'|', '/', '-', '|', '\\', '-'};
@@ -382,11 +384,13 @@
 }
 
 int main(int argc, const char *const argv[]) {
+    EXCEPTIONREGISTRATIONRECORD exRegRec;
     int i;
     int rv;
     int list_provided = 0;
     abts_suite *suite = NULL;
    
+    LoadExceptq(&exRegRec, "I", "testall");
     initialize();
 
     quiet = !isatty(STDOUT_FILENO);
@@ -430,6 +434,7 @@
     }
 
     rv = report(suite);
+    UninstallExceptq(&exRegRec);
     return rv;
 }
        
Only in apr-1.6.5/test: build
Only in apr-1.6.5/test/data: testdup2.file
Only in apr-1.6.5/test/data: testdup2.readwrite.file
Only in apr-1.6.5/test: echod.map
Only in apr-1.6.5/test: globalmutexchild.map
Only in apr-1.6.5/test/internal: Makefile
Only in apr-1.6.5/test: lfstests
Only in apr-1.6.5/test: Makefile
Only in apr-1.6.5/test: occhild.map
diff -ur apr-1.6.5-o/test/proc_child.c apr-1.6.5/test/proc_child.c
--- apr-1.6.5-o/test/proc_child.c	2007-10-15 05:54:12.000000000 +1030
+++ apr-1.6.5/test/proc_child.c	2018-10-31 19:14:44.000000000 +1030
@@ -7,11 +7,17 @@
 #include <io.h>
 #endif
 #include <stdlib.h>
+#ifdef __INNOTEK_LIBC__
+#include <fcntl.h>
+#endif
 
 int main(void)
 {
     char buf[256];
     int bytes;
+#if defined(__WATCOMC__)||defined(__INNOTEK_LIBC__)
+    setmode(STDIN_FILENO, O_BINARY);
+#endif
     
     bytes = (int)read(STDIN_FILENO, buf, 256);
     if (bytes > 0)
Only in apr-1.6.5/test: proc_child.map
Only in apr-1.6.5/test: readchild.map
Only in apr-1.6.5/test: sendfile.map
Only in apr-1.6.5/test: sockchild.map
Only in apr-1.6.5/test: sockperf.map
Only in apr-1.6.5/test: testall.map
diff -ur apr-1.6.5-o/test/testcond.c apr-1.6.5/test/testcond.c
--- apr-1.6.5-o/test/testcond.c	2007-11-18 11:05:56.000000000 +1030
+++ apr-1.6.5/test/testcond.c	2018-10-31 19:14:44.000000000 +1030
@@ -652,9 +652,10 @@
 #endif
     suite = ADD_SUITE(suite)
 
-#if !APR_HAS_THREADS
+#if !APR_HAS_THREADS 
     abts_run_test(suite, threads_not_impl, NULL);
 #else
+#ifndef __OS2__
     abts_run_test(suite, lost_signal, NULL);
     abts_run_test(suite, dynamic_binding, NULL);
     abts_run_test(suite, broadcast_threads, NULL);
@@ -665,6 +666,7 @@
     abts_run_test(suite, pipe_producer_consumer, NULL);
     abts_run_test(suite, ping_pong, NULL);
 #endif
+#endif
 
     return suite;
 }
diff -ur apr-1.6.5-o/test/testdir.c apr-1.6.5/test/testdir.c
--- apr-1.6.5-o/test/testdir.c	2014-01-21 21:54:46.000000000 +1030
+++ apr-1.6.5/test/testdir.c	2018-10-31 19:14:44.000000000 +1030
@@ -31,6 +31,7 @@
     apr_finfo_t finfo;
 
     rv = apr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p);
+
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
 
     rv = apr_stat(&finfo, "data/testdir", APR_FINFO_TYPE, p);
diff -ur apr-1.6.5-o/test/testfile.c apr-1.6.5/test/testfile.c
--- apr-1.6.5-o/test/testfile.c	2017-07-01 06:42:30.000000000 +0930
+++ apr-1.6.5/test/testfile.c	2018-10-31 19:14:44.000000000 +1030
@@ -248,6 +248,7 @@
     APR_ASSERT_SUCCESS(tc, "Open test file " FILENAME, rv);
 
     rv = apr_file_read(filetest, str, &nbytes);
+
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     ABTS_SIZE_EQUAL(tc, strlen(TESTSTR), nbytes);
     ABTS_STR_EQUAL(tc, TESTSTR, str);
@@ -1263,7 +1264,6 @@
     abts_run_test(suite, test_fail_read_flush, NULL);
     abts_run_test(suite, test_buffer_set_get, NULL);
     abts_run_test(suite, test_xthread, NULL);
-
     return suite;
 }
 
diff -ur apr-1.6.5-o/test/testfileinfo.c apr-1.6.5/test/testfileinfo.c
--- apr-1.6.5-o/test/testfileinfo.c	2010-03-08 01:24:06.000000000 +1030
+++ apr-1.6.5/test/testfileinfo.c	2018-10-31 19:14:46.000000000 +1030
@@ -256,7 +256,9 @@
     abts_run_test(suite, test_stat, NULL);
     abts_run_test(suite, test_stat_eq_finfo, NULL);
     abts_run_test(suite, test_buffered_write_size, NULL);
+#ifndef OS2
     abts_run_test(suite, test_mtime_set, NULL);
+#endif
 
     return suite;
 }
diff -ur apr-1.6.5-o/test/testlock.c apr-1.6.5/test/testlock.c
--- apr-1.6.5-o/test/testlock.c	2017-05-25 00:51:42.000000000 +0930
+++ apr-1.6.5/test/testlock.c	2018-10-31 19:14:46.000000000 +1030
@@ -213,6 +213,7 @@
     apr_thread_rwlock_destroy(rwlock);
 }
 
+
 static void test_cond(abts_case *tc, void *data)
 {
     apr_thread_t *p1, *p2, *p3, *p4, *c1;
@@ -324,9 +325,11 @@
 #else
     abts_run_test(suite, test_thread_mutex, NULL);
     abts_run_test(suite, test_thread_rwlock, NULL);
+#ifndef OS2 /* apr_thread_cond_* not implements on os2 */
     abts_run_test(suite, test_cond, NULL);
     abts_run_test(suite, test_timeoutcond, NULL);
 #endif
+#endif
 
     return suite;
 }
Only in apr-1.6.5/test: testlockperf.map
Only in apr-1.6.5/test: testmutexscope.map
diff -ur apr-1.6.5-o/test/testnames.c apr-1.6.5/test/testnames.c
--- apr-1.6.5-o/test/testnames.c	2015-06-18 18:12:20.000000000 +0930
+++ apr-1.6.5/test/testnames.c	2018-10-31 19:14:46.000000000 +1030
@@ -31,6 +31,8 @@
 #define ABS_ROOT "C:/"
 #elif defined(NETWARE)
 #define ABS_ROOT "SYS:/"
+#elif defined(__OS2__)
+#define ABS_ROOT "C:/"
 #else
 #define ABS_ROOT "/"
 #endif
@@ -92,6 +94,7 @@
      * the case of the test directory:
      */
     rv = apr_filepath_merge(&dstpath, "", "../test", APR_FILEPATH_TRUENAME, p);
+fprintf(stderr,"dstpath3 = %s, rv = %d\n",dstpath,rv);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     ABTS_STR_EQUAL(tc, "../test", dstpath);
 }
@@ -146,7 +149,6 @@
     rv = apr_filepath_merge(&dstpath, "foo/bar", "../baz", 
                             APR_FILEPATH_NOTRELATIVE, p);
     apr_strerror(rv, errmsg, sizeof(errmsg));
-
     ABTS_PTR_EQUAL(tc, NULL, dstpath);
     ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ERELATIVE(rv));
     ABTS_STR_EQUAL(tc, "The given path is relative", errmsg);
@@ -161,7 +163,6 @@
     rv = apr_filepath_merge(&dstpath, ABS_ROOT"foo/bar", "../baz", 
                             APR_FILEPATH_NOTABSOLUTE, p);
     apr_strerror(rv, errmsg, sizeof(errmsg));
-
     ABTS_PTR_EQUAL(tc, NULL, dstpath);
     ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EABSOLUTE(rv));
     ABTS_STR_EQUAL(tc, "The given path is absolute", errmsg);
diff -ur apr-1.6.5-o/test/testpipe.c apr-1.6.5/test/testpipe.c
--- apr-1.6.5-o/test/testpipe.c	2016-03-25 11:58:12.000000000 +1030
+++ apr-1.6.5/test/testpipe.c	2018-10-31 19:14:46.000000000 +1030
@@ -190,6 +190,7 @@
 {
     suite = ADD_SUITE(suite)
 
+#if 1
     abts_run_test(suite, create_pipe, NULL);
     abts_run_test(suite, close_pipe, NULL);
     abts_run_test(suite, set_timeout, NULL);
@@ -197,9 +198,11 @@
     abts_run_test(suite, read_write, NULL);
     abts_run_test(suite, close_pipe, NULL);
     abts_run_test(suite, read_write_notimeout, NULL);
+#endif
     abts_run_test(suite, test_pipe_writefull, NULL);
+#if 1
     abts_run_test(suite, close_pipe, NULL);
-
+#endif
     return suite;
 }
 
diff -ur apr-1.6.5-o/test/testprocmutex.c apr-1.6.5/test/testprocmutex.c
--- apr-1.6.5-o/test/testprocmutex.c	2017-05-25 00:51:42.000000000 +0930
+++ apr-1.6.5/test/testprocmutex.c	2018-10-31 19:14:46.000000000 +1030
@@ -115,6 +115,7 @@
     int n;
  
     rv = apr_proc_mutex_create(&proc_lock, lockname, mech, p);
+
     APR_ASSERT_SUCCESS(tc, "create the mutex", rv);
     if (rv != APR_SUCCESS)
         return;
@@ -122,8 +123,10 @@
     for (n = 0; n < CHILDREN; n++)
         make_child(tc, 0, &child[n], p);
 
+
     for (n = 0; n < CHILDREN; n++)
         await_child(tc, child[n]);
+
     
     ABTS_ASSERT(tc, "Locks don't appear to work", *x == MAX_COUNTER);
 
diff -ur apr-1.6.5-o/test/testshm.c apr-1.6.5/test/testshm.c
--- apr-1.6.5-o/test/testshm.c	2014-04-28 22:45:02.000000000 +0930
+++ apr-1.6.5/test/testshm.c	2018-10-31 19:14:46.000000000 +1030
@@ -126,7 +126,6 @@
 
     boxes = apr_shm_baseaddr_get(shm);
     ABTS_PTR_NOTNULL(tc, boxes);
-
     rv = apr_proc_fork(&proc, p);
     if (rv == APR_INCHILD) { /* child */
         int num = msgwait(5, 0, N_BOXES);
diff -ur apr-1.6.5-o/test/testshm.h apr-1.6.5/test/testshm.h
--- apr-1.6.5-o/test/testshm.h	2006-08-03 20:25:30.000000000 +0930
+++ apr-1.6.5/test/testshm.h	2018-10-31 19:14:46.000000000 +1030
@@ -24,8 +24,14 @@
 mbox *boxes;
 
 #define N_BOXES 10
+#ifndef __OS2__
 #define SHARED_SIZE (apr_size_t)(N_BOXES * sizeof(mbox))
 #define SHARED_FILENAME "data/apr.testshm.shm"
+#else
+#define SHARED_SIZE (apr_size_t)(N_BOXES * 4096)
+#define SHARED_FILENAME "data\\apr.testshm.shm"
+#endif
+
 #define N_MESSAGES 100
 #define MSG "Sending a message"
 
Only in apr-1.6.5/test: testshmconsumer.map
Only in apr-1.6.5/test: testshmproducer.map
diff -ur apr-1.6.5-o/test/testsockopt.c apr-1.6.5/test/testsockopt.c
--- apr-1.6.5-o/test/testsockopt.c	2006-08-03 20:25:30.000000000 +0930
+++ apr-1.6.5/test/testsockopt.c	2018-10-31 19:14:46.000000000 +1030
@@ -38,7 +38,6 @@
 
     rv = apr_socket_opt_set(sock, APR_SO_KEEPALIVE, 1);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
-
     rv = apr_socket_opt_get(sock, APR_SO_KEEPALIVE, &ck);
     ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
     ABTS_INT_EQUAL(tc, 1, ck);
Only in apr-1.6.5/test: tryread.map
diff -ur apr-1.6.5-o/threadproc/os2/proc.c apr-1.6.5/threadproc/os2/proc.c
--- apr-1.6.5-o/threadproc/os2/proc.c	2014-04-28 21:38:38.000000000 +0930
+++ apr-1.6.5/threadproc/os2/proc.c	2018-10-31 19:14:46.000000000 +1030
@@ -41,22 +41,13 @@
 
 APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *pool)
 {
-    (*new) = (apr_procattr_t *)apr_palloc(pool, 
-              sizeof(apr_procattr_t));
+    (*new) = (apr_procattr_t *)apr_pcalloc(pool, sizeof(apr_procattr_t));
 
     if ((*new) == NULL) {
         return APR_ENOMEM;
     }
     (*new)->pool = pool;
-    (*new)->parent_in = NULL;
-    (*new)->child_in = NULL;
-    (*new)->parent_out = NULL;
-    (*new)->child_out = NULL;
-    (*new)->parent_err = NULL;
-    (*new)->child_err = NULL;
-    (*new)->currdir = NULL; 
     (*new)->cmdtype = APR_PROGRAM;
-    (*new)->detached = FALSE;
     return APR_SUCCESS;
 }
 
@@ -110,13 +101,14 @@
     return APR_SUCCESS;
 }
 
-APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in,
-                                   apr_file_t *parent_in)
+APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr,
+                                                    apr_file_t *child_in,
+                                                    apr_file_t *parent_in)
 {
-    apr_status_t rv;
+    apr_status_t rv = APR_SUCCESS;
 
     if (attr->child_in == NULL && attr->parent_in == NULL
-            && child_in == NULL && parent_in == NULL)
+           && child_in == NULL && parent_in == NULL)
         if ((rv = apr_file_pipe_create(&attr->child_in, &attr->parent_in,
                                        attr->pool)) == APR_SUCCESS)
             rv = apr_file_inherit_unset(attr->parent_in);
@@ -133,16 +125,20 @@
     }
 
     if (parent_in != NULL && rv == APR_SUCCESS) {
-        rv = apr_file_dup(&attr->parent_in, parent_in, attr->pool);
+        if (attr->parent_in)
+            rv = apr_file_dup2(attr->parent_in, parent_in, attr->pool);
+        else
+            rv = apr_file_dup(&attr->parent_in, parent_in, attr->pool);
     }
 
     return rv;
 }
 
-APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out,
+APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr,
+                                                     apr_file_t *child_out,
                                                      apr_file_t *parent_out)
 {
-    apr_status_t rv;
+    apr_status_t rv = APR_SUCCESS;
 
     if (attr->child_out == NULL && attr->parent_out == NULL
            && child_out == NULL && parent_out == NULL)
@@ -160,23 +156,27 @@
                 rv = apr_file_inherit_set(attr->child_out);
         }
     }
-  
+
     if (parent_out != NULL && rv == APR_SUCCESS) {
-        rv = apr_file_dup(&attr->parent_out, parent_out, attr->pool);
+        if (attr->parent_out)
+            rv = apr_file_dup2(attr->parent_out, parent_out, attr->pool);
+        else
+            rv = apr_file_dup(&attr->parent_out, parent_out, attr->pool);
     }
 
     return rv;
 }
 
-APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err,
+APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr,
+                                                     apr_file_t *child_err,
                                                      apr_file_t *parent_err)
 {
-    apr_status_t rv;
+    apr_status_t rv = APR_SUCCESS;
 
     if (attr->child_err == NULL && attr->parent_err == NULL
            && child_err == NULL && parent_err == NULL)
         if ((rv = apr_file_pipe_create(&attr->parent_err, &attr->child_err,
-                                       attr->pool)) == APR_SUCCESS)
+                                      attr->pool)) == APR_SUCCESS)
             rv = apr_file_inherit_unset(attr->parent_err);
 
     if (child_err != NULL && rv == APR_SUCCESS) {
@@ -189,20 +189,24 @@
                 rv = apr_file_inherit_set(attr->child_err);
         }
     }
-  
     if (parent_err != NULL && rv == APR_SUCCESS) {
-        rv = apr_file_dup(&attr->parent_err, parent_err, attr->pool);
+        if (attr->parent_err)
+            rv = apr_file_dup2(attr->parent_err, parent_err, attr->pool);
+        else
+            rv = apr_file_dup(&attr->parent_err, parent_err, attr->pool);
     }
 
     return rv;
 }
 
-APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, const char *dir)
+APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr,
+                                               const char *dir)
 {
     attr->currdir = apr_pstrdup(attr->pool, dir);
     if (attr->currdir) {
         return APR_SUCCESS;
     }
+
     return APR_ENOMEM;
 }
 
@@ -222,21 +226,26 @@
 APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool)
 {
     int pid;
-    
+
     if ((pid = fork()) < 0) {
         return errno;
     }
     else if (pid == 0) {
         proc->pid = pid;
-        proc->in = NULL; 
-        proc->out = NULL; 
-        proc->err = NULL; 
+        proc->in = NULL;
+        proc->out = NULL;
+        proc->err = NULL;
+
+        apr_random_after_fork(proc);
+
         return APR_INCHILD;
     }
+
     proc->pid = pid;
-    proc->in = NULL; 
-    proc->out = NULL; 
-    proc->err = NULL; 
+    proc->in = NULL;
+    proc->out = NULL;
+    proc->err = NULL;
+
     return APR_INPARENT;
 }
 
@@ -273,7 +282,6 @@
 APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr,
                                                        apr_child_errfn_t *errfn)
 {
-    /* won't ever be called on this platform, so don't save the function pointer */
     return APR_SUCCESS;
 }
 
@@ -282,7 +290,6 @@
 APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr,
                                                        apr_int32_t chk)
 {
-    /* won't ever be used on this platform, so don't save the flag */
     return APR_SUCCESS;
 }
 
@@ -537,9 +544,8 @@
         DosExitCritSec();
 
     return status;
-}
-
 
+}
 
 static void proces_result_codes(RESULTCODES codes, 
                                 int *exitcode, 
@@ -587,7 +593,6 @@
             break;
         }
     }
-
     if (exitcode) {
         *exitcode = result;
     }
@@ -599,6 +604,7 @@
 
 
 
+#if 0
 APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc,
                                                   int *exitcode,
                                                   apr_exit_why_e *exitwhy,
@@ -624,6 +630,7 @@
 
 
 
+#if 1
 APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
                                         int *exitcode, apr_exit_why_e *exitwhy,
                                         apr_wait_how_e waithow)
@@ -642,8 +649,150 @@
 
     return APR_OS2_STATUS(rc);
 } 
+#else
+APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
+                                        int *exitcode, apr_exit_why_e *exitwhy,
+                                        apr_wait_how_e waithow)
+{
+    RESULTCODES codes;
+    ULONG rc;
+    PID pid;
+    rc = DosWaitChild(DCWA_PROCESS, waithow == APR_WAIT ? DCWW_WAIT : DCWW_NOWAIT, &codes, &pid, proc->pid);
+//fprintf(stderr,"rc of DosWaitChild= %d\n",rc);
+    if (rc == 0) {
+        proces_result_codes(codes, exitcode, exitwhy);
+        return APR_CHILD_DONE;
+    } else if (rc == ERROR_CHILD_NOT_COMPLETE) {
+        return APR_CHILD_NOTDONE;
+    } 
 
+    if (rc==128){
+      pid_t pstatus;
+      int waitpid_options = WUNTRACED;
+      int exit_int;
+      int ignore;
+      apr_exit_why_e ignorewhy;
+
+      if (exitcode == NULL) {
+          exitcode = &ignore;
+      }
+
+      if (exitwhy == NULL) {
+          exitwhy = &ignorewhy;
+      }
+
+      if (waithow != APR_WAIT) {
+          waitpid_options |= WNOHANG;
+      }
+
+      do {
+          pstatus = waitpid(proc->pid, &exit_int, waitpid_options);
+      } while (pstatus < 0 && errno == EINTR);
+
+      if (pstatus > 0) {
+          proc->pid = pstatus;
+
+          if (WIFEXITED(exit_int)) {
+              *exitwhy = APR_PROC_EXIT;
+              *exitcode = WEXITSTATUS(exit_int);
+//fprintf(stderr,"exitwhy = %d, exitcode = %d\n",APR_PROC_EXIT, WEXITSTATUS(exit_int));
+          }
+          else if (WIFSIGNALED(exit_int)) {
+              *exitwhy = APR_PROC_SIGNAL;
+#ifdef WCOREDUMP
+              if (WCOREDUMP(exit_int)) {
+                  *exitwhy |= APR_PROC_SIGNAL_CORE;
+              }
+#endif
+
+              *exitcode = WTERMSIG(exit_int);
+          }
+          else {
+              /* unexpected condition */
+              return APR_EGENERAL;
+          }
+
+          return APR_CHILD_DONE;
+      }
+      else if (pstatus == 0) {
+          return APR_CHILD_NOTDONE;
+      }
 
+      return errno;
+
+    }
+    return APR_OS2_STATUS(rc);
+} 
+#endif
+#else
+APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc,
+                                                  int *exitcode,
+                                                  apr_exit_why_e *exitwhy,
+                                                  apr_wait_how_e waithow,
+                                                  apr_pool_t *p)
+{
+    proc->pid = -1;
+    return apr_proc_wait(proc, exitcode, exitwhy, waithow);
+}
+
+APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
+                                        int *exitcode, apr_exit_why_e *exitwhy,
+                                        apr_wait_how_e waithow)
+{
+    pid_t pstatus;
+    int waitpid_options = WUNTRACED;
+    int exit_int;
+    int ignore;
+    apr_exit_why_e ignorewhy;
+
+    if (exitcode == NULL) {
+        exitcode = &ignore;
+    }
+
+    if (exitwhy == NULL) {
+        exitwhy = &ignorewhy;
+    }
+
+    if (waithow != APR_WAIT) {
+        waitpid_options |= WNOHANG;
+    }
+
+    do {
+        pstatus = waitpid(proc->pid, &exit_int, waitpid_options);
+    } while (pstatus < 0 && errno == EINTR);
+
+    if (pstatus > 0) {
+        proc->pid = pstatus;
+
+        if (WIFEXITED(exit_int)) {
+            *exitwhy = APR_PROC_EXIT;
+            *exitcode = WEXITSTATUS(exit_int);
+        }
+        else if (WIFSIGNALED(exit_int)) {
+            *exitwhy = APR_PROC_SIGNAL;
+
+#ifdef WCOREDUMP
+            if (WCOREDUMP(exit_int)) {
+                *exitwhy |= APR_PROC_SIGNAL_CORE;
+            }
+#endif
+
+            *exitcode = WTERMSIG(exit_int);
+        }
+        else {
+            /* unexpected condition */
+            return APR_EGENERAL;
+        }
+
+        return APR_CHILD_DONE;
+    }
+    else if (pstatus == 0) {
+        return APR_CHILD_NOTDONE;
+    }
+
+    return errno;
+}
+#endif
 
 APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize)
 {
@@ -670,3 +819,11 @@
 {
     return APR_ENOTIMPL;
 }
+
+APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr,
+                                                 apr_int32_t what,
+                                                 struct rlimit *limit)
+{
+    return APR_ENOTIMPL;
+}
+
diff -ur apr-1.6.5-o/threadproc/os2/thread.c apr-1.6.5/threadproc/os2/thread.c
--- apr-1.6.5-o/threadproc/os2/thread.c	2007-10-14 01:51:40.000000000 +1030
+++ apr-1.6.5/threadproc/os2/thread.c	2018-10-31 19:14:46.000000000 +1030
@@ -22,8 +22,11 @@
 #include "apr_lib.h"
 #include "apr_portable.h"
 #include "apr_arch_file_io.h"
+//#define INCL_LIBLOADEXCEPTQ
+//#include "exceptq.h"
 #include <stdlib.h>
 
+
 APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *pool)
 {
     (*new) = (apr_threadattr_t *)apr_palloc(pool, sizeof(apr_threadattr_t));
@@ -68,8 +71,13 @@
 
 static void apr_thread_begin(void *arg)
 {
+//  EXCEPTIONREGISTRATIONRECORD exRegRec;
   apr_thread_t *thread = (apr_thread_t *)arg;
+  // install exception handler (dynamically loaded)
+//  LibLoadExceptq(&exRegRec);
   thread->exitval = thread->func(thread, thread->data);
+  /* remove exception handler */
+  apr_thread_exit(thread, thread->exitval);      // In case caller does not call apr_thread_exit
 }
 
 
@@ -131,7 +139,29 @@
 
 APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t retval)
 {
+    PTIB ptib;
+    PPIB ppib;
+//    EXCEPTIONREGISTRATIONRECORD *pexRegRec;     // 2013-03-17 SHL
     thd->exitval = retval;
+    // 2013-03-17 SHL
+    DosGetInfoBlocks(&ptib, &ppib);
+#if 0
+    pexRegRec = ptib->tib_pexchain;
+    /* Verify that we have what looks like a valid registration record pointer
+       It's a really bad coding error for this not to be the case
+       but some code within the thread might goof might install a
+       handler and forget to uninstall it
+       FIXME to report this condition somewhere
+       Maybe we should just force a trap
+    */
+    if (pexRegRec != END_OF_CHAIN &&
+        (PVOID)pexRegRec > (PVOID)&ptib &&
+        (PVOID)pexRegRec < ptib->tib_pstacklimit)
+    {
+      /* remove exception handler */
+      UninstallExceptq(pexRegRec);      // 2013-03-17 SHL
+    }
+#endif
     _endthread();
     return -1; /* If we get here something's wrong */
 }
diff -ur apr-1.6.5-o/threadproc/unix/signals.c apr-1.6.5/threadproc/unix/signals.c
--- apr-1.6.5-o/threadproc/unix/signals.c	2008-02-01 19:26:54.000000000 +1030
+++ apr-1.6.5/threadproc/unix/signals.c	2018-10-31 19:14:46.000000000 +1030
@@ -44,7 +44,6 @@
                                                      XCPT_SIGNAL_BREAK));
     }
 #endif /* OS2 */
-
     if (kill(proc->pid, signum) == -1) {
         return errno;
     }
@@ -416,7 +415,7 @@
     sigfillset(&sig_mask);
     remove_sync_sigs(&sig_mask);
 
-#if defined(SIGPROCMASK_SETS_THREAD_MASK) || ! APR_HAS_THREADS
+#if defined(SIGPROCMASK_SETS_THREAD_MASK) || ! APR_HAS_THREADS || defined(OS2)
     if ((rv = sigprocmask(SIG_SETMASK, &sig_mask, NULL)) != 0) {
         rv = errno;
     }
@@ -442,7 +441,7 @@
 
     sigaddset(&sig_mask, signum);
 
-#if defined(SIGPROCMASK_SETS_THREAD_MASK) || ! APR_HAS_THREADS
+#if defined(SIGPROCMASK_SETS_THREAD_MASK) || ! APR_HAS_THREADS || defined(OS2)
     if ((rv = sigprocmask(SIG_BLOCK, &sig_mask, NULL)) != 0) {
         rv = errno;
     }
@@ -469,7 +468,7 @@
 
     sigaddset(&sig_mask, signum);
 
-#if defined(SIGPROCMASK_SETS_THREAD_MASK) || ! APR_HAS_THREADS
+#if defined(SIGPROCMASK_SETS_THREAD_MASK) || ! APR_HAS_THREADS || defined(OS2)
     if ((rv = sigprocmask(SIG_UNBLOCK, &sig_mask, NULL)) != 0) {
         rv = errno;
     }
diff -ur apr-1.6.5-o/time/unix/time.c apr-1.6.5/time/unix/time.c
--- apr-1.6.5-o/time/unix/time.c	2017-09-11 08:00:34.000000000 +0930
+++ apr-1.6.5/time/unix/time.c	2018-10-31 19:14:46.000000000 +1030
@@ -126,7 +126,7 @@
 APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result,
                                                 apr_time_t input)
 {
-#if defined(__EMX__)
+#if defined(__EMX__) && !defined(__KLIBC__)
     /* EMX gcc (OS/2) has a timezone global we can use */
     return apr_time_exp_tz(result, input, -timezone);
 #else
@@ -250,7 +250,7 @@
 #endif
 }
 
-#ifdef OS2
+#if defined(OS2) 
 APR_DECLARE(apr_status_t) apr_os2_time_to_apr_time(apr_time_t *result,
                                                    FDATE os2date,
                                                    FTIME os2time)
Only in apr-1.6.5/tools: gen_test_char.exe
Only in apr-1.6.5/tools: gen_test_char.lo
Only in apr-1.6.5/tools: gen_test_char.map
Only in apr-1.6.5/tools: gen_test_char.o
diff -ur apr-1.6.5-o/user/unix/userinfo.c apr-1.6.5/user/unix/userinfo.c
--- apr-1.6.5-o/user/unix/userinfo.c	2006-08-03 20:25:30.000000000 +0930
+++ apr-1.6.5/user/unix/userinfo.c	2018-10-31 19:14:46.000000000 +1030
@@ -77,7 +77,7 @@
     if ((rv = getpwnam_safe(username, &pw, pwbuf)) != APR_SUCCESS)
         return rv;
 
-#ifdef OS2
+#if (defined(OS2)&&!defined(__INNOTEK_LIBC__))
     /* Need to manually add user name for OS/2 */
     *dirname = apr_pstrcat(p, pw.pw_dir, pw.pw_name, NULL);
 #else
apr-1.6.5.diff (123,077 bytes)

Steven Levine

2019-01-01 04:21

manager   ~0003236

warnings-to-fix.txt is an annotated listing of the warnings I recommend you make go away. Add a few #includes will resolve the vast majority of them. There was only one that could potentially cause a crash.

warnings-to-fix.txt (13,077 bytes)
apr 1.6.5 warnings that probably should be fixed
2018-12-31 SHL

file_io/os2/dir.c:64:8: warning: implicit declaration of function 'access'; did you mean 'accept'? [-Wimplicit-function-declaration]
     if(access(dirname, F_OK) != 0) return APR_ENOENT;
        accept

* Add #include <io.h>

file_io/os2/filestat.c:136:25: warning: implicit declaration of function 'apr_unix_mode2perms'; did you mean 'apr_uid_compare'? [-Wimplicit-function-declaration]
     finfo->protection = apr_unix_mode2perms(info->st_mode);
                         ^~~~~~~~~~~~~~~~~~~
                         apr_uid_compare

Add #include "../unix/apr_arch_file_io.h" or add apr_unix_mode2perms() to os2/apr_arch_file_io.h

file_io/os2/../unix/mktemp.c:71:23: warning: implicit declaration of function 'srandom'; did you mean 'seedrandom'? [-Wimplicit-function-declaration]
 #define seedrandom(a) srandom(a)
                       ^~~~~~~
         seedrandom(randseed);
         ^~~~~~~~~~
* Add #include <stdlib.h>

file_io/os2/../unix/mktemp.c:70:22: warning: implicit declaration of function 'random'; did you mean 'rindex'? [-Wimplicit-function-declaration]
 #define arc4random() random()
                      ^~~~~~
         randnum = arc4random() % (sizeof(padchar) - 1);
                   ^~~~~~~~~~

* Add #include <stdlib.h>

file_io/os2/open.c:36:9: warning: implicit declaration of function 'close'; did you mean 'pclose'? [-Wimplicit-function-declaration]
     if (close(file->filedes) == 0) {
         ^~~~~
         pclose

* Add #include <unistd.h>

file_io/os2/open.c:39:13: warning: implicit declaration of function 'unlink' [-Wimplicit-function-declaration]
             unlink(file->fname);
             ^~~~~~

* Add #include <unistd.h>

file_io/os2/readwrite.c:111:38: warning: passing argument 2 of 'DosResetEventSem' from incompatible pointer type [-Wincompatible-pointer-types]
   DosResetEventSem(thefile->pipeSem, &post_count);
                                      ^~~~~~~~~~~
                 from ./include/apr.h:192,
                 from ./include/apr_pools.h:43,
                 from ./include/arch/unix/../apr_private_common.h:24,
                 from ./include/arch/unix/apr_private.h:1019,
                 from U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_file_io.h:20,
                 from file_io/os2/readwrite.c:20:
 ULONG APIENTRY DosResetEventSem (HEV hev, PULONG pulCount);
                                           ~~~~~~~^~~~~~~~

* Change post_count from into to unsigned long

file_io/os2/readwrite.c:112:48: warning: passing argument 4 of 'DosRead' from incompatible pointer type [-Wincompatible-pointer-types]
      rc = DosRead(thefile->filedes, buf, *len, &nbytes);
                                                ^~~~~~~
                 from ./include/apr.h:192,
                 from ./include/apr_pools.h:43,
                 from ./include/arch/unix/../apr_private_common.h:24,
                 from ./include/arch/unix/apr_private.h:1019,
                 from U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_file_io.h:20,
                 from file_io/os2/readwrite.c:20:
     PULONG pulBytesRead);
     ~~~~~~~^~~~~~~~~~~~

* Change nbytes to unsigned long

file_io/os2/readwrite.c:167:69: warning: passing argument 4 of 'SafeDosSetFilePtr' from incompatible pointer type [-Wincompatible-pointer-types]
                 DosSetFilePtr(thefile->filedes, offset, FILE_BEGIN, &thefile->filePtr );
                                                                     ^~~~~~~~~~~~~~~~~
                 from ./include/apr.h:192,
                 from ./include/apr_pools.h:43,
                 from ./include/arch/unix/../apr_private_common.h:24,
                 from ./include/arch/unix/apr_private.h:1019,
                 from U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_file_io.h:20,
                 from file_io/os2/readwrite.c:20:
 ULONG APIENTRY DosSetFilePtr (HFILE hFile, LONG lOffset, ULONG ulOrigin, PULONG pulPos);

                                                                          ~~~~~~~^~~~~~
* Cast thefile->filePtr to to unsigned long
* Changing filePtr to unsigned long is probably too intrusive

file_io/os2/readwrite.c:192:13: warning: implicit declaration of function 'isatty'; did you mean 'isset'? [-Wimplicit-function-declaration]
         if (isatty(thefile->filedes)
             ^~~~~~
             isset

* Add #include <io.h>

file_io/os2/readwrite.c:197:30: warning: implicit declaration of function '_lmalloc'; did you mean '_tmalloc'? [-Wimplicit-function-declaration]
                 pvBuf_safe = _lmalloc(*nbytes);
                              ^~~~~~~~
                              _tmalloc

* Add #include <umalloc.h> or
* Add #include <malloc.h> and change to _tmalloc
* _lmalloc and _tmalloc both allocate from the same heap

file_io/os2/readwrite.c:197:28: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
                 pvBuf_safe = _lmalloc(*nbytes);
                            ^

* Add #include <umalloc.h> or
* Add #include <malloc.h> and change to _tmalloc
* _lmalloc and _tmalloc both allocate from the same heap

file_io/os2/readwrite.c:208:30: warning: implicit declaration of function 'alloca' [-Wimplicit-function-declaration]
                 pvBuf_safe = alloca(*nbytes);
                              ^~~~~~

* Add #include <stdlib.h> or <alloca.h>

file_io/os2/readwrite.c:208:30: warning: incompatible implicit declaration of built-in function 'alloca'
file_io/os2/readwrite.c:308:16: warning: implicit declaration of function 'write'; did you mean 'fwrite'? [-Wimplicit-function-declaration]
      written = write(thefile->filedes, thefile->buffer, thefile->bufpos);
                ^~~~~
                fwrite

* Add #include <unistd.h>

file_io/os2/seek.c:45:63: warning: passing argument 4 of 'SafeDosSetFilePtr' from incompatible pointer type [-Wincompatible-pointer-types]
         rc = DosSetFilePtr(thefile->filedes, pos, FILE_BEGIN, &thefile->filePtr );
                                                               ^~~~~~~~~~~~~~~~~
                 from ./include/apr.h:192,
                 from ./include/apr_pools.h:43,
                 from ./include/arch/unix/../apr_private_common.h:24,
                 from ./include/arch/unix/apr_private.h:1019,
                 from U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_file_io.h:20,
                 from file_io/os2/seek.c:17:
 ULONG APIENTRY DosSetFilePtr (HFILE hFile, LONG lOffset, ULONG ulOrigin, PULONG pulPos);


                                                                          ~~~~~~~^~~~~~
* Cast thefile->filePtr to to unsigned long
* Changing filePtr to unsigned long is probably too intrusive

memory/unix/apr_pools.c:411:17: warning: implicit declaration of function '_lmalloc'; did you mean 'malloc'? [-Wimplicit-function-declaration]
     if ((node = _lmalloc(size)) == NULL)
                 ^~~~~~~~
                 malloc

* Add #include <umalloc.h> or
* Add #include <malloc.h> and change to _tmalloc
* _lmalloc and _tmalloc both allocate from the same heap

memory/unix/apr_pools.c:411:15: warning: assignment to 'apr_memnode_t *' {aka 'struct apr_memnode_t *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
     if ((node = _lmalloc(size)) == NULL)
               ^
                 from network_io/os2/../unix/inet_ntop.c:18,
                 from network_io/os2/inet_ntop.c:1:

* Add #include <umalloc.h> or
* Add #include <malloc.h> and change to _tmalloc
* _lmalloc and _tmalloc both allocate from the same heap

U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_os2calls.h:19:2: warning: #warning xxx [-Wcpp]
 #warning xxx
  ^~~~~~~
                 from network_io/os2/../unix/inet_pton.c:18,
                 from network_io/os2/inet_pton.c:1:

* I have no clue why someone added this warning to apr_arch_os2calls.h

U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_os2calls.h:19:2: warning: #warning xxx [-Wcpp]
 #warning xxx
                 from network_io/os2/os2calls.c:17:

* I have no clue why someone added this warning to apr_arch_os2calls.h

U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_os2calls.h:19:2: warning: #warning xxx [-Wcpp]
 #warning xxx
  ^~~~~~~
                 from network_io/os2/sendrecv.c:17:
* I have no clue why someone added this warning to apr_arch_os2calls.h

U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_os2calls.h:19:2: warning: #warning xxx [-Wcpp]
 #warning xxx
  ^~~~~~~
                 from network_io/os2/sendrecv_udp.c:17:

* I have no clue why someone added this warning to apr_arch_os2calls.h

U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_os2calls.h:19:2: warning: #warning xxx [-Wcpp]
 #warning xxx
  ^~~~~~~
                 from network_io/os2/../unix/sockaddr.c:17,
                 from network_io/os2/sockaddr.c:2:

* I have no clue why someone added this warning to apr_arch_os2calls.h

U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_os2calls.h:19:2: warning: #warning xxx [-Wcpp]
 #warning xxx
  ^~~~~~~
* I have no clue why someone added this warning to apr_arch_os2calls.h

network_io/os2/../unix/multicast.c:165:28: warning: passing argument 4 of 'apr_os2_setsockopt' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
                            (const void *) &mip4, sizeof(mip4)) == -1) {
                            ^~~~~~~~~~~~~~~~~~~~

* Probably should add const to declaraction in apr_arch_os2calls.h just to get rid of warning

network_io/os2/../unix/multicast.c:208:24: warning: passing argument 4 of 'apr_os2_setsockopt' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
                        (const void *) &value, sizeof(value)) == -1) {
                        ^~~~~~~~~~~~~~~~~~~~~

* Probably should add const to declaraction in apr_arch_os2calls.h just to get rid of warning

network_io/os2/../unix/multicast.c:292:24: warning: passing argument 4 of 'apr_os2_setsockopt' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
                        (const void *) &iface->sa.sin.sin_addr,
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                 from network_io/os2/sockets.c:17:

* Probably should add const to declaraction in apr_arch_os2calls.h just to get rid of warning

U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_os2calls.h:19:2: warning: #warning xxx [-Wcpp]
 #warning xxx
  ^~~~~~~
                 from network_io/os2/sockopt.c:17:

* I have no clue why someone added this warning to apr_arch_os2calls.h

U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_os2calls.h:19:2: warning: #warning xxx [-Wcpp]
 #warning xxx
  ^~~~~~~
                 from poll/os2/poll.c:19:

* I have no clue why someone added this warning to apr_arch_os2calls.h

U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_os2calls.h:19:2: warning: #warning xxx [-Wcpp]
 #warning xxx
  ^~~~~~~
                 from ./include/apr_poll.h:24,
                 from poll/os2/poll.c:18:

* I have no clue why someone added this warning to apr_arch_os2calls.h

In file included from ./include/apr_pools.h:44,
                 from ./include/apr_poll.h:24,
                 from poll/os2/poll.c:18:
poll/os2/poll.c: In function 'apr_pollcb_method_name':
./include/apr_errno.h:476:28: warning: returning 'int' from a function with return type 'const char *' makes pointer from integer without a cast [-Wint-conversion]
 #define APR_ENOTIMPL       (APR_OS_START_STATUS + 23)
                            ^
     return APR_ENOTIMPL;
            ^~~~~~~~~~~~
                 from poll/os2/pollset.c:19:

* apr_pollcb_method_name() shoud probably return NULL or maybe "NOT_IMPLEMENTED"
* A non-zero value could cause a crash
* Since apr_pollcb_create_ex returns APR_ENOTIMPL, apr_pollcb_method_name()
* should probably never be called.

U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_os2calls.h:19:2: warning: #warning xxx [-Wcpp]
 #warning xxx
  ^~~~~~~

* I have no clue why someone added this warning to apr_arch_os2calls.h

poll/os2/pollset.c:221:18: warning: implicit declaration of function 'alloca' [-Wimplicit-function-declaration]
     pollresult = alloca(sizeof(int) * pollset->num_total);
                  ^~~~~~

* Add #include <stdlib.h> or <alloca.h>

poll/os2/pollset.c:221:18: warning: incompatible implicit declaration of built-in function 'alloca'
                 from support/unix/waitio.c:18:

U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_os2calls.h:19:2: warning: #warning xxx [-Wcpp]
 #warning xxx
  ^~~~~~~
* I have no clue why someone added this warning to apr_arch_os2calls.h

threadproc/os2/proc.c:239:9: warning: implicit declaration of function 'apr_random_after_fork'; did you mean 'apr_proc_mutex_lock'? [-Wimplicit-function-declaration]
         apr_random_after_fork(proc);
         ^~~~~~~~~~~~~~~~~~~~~
         apr_proc_mutex_lock

threadproc/os2/thread.c:78:19: warning: assignment to 'apr_status_t' {aka 'int'} from 'void *' makes integer from pointer without a cast [-Wint-conversion]
   thread->exitval = thread->func(thread, thread->data);
                   ^
warnings-to-fix.txt (13,077 bytes)

psmedley

2019-01-01 07:16

administrator   ~0003237

Thanks - I'll take a look later today. I did spend some time on APR warnings previously, but that was a few GCC versions and years ago :) I'd noticed the warnings that were due to missing headers and put them off for a rainier day :)

psmedley

2019-01-01 18:49

administrator   ~0003238

Made the suggested changes today, and no more warnings :) Will go take a look at Apache2 warnings now

psmedley

2019-01-01 19:25

administrator   ~0003239

Fixed in latest build, which needs to be added to the website

Issue History

Date Modified Username Field Change
2018-12-20 06:53 Steven Levine New Issue
2018-12-21 16:45 psmedley Note Added: 0003211
2018-12-21 17:57 Steven Levine Note Added: 0003212
2018-12-22 07:39 psmedley Note Added: 0003213
2018-12-22 07:41 psmedley Note Edited: 0003213 View Revisions
2018-12-24 17:09 psmedley Assigned To => psmedley
2018-12-24 17:09 psmedley Status new => feedback
2018-12-25 12:16 LewisR Note Added: 0003215
2018-12-25 13:35 Steven Levine Note Added: 0003216
2018-12-25 13:35 Steven Levine Status feedback => assigned
2018-12-25 13:35 Steven Levine Status assigned => acknowledged
2018-12-25 19:08 Steven Levine Note Added: 0003217
2018-12-25 19:19 psmedley Note Added: 0003218
2018-12-25 20:22 Steven Levine Note Added: 0003219
2018-12-26 16:35 psmedley Note Added: 0003220
2018-12-27 03:08 Steven Levine Note Added: 0003221
2018-12-27 14:09 psmedley Note Added: 0003222
2018-12-28 07:29 Steven Levine Note Added: 0003223
2018-12-28 11:21 psmedley Note Added: 0003224
2018-12-28 13:04 Steven Levine Note Added: 0003225
2018-12-28 13:38 psmedley Note Added: 0003226
2018-12-28 18:52 Steven Levine Note Added: 0003227
2018-12-28 19:06 psmedley Note Added: 0003228
2018-12-30 05:00 Steven Levine Note Added: 0003229
2018-12-30 07:09 psmedley Note Added: 0003230
2018-12-30 12:09 Steven Levine File Added: 02e9_01.trp
2018-12-30 12:09 Steven Levine Note Added: 0003231
2018-12-30 12:33 Steven Levine Note Added: 0003232
2018-12-30 14:42 psmedley Note Added: 0003233
2018-12-30 18:35 Steven Levine Note Added: 0003234
2018-12-31 18:41 psmedley File Added: aprbuild.log
2018-12-31 18:41 psmedley File Added: apr-1.6.5.diff
2018-12-31 18:41 psmedley Note Added: 0003235
2019-01-01 04:21 Steven Levine File Added: warnings-to-fix.txt
2019-01-01 04:21 Steven Levine Note Added: 0003236
2019-01-01 07:16 psmedley Note Added: 0003237
2019-01-01 18:49 psmedley Note Added: 0003238
2019-01-01 19:25 psmedley Status acknowledged => resolved
2019-01-01 19:25 psmedley Resolution open => fixed
2019-01-01 19:25 psmedley Note Added: 0003239