aboutsummaryrefslogtreecommitdiffstats
path: root/src/sysselect.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sysselect.h')
-rw-r--r--src/sysselect.h38
1 files changed, 4 insertions, 34 deletions
diff --git a/src/sysselect.h b/src/sysselect.h
index e0f7b4e13ee..d6c5d1c7148 100644
--- a/src/sysselect.h
+++ b/src/sysselect.h
@@ -25,40 +25,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
25 25
26#include "lisp.h" 26#include "lisp.h"
27 27
28#ifdef WINDOWSNT 28/* The w32 build defines select stuff in w32.h, which is included
29 29 where w32 needs it, but not where sysselect.h is included. The w32
30/* File descriptor set emulation. */ 30 definitions in w32.h are incompatible with the below. */
31 31#ifndef WINDOWSNT
32/* MSVC runtime library has limit of 64 descriptors by default */
33#define FD_SETSIZE 64
34typedef struct {
35 unsigned int bits[FD_SETSIZE / 32];
36} fd_set;
37
38/* standard access macros */
39#define FD_SET(n, p) \
40 do { \
41 if ((n) < FD_SETSIZE) { \
42 (p)->bits[(n)/32] |= (1 << (n)%32); \
43 } \
44 } while (0)
45#define FD_CLR(n, p) \
46 do { \
47 if ((n) < FD_SETSIZE) { \
48 (p)->bits[(n)/32] &= ~(1 << (n)%32); \
49 } \
50 } while (0)
51#define FD_ISSET(n, p) ((n) < FD_SETSIZE ? ((p)->bits[(n)/32] & (1 << (n)%32)) : 0)
52#define FD_ZERO(p) memset((p), 0, sizeof(fd_set))
53
54#define SELECT_TYPE fd_set
55
56#include "systime.h"
57extern int sys_select (int, SELECT_TYPE *, SELECT_TYPE *, SELECT_TYPE *,
58 struct timespec *, sigset_t *);
59
60#else /* not WINDOWSNT */
61
62#ifdef FD_SET 32#ifdef FD_SET
63#ifndef FD_SETSIZE 33#ifndef FD_SETSIZE
64#define FD_SETSIZE 64 34#define FD_SETSIZE 64