View | Details | Raw Unified | Return to bug 40193
Collapse All | Expand All

(-)apr-1.2.7-dist/build/aplibtool.c (-2 / +2 lines)
Lines 36-42 Link Here
36
#  define CC         "gcc"
36
#  define CC         "gcc"
37
#  define GEN_EXPORTS "emxexp"
37
#  define GEN_EXPORTS "emxexp"
38
#  define DEF2IMPLIB_CMD "emximp"
38
#  define DEF2IMPLIB_CMD "emximp"
39
#  define SHARE_SW   "-Zdll -Zmtd"
39
#  define SHARE_SW   "-Zdll -Zmap -Zmtd"
40
#  define USE_OMF true
40
#  define USE_OMF true
41
#  define TRUNCATE_DLL_NAME
41
#  define TRUNCATE_DLL_NAME
42
#  define DYNAMIC_LIB_EXT "dll"
42
#  define DYNAMIC_LIB_EXT "dll"
Lines 45-51 Link Here
45
#  if USE_OMF
45
#  if USE_OMF
46
     /* OMF is the native format under OS/2 */
46
     /* OMF is the native format under OS/2 */
47
#    define STATIC_LIB_EXT "lib"
47
#    define STATIC_LIB_EXT "lib"
48
#    define OBJECT_EXT     "obj"
48
#    define OBJECT_EXT     "o"
49
#    define LIBRARIAN      "emxomfar"
49
#    define LIBRARIAN      "emxomfar"
50
#  else
50
#  else
51
     /* but the alternative, a.out, can fork() which is sometimes necessary */
51
     /* but the alternative, a.out, can fork() which is sometimes necessary */
(-)apr-1.2.7-dist/dso/os2/dso.c (-2 / +21 lines)
Lines 50-62 Link Here
50
    (*res_handle)->load_error = APR_SUCCESS;
50
    (*res_handle)->load_error = APR_SUCCESS;
51
    (*res_handle)->failed_module = NULL;
51
    (*res_handle)->failed_module = NULL;
52
52
53
    if ((rc = DosLoadModule(failed_module, sizeof(failed_module), path, &handle)) != 0) {
53
    rc = DosLoadModule(failed_module, sizeof(failed_module), path, &handle);
54
55
   if ((rc != 0)&&(rc!=87)) {
54
        (*res_handle)->load_error = APR_FROM_OS_ERROR(rc);
56
        (*res_handle)->load_error = APR_FROM_OS_ERROR(rc);
55
        (*res_handle)->failed_module = apr_pstrdup(ctx, failed_module);
57
        (*res_handle)->failed_module = apr_pstrdup(ctx, failed_module);
56
        return APR_FROM_OS_ERROR(rc);
58
        return APR_FROM_OS_ERROR(rc);
57
    }
59
    }
58
60
61
   if (rc==87){
62
        int rc2;
63
        HMODULE handle2;
64
        rc2=DosQueryModuleHandle(path,&handle2);
65
        (*res_handle)->handle  = handle2;
66
        }
67
   if (rc==0) 
59
    (*res_handle)->handle  = handle;
68
    (*res_handle)->handle  = handle;
69
60
    apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null);
70
    apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null);
61
    return APR_SUCCESS;
71
    return APR_SUCCESS;
62
}
72
}
Lines 80-86 Link Here
80
    if (symname == NULL || ressym == NULL)
90
    if (symname == NULL || ressym == NULL)
81
        return APR_ESYMNOTFOUND;
91
        return APR_ESYMNOTFOUND;
82
92
83
    if ((rc = DosQueryProcAddr(handle->handle, 0, symname, &func)) != 0) {
93
#if defined(__INNOTEK_LIBC__)
94
    void *retval;
95
    char *symbol = (char*)malloc(sizeof(char)*(strlen(symname)+2));
96
    sprintf(symbol, "_%s", symname);
97
    rc = DosQueryProcAddr(handle->handle, 0, symbol, &func);
98
    free(symbol);
99
#else
100
    rc = DosQueryProcAddr(handle->handle, 0, symname, &func);
101
#endif
102
    if (rc != 0) {
84
        handle->load_error = APR_FROM_OS_ERROR(rc);
103
        handle->load_error = APR_FROM_OS_ERROR(rc);
85
        return handle->load_error;
104
        return handle->load_error;
86
    }
105
    }
