diff options
author | wchang0222%aol.com <devnull@localhost> | 2004-04-20 00:25:30 +0000 |
---|---|---|
committer | wchang0222%aol.com <devnull@localhost> | 2004-04-20 00:25:30 +0000 |
commit | d12ccb5c4aea178caabf20a974fbb1245e6cf473 (patch) | |
tree | 49255fbcd80fa55d286a0607079c07c8eeb540dd /pr/src/md/os2 | |
parent | 90ff5ebdbb4b1c68e56b830dc7c12534539a24fa (diff) | |
download | nspr-hg-d12ccb5c4aea178caabf20a974fbb1245e6cf473.tar.gz |
Bugzilla bug 239663
r=mkaply, sr=blizzard (platform specific)
OS/2 only - bring back VACPP support for NSPR.
Modified Files: configure.in rules.mk prio.h prtypes.h _os2.h _os2_errors.h
primpl.h prsocket.c os2_errors.c os2sock.c os2thred.c prnetdb.c
Diffstat (limited to 'pr/src/md/os2')
-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; } |