summaryrefslogtreecommitdiffstats
path: root/Include/myselect.h
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-08-01 11:34:53 (GMT)
committerGuido van Rossum <guido@python.org>1994-08-01 11:34:53 (GMT)
commitb6775db241f5fe5e3dc2ca09fc6c9e6164d4b2af (patch)
tree9362939305b2d088b8f19a530c9015d886bc2801 /Include/myselect.h
parent2979b01ff88ac4c5b316d9bf98edbaaaffac8e24 (diff)
downloadcpython-b6775db241f5fe5e3dc2ca09fc6c9e6164d4b2af.zip
cpython-b6775db241f5fe5e3dc2ca09fc6c9e6164d4b2af.tar.gz
cpython-b6775db241f5fe5e3dc2ca09fc6c9e6164d4b2af.tar.bz2
Merge alpha100 branch back to main trunk
Diffstat (limited to 'Include/myselect.h')
-rw-r--r--Include/myselect.h44
1 files changed, 17 insertions, 27 deletions
diff --git a/Include/myselect.h b/Include/myselect.h
index 174da11..e4f2b28 100644
--- a/Include/myselect.h
+++ b/Include/myselect.h
@@ -5,7 +5,7 @@ extern "C" {
#endif
/***********************************************************
-Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
Amsterdam, The Netherlands.
All Rights Reserved
@@ -28,38 +28,28 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
-/* Common definitions for files that use the BSD select system call.
- This is so complicated because every UNIX variant requires that
- you include a different set of headers. Customizing this one file
- should be easier than patching each of the files using select()... */
+/* Include file for users of select() */
+/* NB caller must include <sys/types.h> */
-/* XXX You may have to include some of these only if not already included */
-#include <sys/types.h>
-#include <sys/time.h> /* Implies <time.h> everywhere, as far as I know */
-#include <sys/param.h>
+#ifdef HAVE_SYS_SELECT_H
-
-/* Hacks for various systems that need hand-holding... */
-
-#ifdef _SEQUENT_
#include <sys/select.h>
-/* Sequent doesn't seem to define struct timezone anywhere?!?! */
-struct timezone {
- int tz_minuteswest;
- int tz_dsttime;
-};
-#endif
-#ifdef _AIX /* I *think* this works */
-/* AIX defines fd_set in a separate file. Sigh... */
-#include <sys/select.h>
-#endif
+#ifdef SYS_SELECT_WITH_SYS_TIME
+#include "mytime.h"
+#else /* !SYS_SELECT_WITH_SYS_TIME */
+#include <time.h>
+#endif /* !SYS_SELECT_WITH_SYS_TIME */
+
+#else /* !HAVE_SYS_SELECT_H */
+#include "mytime.h"
+#endif /* !HAVE_SYS_SELECT_H */
-/* (Very) old versions of BSD don't define the FD_* set of macros.
- The following will usually do... */
+/* If the fd manipulation macros aren't defined,
+ here is a set that should do the job */
#ifndef FD_SETSIZE
#define FD_SETSIZE 256
@@ -67,12 +57,12 @@ struct timezone {
#ifndef FD_SET
-typedef long fd_mask;
+typedef long fd_mask;
#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */
#ifndef howmany
#define howmany(x, y) (((x)+((y)-1))/(y))
-#endif
+#endif /* howmany */
typedef struct fd_set {
fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];