(-)apr-1.2.7-dist/file_io/os2/open.c (+7 lines)
Lines 28-33 Link Here
28
    return apr_file_close(file);
28
    return apr_file_close(file);
29
}
29
}
30
30
31
#ifdef __INNOTEK_LIBC__
32
apr_status_t apr_unix_file_cleanup(void *thefile)
33
{
34
    apr_file_t *file = thefile;
35
    return apr_file_close(file);
36
}
37
#endif
31
38
32
39
33
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)
40
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)
(-)apr-1.2.7-dist/file_io/os2/readwrite.c (-1 / +53 lines)
Lines 331-336 Link Here
331
}
331
}
332
332
333
333
334
/* Pull from unix code to start a sync up */
335
#if (defined(__INNOTEK_LIBC__) || defined(__WATCOMC__) )
336
 
337
struct apr_file_printf_data {
338
    apr_vformatter_buff_t vbuff;
339
    apr_file_t *fptr;
340
    char *buf;
341
};
342
343
static int file_printf_flush(apr_vformatter_buff_t *buff)
344
{
345
    struct apr_file_printf_data *data = (struct apr_file_printf_data *)buff;
346
347
    if (apr_file_write_full(data->fptr, data->buf,
348
                            data->vbuff.curpos - data->buf, NULL)) {
349
        return -1;
350
    }
351
352
    data->vbuff.curpos = data->buf;
353
    return 0;
354
}
355
356
357
APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr,
358
                                        const char *format, ...)
359
{
360
    struct apr_file_printf_data data;
361
    va_list ap;
362
    int count;
363
364
    /* don't really need a HUGE_STRING_LEN anymore */
365
    data.buf = malloc(HUGE_STRING_LEN);
366
    if (data.buf == NULL) {
367
        return -1;
368
    }
369
    data.vbuff.curpos = data.buf;
370
    data.vbuff.endpos = data.buf + HUGE_STRING_LEN;
371
    data.fptr = fptr;
372
    va_start(ap, format);
373
    count = apr_vformatter(file_printf_flush,
374
                           (apr_vformatter_buff_t *)&data, format, ap);
375
    /* apr_vformatter does not call flush for the last bits */
376
    if (count >= 0) file_printf_flush((apr_vformatter_buff_t *)&data);
377
378
    va_end(ap);
379
380
    free(data.buf);
381
382
    return count;
383
}
384
385
#else
334
386
335
APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, 
387
APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, 
336
                                        const char *format, ...)
388
                                        const char *format, ...)
Lines 351-357 Link Here
351
    free(buf);
403
    free(buf);
352
    return (cc == APR_SUCCESS) ? len : -1;
404
    return (cc == APR_SUCCESS) ? len : -1;
353
}
405
}
354
406
#endif
355
407
356
408
357
apr_status_t apr_file_check_read(apr_file_t *fd)
409
apr_status_t apr_file_check_read(apr_file_t *fd)
(-)apr-1.2.7-dist/file_io/unix/mktemp.c (+7 lines)
Lines 80-86 Link Here
80
#include <fcntl.h>
80
#include <fcntl.h>
81
#endif
81
#endif
82
#include <stdio.h>
82
#include <stdio.h>
83
#ifndef __INNOTEK_LIBC__
83
#include <stdlib.h>
84
#include <stdlib.h>
85
#endif
84
#include <string.h>
86
#include <string.h>
85
#include <ctype.h>
87
#include <ctype.h>
86
#ifdef HAVE_TIME_H
88
#ifdef HAVE_TIME_H
Lines 188-193 Link Here
188
#else
190
#else
189
    fd = mkstemp(template);
