diff options
Diffstat (limited to 'pr/src/md')
-rw-r--r-- | pr/src/md/os2/os2_errors.c | 2 | ||||
-rw-r--r-- | pr/src/md/os2/os2sock.c | 17 | ||||
-rw-r--r-- | pr/src/md/os2/os2thred.c | 8 |
3 files changed, 23 insertions, 4 deletions
diff --git a/pr/src/md/os2/os2_errors.c b/pr/src/md/os2/os2_errors.c index 7c270c4d..1d29bf20 100644 --- a/pr/src/md/os2/os2_errors.c +++ b/pr/src/md/os2/os2_errors.c @@ -875,6 +875,7 @@ void _MD_os2_map_shutdown_error(PRInt32 err) } } +#ifndef XP_OS2_VACPP void _MD_os2_map_socketpair_error(PRInt32 err) { switch (err) { @@ -898,6 +899,7 @@ void _MD_os2_map_socketpair_error(PRInt32 err) return; } } +#endif void _MD_os2_map_getsockname_error(PRInt32 err) { diff --git a/pr/src/md/os2/os2sock.c b/pr/src/md/os2/os2sock.c index 8830a675..0b2653b1 100644 --- a/pr/src/md/os2/os2sock.c +++ b/pr/src/md/os2/os2sock.c @@ -53,6 +53,14 @@ #define READ_FD 1 #define WRITE_FD 2 +#ifdef XP_OS2_VACPP +#define _OS2_WRITEV writev +#define _OS2_IOCTL ioctl +#else +#define _OS2_WRITEV so_writev +#define _OS2_IOCTL so_ioctl +#endif + void _PR_MD_INIT_IO() { @@ -100,7 +108,7 @@ _MD_SocketAvailable(PRFileDesc *fd) { PRInt32 result; - if (so_ioctl(fd->secret->md.osfd, FIONREAD, (char *) &result, sizeof(result)) < 0) { + if (_OS2_IOCTL(fd->secret->md.osfd, FIONREAD, (char *) &result, sizeof(result)) < 0) { PR_SetError(PR_BAD_DESCRIPTOR_ERROR, sock_errno()); return -1; } @@ -539,7 +547,7 @@ _PR_MD_WRITEV(PRFileDesc *fd, const PRIOVec *iov, PRInt32 iov_size, } } - while ((rv = so_writev(osfd, (const struct iovec*)iov, iov_size)) == -1) { + while ((rv = _OS2_WRITEV(osfd, (const struct iovec*)iov, iov_size)) == -1) { err = sock_errno(); if ((err == EWOULDBLOCK)) { if (fd->secret->nonblocking) { @@ -584,6 +592,7 @@ _PR_MD_SHUTDOWN(PRFileDesc *fd, PRIntn how) return rv; } +#ifndef XP_OS2_VACPP PRInt32 _PR_MD_SOCKETPAIR(int af, int type, int flags, PRInt32 *osfd) { @@ -596,7 +605,7 @@ _PR_MD_SOCKETPAIR(int af, int type, int flags, PRInt32 *osfd) } return rv; } - +#endif PRStatus _PR_MD_GETSOCKNAME(PRFileDesc *fd, PRNetAddr *addr, PRUint32 *addrlen) @@ -666,7 +675,7 @@ _MD_MakeNonblock(PRFileDesc *fd) return; } - err = so_ioctl( osfd, FIONBIO, (char *) &one, sizeof(one)); + err = _OS2_IOCTL( osfd, FIONBIO, (char *) &one, sizeof(one)); if ( err != 0 ) { err = sock_errno(); diff --git a/pr/src/md/os2/os2thred.c b/pr/src/md/os2/os2thred.c index 45613573..d6d35b70 100644 --- a/pr/src/md/os2/os2thred.c +++ b/pr/src/md/os2/os2thred.c @@ -220,10 +220,18 @@ _PR_MD_CREATE_THREAD(PRThread *thread, PARAMSTORE* params = PR_Malloc(sizeof(PARAMSTORE)); params->start = start; params->thread = thread; +#ifdef XP_OS2_VACPP /* No exception handler for VACPP */ + thread->md.handle = thread->id = (TID) _beginthread( + (void(* _Optlink)(void*))start, + NULL, + thread->stack->stackSize, + thread); +#else thread->md.handle = thread->id = (TID) _beginthread(ExcpStartFunc, NULL, thread->stack->stackSize, params); +#endif if(thread->md.handle == -1) { return PR_FAILURE; } |