diff options
author | wtc%netscape.com <devnull@localhost> | 2000-05-05 00:32:49 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 2000-05-05 00:32:49 +0000 |
commit | 1f599297ca629559d73867f32883b57dc8e3f02c (patch) | |
tree | a7d877b35a355c620791181029b06062766f16bc /pr/include | |
parent | 5aa879d94fdf78fb512d477e231fcf5fdc7e712b (diff) | |
download | nspr-hg-1f599297ca629559d73867f32883b57dc8e3f02c.tar.gz |
Bugzilla bug #17223: implemented the PR_MSG_PEEK flag for PR_Recv() for
BeOS, Mac OS, OS/2, and Windows. On BeOS, Mac OS, and NT, PR_MSG_PEEK
is emulated with a peek buffer in the NSPR file descriptors.
Modified files: _beos.h, _macos.h, _winnt.h, primpl.h, prsocket.c,
macsockotpt.c, os2sock.c, ntio.c, and w95sock.c
Diffstat (limited to 'pr/include')
-rw-r--r-- | pr/include/md/_beos.h | 3 | ||||
-rw-r--r-- | pr/include/md/_macos.h | 4 | ||||
-rw-r--r-- | pr/include/md/_winnt.h | 5 | ||||
-rw-r--r-- | pr/include/private/primpl.h | 4 |
4 files changed, 12 insertions, 4 deletions
diff --git a/pr/include/md/_beos.h b/pr/include/md/_beos.h index 8b56dec3..cd8eee65 100644 --- a/pr/include/md/_beos.h +++ b/pr/include/md/_beos.h @@ -68,6 +68,9 @@ #define _PR_GLOBAL_THREADS_ONLY #define _PR_BTHREADS #define _PR_NEED_FAKE_POLL +#define _PR_HAVE_PEEK_BUFFER +#define _PR_PEEK_BUFFER_MAX (16 * 1024) +#define _PR_FD_NEED_EMULATE_MSG_PEEK(fd) 1 /* Define threading functions and objects as native BeOS */ struct _MDThread { diff --git a/pr/include/md/_macos.h b/pr/include/md/_macos.h index d01fd2c1..8225c510 100644 --- a/pr/include/md/_macos.h +++ b/pr/include/md/_macos.h @@ -46,7 +46,9 @@ #include <setjmp.h> #include <Errors.h> -#define _PR_EMULATE_MSG_PEEK +#define _PR_HAVE_PEEK_BUFFER +#define _PR_PEEK_BUFFER_MAX (16 * 1024) +#define _PR_FD_NEED_EMULATE_MSG_PEEK(fd) 1 struct _MDProcess { PRInt8 notused; diff --git a/pr/include/md/_winnt.h b/pr/include/md/_winnt.h index 4ea950ba..b4bd27f2 100644 --- a/pr/include/md/_winnt.h +++ b/pr/include/md/_winnt.h @@ -50,7 +50,10 @@ #define _PR_HAVE_ATOMIC_OPS #define _PR_HAVE_ATOMIC_CAS #define PR_HAVE_WIN32_NAMED_SHARED_MEMORY -#define _PR_EMULATE_MSG_PEEK +#define _PR_HAVE_PEEK_BUFFER +#define _PR_PEEK_BUFFER_MAX (32 * 1024) +#define _PR_FD_NEED_EMULATE_MSG_PEEK(fd) \ + (!(fd)->secret->nonblocking && !(fd)->secret->inheritable) /* --- Common User-Thread/Native-Thread Definitions --------------------- */ diff --git a/pr/include/private/primpl.h b/pr/include/private/primpl.h index c9d62812..f87adcce 100644 --- a/pr/include/private/primpl.h +++ b/pr/include/private/primpl.h @@ -1577,8 +1577,8 @@ struct PRFilePrivate { PRBool inheritable; PRFileDesc *next; PRIntn lockCount; -#ifdef _PR_EMULATE_MSG_PEEK - char *peekBuf; +#ifdef _PR_HAVE_PEEK_BUFFER + char *peekBuffer; PRInt32 peekBufSize; PRInt32 peekBytes; #endif |