191
    fd = mkstemp(template);
190
#endif
192
#endif
193
194
#ifdef __INNOTEK_LIBC__
195
          setmode(fd, O_BINARY);
196
#endif 
197
191
    
198
    
192
    if (fd == -1) {
199
    if (fd == -1) {
193
        return errno;
200
        return errno;
(-)apr-1.2.7-dist/include/apr_network_io.h (-1 / +2 lines)
Lines 752-758 Link Here
752
 * Unset a socket from being inherited by child processes.
752
 * Unset a socket from being inherited by child processes.
753
 */
753
 */
754
APR_DECLARE_INHERIT_UNSET(socket);
754
APR_DECLARE_INHERIT_UNSET(socket);
755
755
#ifndef __INNOTEK_LIBC__
756
/**
756
/**
757
 * @defgroup apr_mcast IP Multicast
757
 * @defgroup apr_mcast IP Multicast
758
 * @{
758
 * @{
Lines 814-819 Link Here
814
APR_DECLARE(apr_status_t) apr_mcast_interface(apr_socket_t *sock,
814
APR_DECLARE(apr_status_t) apr_mcast_interface(apr_socket_t *sock,
815
                                              apr_sockaddr_t *iface);
815
                                              apr_sockaddr_t *iface);
816
816
817
#endif
817
/** @} */
818
/** @} */
818
819
819
/** @} */
820
/** @} */
(-)apr-1.2.7-dist/include/arch/os2/apr_arch_file_io.h (-1 / +11 lines)
Lines 29-35 Link Here
29
 * friendly & is part of the POSIX emulation rather than native so don't
29
 * friendly & is part of the POSIX emulation rather than native so don't
30
 * use it.
30
 * use it.
31
 */
31
 */
32
#ifndef __INNOTEK_LIBC__
32
#undef HAVE_MKSTEMP
33
#undef HAVE_MKSTEMP
34
#endif
33
35
34
#define APR_FILE_BUFSIZE 4096
36
#define APR_FILE_BUFSIZE 4096
35
37
Lines 45-51 Link Here
45
    int pipe;
47
    int pipe;
46
    HEV pipeSem;
48
    HEV pipeSem;
47
    enum { BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking;
49
    enum { BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking;
48
50
#ifndef WAITIO_USES_POLL
51
    /* if there is a timeout set, then this pollset is used */
52
    apr_pollset_t *pollset;
53
#endif
49
    /* Stuff for buffered mode */
54
    /* Stuff for buffered mode */
50
    char *buffer;
55
    char *buffer;
51
    int bufpos;               // Read/Write position in buffer
56
    int bufpos;               // Read/Write position in buffer
Lines 62-67 Link Here
62
    FILEFINDBUF3 entry;
67
    FILEFINDBUF3 entry;
63
    int validentry;
68
    int validentry;
64
};
69
};
70
71
#ifdef __INNOTEK_LIBC__
72
apr_status_t apr_unix_file_cleanup(void *);
73
#endif
74
65
75
66
apr_status_t apr_file_cleanup(void *);
76
apr_status_t apr_file_cleanup(void *);
67
apr_status_t apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2date, 
77
apr_status_t apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2date, 
(-)apr-1.2.7-dist/locks/os2/proc_mutex.c (+7 lines)
Lines 115-120 Link Here
115
    new->owner      = 0;
115
    new->owner      = 0;
116
    new->lock_count = 0;
116
    new->lock_count = 0;
117
117
118
#ifdef __INNOTEK_LIBC__
119
    if (!fname) {
120
        /* Reinitializing unnamed mutexes is a noop in the Unix code. */
121
        return APR_SUCCESS;
122
    }
123
#endif
124
118
    semname = fixed_name(fname, pool);
125
    semname = fixed_name(fname, pool);
119
    rc = DosOpenMutexSem(semname, &(new->hMutex));
126
    rc = DosOpenMutexSem(semname, &(new->hMutex));
120
    *mutex = new;
127
    *mutex = new;
(-)apr-1.2.7-dist/misc/unix/randbyte_os2.inc (-1 / +4 lines)
Lines 62-69 Link Here
62
 * which is why it's run-time linked.
62
 * which is why it's run-time linked.
63
 */
63
 */
64
64
65
#ifndef __INNOTEK_LIBC__
65
static APIRET APIENTRY(*DosPerfSysCall) (ULONG ulCommand, ULONG ulParm1,
66
static APIRET APIENTRY(*DosPerfSysCall) (ULONG ulCommand, ULONG ulParm1,
66
                                         ULONG ulParm2, ULONG ulParm3) = NULL;
67
                                         ULONG ulParm2, ULONG ulParm3) = NULL;
68
#endif
67
static HMODULE hDoscalls = 0;
69
static HMODULE hDoscalls = 0;
68
#define   CMD_KI_RDCNT    (0x63)
70
#define   CMD_KI_RDCNT    (0x63)
69
71
Lines 85-90 Link Here
85
    CPUUTIL util;
87
    CPUUTIL util;
86
    int c;
88
    int c;
87
89
90
#ifndef __INNOTEK_LIBC__
88
    if (hDoscalls == 0) {
91
    if (hDoscalls == 0) {
89
        char failed_module[20];
92
        char failed_module[20];
90
        ULONG rc;
93
        ULONG rc;
Lines 111-117 Link Here
111
            DosPerfSysCall = NULL;
114
            DosPerfSysCall = NULL;
112
        }
115
        }
113
    }
116
    }
114
117
#endif
115
    return byte;
118
    return byte;
116
}
119
}
117
120
(-)apr-1.2.7-dist/network_io/os2/sendrecv.c (-1 / +9 lines)
Lines 27-35 Link Here
27
    apr_ssize_t rv;
27
    apr_ssize_t rv;
28
    int fds, err = 0;
28
    int fds, err = 0;
29
29
30
#ifndef __INNOTEK_LIBC__
30
    if (*len > 65536) {
31
    if (*len > 65536) {
31
        *len = 65536;
32
        *len = 65536;
32
    }
33
    }
34
#endif 
33
35
34
    do {
36
    do {
35
        if (!sock->nonblock || err == SOCEWOULDBLOCK) {
37
        if (!sock->nonblock || err == SOCEWOULDBLOCK) {
Lines 114-124 Link Here
114
    int fds, err = 0;
116
    int fds, err = 0;
115
    int nv_tosend, total = 0;
117
    int nv_tosend, total = 0;
116
118
119
#ifndef __INNOTEK_LIBC__
117
    /* Make sure writev() only gets fed 64k at a time */
120
    /* Make sure writev() only gets fed 64k at a time */
118
    for ( nv_tosend = 0; nv_tosend < nvec && total + vec[nv_tosend].iov_len < 65536; nv_tosend++ ) {
121
    for ( nv_tosend = 0; nv_tosend < nvec && total + vec[nv_tosend].iov_len < 65536; nv_tosend++ ) {
119
        total += vec[nv_tosend].iov_len;
122
        total += vec[nv_tosend].iov_len;
120
    }
123
    }
121
124
#else
125
    /* workaround for writev() not required with libc */
126
    for ( nv_tosend = 0; nv_tosend < nvec; nv_tosend++ ) {
127
        total += vec[nv_tosend].iov_len;
128
    }
129
#endif
122
    tmpvec = alloca(sizeof(struct iovec) * nv_tosend);
130
    tmpvec = alloca(sizeof(struct iovec) * nv_tosend);
123
    memcpy(tmpvec, vec, sizeof(struct iovec) * nv_tosend);
131
    memcpy(tmpvec, vec, sizeof(struct iovec) * nv_tosend);
124
132
(-)apr-1.2.7-dist/network_io/os2/sockopt.c (+2 lines)
Lines 24-30 Link Here
24
#include <sys/socket.h>
24
#include <sys/socket.h>
25
#include <netinet/tcp.h>
25
#include <netinet/tcp.h>
26
#include <netinet/in.h>
26
#include <netinet/in.h>
27
#ifndef __INNOTEK_LIBC__
27
#include <unistd.h>
28
#include <unistd.h>
29
#endif
28
#include <netdb.h>
30
#include <netdb.h>
29
#include <sys/so_ioctl.h>
31
#include <sys/so_ioctl.h>
30
32
(-)apr-1.2.7-dist/threadproc/unix/signals.c (-4 / +3 lines)
Lines 44-50 Link Here
44
                                                     XCPT_SIGNAL_BREAK));
44
                                                     XCPT_SIGNAL_BREAK));
45
    }
45
    }
46
#endif /* OS2 */
46
#endif /* OS2 */
47
48
    if (kill(proc->pid, signum) == -1) {
47
    if (kill(proc->pid, signum) == -1) {
49
        return errno;
48
        return errno;
50
    }
49
    }
Lines 416-422 Link Here
416
    sigfillset(&sig_mask);
415
    sigfillset(&sig_mask);
417
    remove_sync_sigs(&sig_mask);
416
    remove_sync_sigs(&sig_mask);
418
417
419
#if defined(SIGPROCMASK_SETS_THREAD_MASK) || ! APR_HAS_THREADS
418
#if defined(SIGPROCMASK_SETS_THREAD_MASK) || ! APR_HAS_THREADS || defined(OS2)
420
    if ((rv = sigprocmask(SIG_SETMASK, &sig_mask, NULL)) != 0) {
419
    if ((rv = sigprocmask(SIG_SETMASK, &sig_mask, NULL)) != 0) {
421
        rv = errno;
420
        rv = errno;
422
    }
421
    }
Lines 442-448 Link Here
442
441
443
    sigaddset(&sig_mask, signum);
442
    sigaddset(&sig_mask, signum);
444
443
445
#if defined(SIGPROCMASK_SETS_THREAD_MASK) || ! APR_HAS_THREADS
444
#if defined(SIGPROCMASK_SETS_THREAD_MASK) || ! APR_HAS_THREADS || defined(OS2)
446
    if ((rv = sigprocmask(SIG_BLOCK, &sig_mask, NULL)) != 0) {
445
    if ((rv = sigprocmask(SIG_BLOCK, &sig_mask, NULL)) != 0) {
447
        rv = errno;
446
        rv = errno;
448
    }
447
    }
Lines 469-475 Link Here
469
468
470
    sigaddset(&sig_mask, signum);
469
    sigaddset(&sig_mask, signum);
471
470
472
#if defined(SIGPROCMASK_SETS_THREAD_MASK) || ! APR_HAS_THREADS
471
#if defined(SIGPROCMASK_SETS_THREAD_MASK) || ! APR_HAS_THREADS || defined(OS2)
473
    if ((rv = sigprocmask(SIG_UNBLOCK, &sig_mask, NULL)) != 0) {
472
    if ((rv = sigprocmask(SIG_UNBLOCK, &sig_mask, NULL)) != 0) {
474
        rv = errno;
473
        rv = errno;
475
    }
474
    }
(-)apr-1.2.7-dist/user/unix/userinfo.c (-1 / +1 lines)
Lines 77-83 Link Here
77
    if ((rv = getpwnam_safe(username, &pw, pwbuf)) != APR_SUCCESS)
77
    if ((rv = getpwnam_safe(username, &pw, pwbuf)) != APR_SUCCESS)
78
        return rv;
78
        return rv;
79
79
80
#ifdef OS2
80
#if (defined(OS2)&&!defined(__INNOTEK_LIBC__))
81
    /* Need to manually add user name for OS/2 */
81
    /* Need to manually add user name for OS/2 */
82
    *dirname = apr_pstrcat(p, pw.pw_dir, pw.pw_name, NULL);
82
    *dirname = apr_pstrcat(p, pw.pw_dir, pw.pw_name, NULL);
83
#else
83
#else

Return to bug 40193