blob: 2d42dc0df35fc72046e3e25af62ea0db5674e203 [file] [log] [blame]
Guido van Rossumf70e43a1991-02-19 12:39:46 +00001/***********************************************************
Guido van Rossum524b5881995-01-04 19:10:35 +00002Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
3The Netherlands.
Guido van Rossumf70e43a1991-02-19 12:39:46 +00004
5 All Rights Reserved
6
Guido van Rossumd266eb41996-10-25 14:44:06 +00007Permission to use, copy, modify, and distribute this software and its
8documentation for any purpose and without fee is hereby granted,
Guido van Rossumf70e43a1991-02-19 12:39:46 +00009provided that the above copyright notice appear in all copies and that
Guido van Rossumd266eb41996-10-25 14:44:06 +000010both that copyright notice and this permission notice appear in
Guido van Rossumf70e43a1991-02-19 12:39:46 +000011supporting documentation, and that the names of Stichting Mathematisch
Guido van Rossumd266eb41996-10-25 14:44:06 +000012Centrum or CWI or Corporation for National Research Initiatives or
13CNRI not be used in advertising or publicity pertaining to
14distribution of the software without specific, written prior
15permission.
Guido van Rossumf70e43a1991-02-19 12:39:46 +000016
Guido van Rossumd266eb41996-10-25 14:44:06 +000017While CWI is the initial source for this software, a modified version
18is made available by the Corporation for National Research Initiatives
19(CNRI) at the Internet address ftp://ftp.python.org.
20
21STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
22REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
23MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
24CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
25DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
26PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
27TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
28PERFORMANCE OF THIS SOFTWARE.
Guido van Rossumf70e43a1991-02-19 12:39:46 +000029
30******************************************************************/
31
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000032/* Time module */
33
Guido van Rossum3f5da241990-12-20 15:06:42 +000034#include "allobjects.h"
Guido van Rossum3f5da241990-12-20 15:06:42 +000035#include "modsupport.h"
Guido van Rossumff4949e1992-08-05 19:58:53 +000036#include "ceval.h"
Guido van Rossum3f5da241990-12-20 15:06:42 +000037
Guido van Rossum99d90c01996-08-08 19:17:45 +000038#ifdef HAVE_SELECT
39#include "mymath.h"
40#endif
41
Guido van Rossum6d946f91992-08-14 13:49:30 +000042#ifdef macintosh
Guido van Rossumb6775db1994-08-01 11:34:53 +000043#include <time.h>
44#else
45#include <sys/types.h>
Guido van Rossum6d946f91992-08-14 13:49:30 +000046#endif
47
Guido van Rossumb6775db1994-08-01 11:34:53 +000048#ifdef QUICKWIN
49#include <io.h>
50#endif
51
52#ifdef HAVE_UNISTD_H
Guido van Rossum2762f251992-03-27 17:22:13 +000053#include <unistd.h>
54#endif
55
Guido van Rossumb6775db1994-08-01 11:34:53 +000056#ifdef HAVE_SELECT
57#include "myselect.h"
58#else
59#include "mytime.h"
60#endif
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000061
Guido van Rossumb6775db1994-08-01 11:34:53 +000062#ifdef HAVE_FTIME
63#include <sys/timeb.h>
64#endif
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000065
Guido van Rossumbceeac81996-05-23 22:53:47 +000066#ifdef __WATCOMC__
67#include <i86.h>
68#else
Guido van Rossumcac6c721996-09-06 13:34:02 +000069#ifdef MS_WINDOWS
Guido van Rossumb6775db1994-08-01 11:34:53 +000070#include <windows.h>
Guido van Rossumb2fb3641996-09-07 00:47:35 +000071#ifdef MS_WIN16
72/* These overrides not needed for Win32 */
Guido van Rossumb6775db1994-08-01 11:34:53 +000073#define timezone _timezone
Guido van Rossumcc081121995-03-14 15:05:41 +000074#define tzname _tzname
75#define daylight _daylight
76#define altzone _altzone
Guido van Rossumb2fb3641996-09-07 00:47:35 +000077#endif /* MS_WIN16 */
Guido van Rossumcac6c721996-09-06 13:34:02 +000078#endif /* MS_WINDOWS */
79#endif /* !__WATCOMC__ */
Guido van Rossum234f9421993-06-17 12:35:49 +000080
81/* Forward declarations */
Guido van Rossumb6775db1994-08-01 11:34:53 +000082static int floatsleep PROTO((double));
83static double floattime PROTO(());
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000084
85static object *
86time_time(self, args)
87 object *self;
88 object *args;
89{
Guido van Rossumb6775db1994-08-01 11:34:53 +000090 double secs;
Guido van Rossuma2b7f401993-01-04 09:09:59 +000091 if (!getnoarg(args))
92 return NULL;
Guido van Rossumb6775db1994-08-01 11:34:53 +000093 secs = floattime();
94 if (secs == 0.0) {
Guido van Rossuma2b7f401993-01-04 09:09:59 +000095 err_errno(IOError);
96 return NULL;
97 }
Guido van Rossumb6775db1994-08-01 11:34:53 +000098 return newfloatobject(secs);
99}
100
101#ifdef HAVE_CLOCK
102
103#ifndef CLOCKS_PER_SEC
Guido van Rossum1b66a4f1996-02-25 04:50:33 +0000104#ifdef CLK_TCK
105#define CLOCKS_PER_SEC CLK_TCK
106#else
Guido van Rossumb6775db1994-08-01 11:34:53 +0000107#define CLOCKS_PER_SEC 1000000
108#endif
Guido van Rossum1b66a4f1996-02-25 04:50:33 +0000109#endif
Guido van Rossumb6775db1994-08-01 11:34:53 +0000110
111static object *
112time_clock(self, args)
113 object *self;
114 object *args;
115{
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000116 if (!getnoarg(args))
117 return NULL;
Guido van Rossumb6775db1994-08-01 11:34:53 +0000118 return newfloatobject(((double)clock()) / CLOCKS_PER_SEC);
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000119}
Guido van Rossumb6775db1994-08-01 11:34:53 +0000120#endif /* HAVE_CLOCK */
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000121
122static object *
123time_sleep(self, args)
124 object *self;
125 object *args;
126{
Guido van Rossum775f4da1993-01-09 17:18:52 +0000127 double secs;
Guido van Rossum775f4da1993-01-09 17:18:52 +0000128 if (!getargs(args, "d", &secs))
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000129 return NULL;
Guido van Rossumff4949e1992-08-05 19:58:53 +0000130 BGN_SAVE
Guido van Rossumb6775db1994-08-01 11:34:53 +0000131 if (floatsleep(secs) != 0) {
Guido van Rossumff4949e1992-08-05 19:58:53 +0000132 RET_SAVE
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000133 return NULL;
134 }
Guido van Rossumff4949e1992-08-05 19:58:53 +0000135 END_SAVE
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000136 INCREF(None);
137 return None;
138}
139
Guido van Rossum234f9421993-06-17 12:35:49 +0000140static object *
141time_convert(when, function)
142 time_t when;
Guido van Rossumb6775db1994-08-01 11:34:53 +0000143 struct tm * (*function) PROTO((const time_t *));
Guido van Rossum234f9421993-06-17 12:35:49 +0000144{
Guido van Rossum6e8583d1996-10-08 14:19:52 +0000145 struct tm *p;
146 errno = 0;
147 p = function(&when);
148 if (p == NULL) {
149#ifdef EINVAL
Guido van Rossum0b1ff661996-11-02 17:31:22 +0000150 if (errno == 0)
Guido van Rossum6e8583d1996-10-08 14:19:52 +0000151 errno = EINVAL;
152#endif
153 return err_errno(IOError);
154 }
Guido van Rossum234f9421993-06-17 12:35:49 +0000155 return mkvalue("(iiiiiiiii)",
156 p->tm_year + 1900,
157 p->tm_mon + 1, /* Want January == 1 */
158 p->tm_mday,
159 p->tm_hour,
160 p->tm_min,
161 p->tm_sec,
162 (p->tm_wday + 6) % 7, /* Want Monday == 0 */
Guido van Rossum9e90a671993-06-24 11:10:19 +0000163 p->tm_yday + 1, /* Want January, 1 == 1 */
Guido van Rossum234f9421993-06-17 12:35:49 +0000164 p->tm_isdst);
165}
166
167static object *
168time_gmtime(self, args)
169 object *self;
170 object *args;
171{
172 double when;
173 if (!getargs(args, "d", &when))
174 return NULL;
175 return time_convert((time_t)when, gmtime);
176}
177
178static object *
179time_localtime(self, args)
180 object *self;
181 object *args;
182{
183 double when;
184 if (!getargs(args, "d", &when))
185 return NULL;
186 return time_convert((time_t)when, localtime);
187}
188
Guido van Rossum9e90a671993-06-24 11:10:19 +0000189static int
190gettmarg(args, p)
191 object *args;
192 struct tm *p;
193{
194 if (!getargs(args, "(iiiiiiiii)",
195 &p->tm_year,
196 &p->tm_mon,
197 &p->tm_mday,
198 &p->tm_hour,
199 &p->tm_min,
200 &p->tm_sec,
201 &p->tm_wday,
202 &p->tm_yday,
203 &p->tm_isdst))
204 return 0;
205 if (p->tm_year >= 1900)
206 p->tm_year -= 1900;
207 p->tm_mon--;
208 p->tm_wday = (p->tm_wday + 1) % 7;
209 p->tm_yday--;
210 return 1;
211}
212
Guido van Rossum8d8c1ee1995-09-13 17:38:35 +0000213#ifdef HAVE_STRFTIME
214static object *
215time_strftime(self, args)
216 object *self;
217 object *args;
218{
219 struct tm buf;
220 const char *fmt;
221 char *outbuf = 0;
222 int i;
223
224 if (!PyArg_ParseTuple(args, "s(iiiiiiiii)",
225 &fmt,
226 &(buf.tm_year),
227 &(buf.tm_mon),
228 &(buf.tm_mday),
229 &(buf.tm_hour),
230 &(buf.tm_min),
231 &(buf.tm_sec),
232 &(buf.tm_wday),
233 &(buf.tm_yday),
234 &(buf.tm_isdst)))
235 return NULL;
236 if (buf.tm_year >= 1900)
237 buf.tm_year -= 1900;
238 buf.tm_mon--;
239 buf.tm_wday = (buf.tm_wday + 1) % 7;
240 buf.tm_yday--;
241 /* I hate these functions that presume you know how big the output */
242 /* will be ahead of time... */
243 for (i = 1024 ; i < 8192 ; i += 1024) {
244 outbuf = malloc(i);
245 if (outbuf == NULL) {
246 return err_nomem();
247 }
248 if (strftime(outbuf, i-1, fmt, &buf) != 0) {
249 object *ret;
250 ret = newstringobject(outbuf);
251 free(outbuf);
252 return ret;
253 }
254 free(outbuf);
255 }
256 return err_nomem();
257}
258#endif /* HAVE_STRFTIME */
259
Guido van Rossum9e90a671993-06-24 11:10:19 +0000260static object *
261time_asctime(self, args)
262 object *self;
263 object *args;
264{
265 struct tm buf;
266 char *p;
267 if (!gettmarg(args, &buf))
268 return NULL;
269 p = asctime(&buf);
270 if (p[24] == '\n')
271 p[24] = '\0';
272 return newstringobject(p);
273}
274
275static object *
276time_ctime(self, args)
277 object *self;
278 object *args;
279{
280 double dt;
281 time_t tt;
282 char *p;
283 if (!getargs(args, "d", &dt))
284 return NULL;
Guido van Rossumcac6c721996-09-06 13:34:02 +0000285 tt = (time_t)dt;
Guido van Rossum9e90a671993-06-24 11:10:19 +0000286 p = ctime(&tt);
287 if (p[24] == '\n')
288 p[24] = '\0';
289 return newstringobject(p);
290}
291
Guido van Rossum234f9421993-06-17 12:35:49 +0000292static object *
293time_mktime(self, args)
294 object *self;
295 object *args;
296{
297 struct tm buf;
Guido van Rossumbceeac81996-05-23 22:53:47 +0000298 time_t tt;
299 tt = time(&tt);
300 buf = *localtime(&tt);
Guido van Rossum9e90a671993-06-24 11:10:19 +0000301 if (!gettmarg(args, &buf))
Guido van Rossum234f9421993-06-17 12:35:49 +0000302 return NULL;
Guido van Rossumbceeac81996-05-23 22:53:47 +0000303 tt = mktime(&buf);
304 if (tt == (time_t)(-1)) {
305 err_setstr(OverflowError, "mktime argument out of range");
306 return NULL;
307 }
308 return newfloatobject((double)tt);
Guido van Rossum234f9421993-06-17 12:35:49 +0000309}
310
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000311static struct methodlist time_methods[] = {
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000312 {"time", time_time},
Guido van Rossumb6775db1994-08-01 11:34:53 +0000313#ifdef HAVE_CLOCK
314 {"clock", time_clock},
315#endif
316 {"sleep", time_sleep},
Guido van Rossum234f9421993-06-17 12:35:49 +0000317 {"gmtime", time_gmtime},
318 {"localtime", time_localtime},
Guido van Rossum9e90a671993-06-24 11:10:19 +0000319 {"asctime", time_asctime},
320 {"ctime", time_ctime},
Guido van Rossum234f9421993-06-17 12:35:49 +0000321 {"mktime", time_mktime},
Guido van Rossum8d8c1ee1995-09-13 17:38:35 +0000322#ifdef HAVE_STRFTIME
Guido van Rossum5416e201996-02-13 00:14:09 +0000323 {"strftime", time_strftime, 1},
Guido van Rossum8d8c1ee1995-09-13 17:38:35 +0000324#endif
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000325 {NULL, NULL} /* sentinel */
326};
327
Guido van Rossum8239f0f1995-01-22 00:49:01 +0000328static void
329ins(d, name, v)
330 object *d;
331 char *name;
332 object *v;
333{
334 if (v == NULL)
335 fatal("Can't initialize time module -- NULL value");
336 if (dictinsert(d, name, v) != 0)
337 fatal("Can't initialize time module -- dictinsert failed");
338 DECREF(v);
339}
340
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000341void
342inittime()
343{
Jack Jansen8ccfc931995-10-03 14:39:44 +0000344 object *m, *d;
Guido van Rossum234f9421993-06-17 12:35:49 +0000345 m = initmodule("time", time_methods);
346 d = getmoduledict(m);
Guido van Rossumb6775db1994-08-01 11:34:53 +0000347#ifdef HAVE_TZNAME
Guido van Rossum234f9421993-06-17 12:35:49 +0000348 tzset();
Guido van Rossum8239f0f1995-01-22 00:49:01 +0000349 ins(d, "timezone", newintobject((long)timezone));
Guido van Rossumb6775db1994-08-01 11:34:53 +0000350#ifdef HAVE_ALTZONE
Guido van Rossum8239f0f1995-01-22 00:49:01 +0000351 ins(d, "altzone", newintobject((long)altzone));
Guido van Rossumb6775db1994-08-01 11:34:53 +0000352#else
Guido van Rossum8239f0f1995-01-22 00:49:01 +0000353 ins(d, "altzone", newintobject((long)timezone-3600));
Guido van Rossumb6775db1994-08-01 11:34:53 +0000354#endif
Guido van Rossum8239f0f1995-01-22 00:49:01 +0000355 ins(d, "daylight", newintobject((long)daylight));
356 ins(d, "tzname", mkvalue("(zz)", tzname[0], tzname[1]));
Guido van Rossumb6775db1994-08-01 11:34:53 +0000357#else /* !HAVE_TZNAME */
358#if HAVE_TM_ZONE
Guido van Rossum234f9421993-06-17 12:35:49 +0000359 {
360#define YEAR ((time_t)((365 * 24 + 6) * 3600))
361 time_t t;
362 struct tm *p;
363 long winterzone, summerzone;
364 char wintername[10], summername[10];
Guido van Rossumb6775db1994-08-01 11:34:53 +0000365 /* XXX This won't work on the southern hemisphere.
366 XXX Anybody got a better idea? */
Guido van Rossum234f9421993-06-17 12:35:49 +0000367 t = (time((time_t *)0) / YEAR) * YEAR;
368 p = localtime(&t);
369 winterzone = -p->tm_gmtoff;
370 strncpy(wintername, p->tm_zone ? p->tm_zone : " ", 9);
371 wintername[9] = '\0';
372 t += YEAR/2;
373 p = localtime(&t);
374 summerzone = -p->tm_gmtoff;
375 strncpy(summername, p->tm_zone ? p->tm_zone : " ", 9);
376 summername[9] = '\0';
Guido van Rossum8239f0f1995-01-22 00:49:01 +0000377 ins(d, "timezone", newintobject(winterzone));
378 ins(d, "altzone", newintobject(summerzone));
379 ins(d, "daylight", newintobject((long)(winterzone != summerzone)));
380 ins(d, "tzname", mkvalue("(zz)", wintername, summername));
Guido van Rossum234f9421993-06-17 12:35:49 +0000381 }
Guido van Rossumb6775db1994-08-01 11:34:53 +0000382#endif /* HAVE_TM_ZONE */
383#endif /* !HAVE_TZNAME */
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000384}
385
386
Guido van Rossumb6775db1994-08-01 11:34:53 +0000387/* Implement floattime() for various platforms */
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000388
Guido van Rossumb6775db1994-08-01 11:34:53 +0000389static double
390floattime()
Guido van Rossum85a5fbb1990-10-14 12:07:46 +0000391{
Guido van Rossumb6775db1994-08-01 11:34:53 +0000392 /* There are three ways to get the time:
393 (1) gettimeofday() -- resolution in microseconds
394 (2) ftime() -- resolution in milliseconds
395 (3) time() -- resolution in seconds
396 In all cases the return value is a float in seconds.
397 Since on some systems (e.g. SCO ODT 3.0) gettimeofday() may
398 fail, so we fall back on ftime() or time().
399 Note: clock resolution does not imply clock accuracy! */
400#ifdef HAVE_GETTIMEOFDAY
401 {
Guido van Rossum426035c1991-02-19 12:27:35 +0000402 struct timeval t;
Guido van Rossum3bbc62e1995-01-02 19:30:30 +0000403#ifdef GETTIMEOFDAY_NO_TZ
404 if (gettimeofday(&t) == 0)
405 return (double)t.tv_sec + t.tv_usec*0.000001;
406#else /* !GETTIMEOFDAY_NO_TZ */
Guido van Rossumb6775db1994-08-01 11:34:53 +0000407 if (gettimeofday(&t, (struct timezone *)NULL) == 0)
408 return (double)t.tv_sec + t.tv_usec*0.000001;
Guido van Rossum3bbc62e1995-01-02 19:30:30 +0000409#endif /* !GETTIMEOFDAY_NO_TZ */
Guido van Rossumb6775db1994-08-01 11:34:53 +0000410 }
411#endif /* !HAVE_GETTIMEOFDAY */
412 {
413#ifdef HAVE_FTIME
414 struct timeb t;
415 ftime(&t);
Guido van Rossum7b1e9741994-08-29 10:46:42 +0000416 return (double)t.time + (double)t.millitm * (double)0.001;
Guido van Rossumb6775db1994-08-01 11:34:53 +0000417#else /* !HAVE_FTIME */
418 time_t secs;
419 time(&secs);
420 return (double)secs;
421#endif /* !HAVE_FTIME */
422 }
Guido van Rossum426035c1991-02-19 12:27:35 +0000423}
424
Guido van Rossumb6775db1994-08-01 11:34:53 +0000425
426/* Implement floatsleep() for various platforms.
427 When interrupted (or when another error occurs), return -1 and
428 set an exception; else return 0. */
429
430static int
Guido van Rossuma320fd31995-03-09 12:14:15 +0000431#ifdef MPW
432floatsleep(double secs)
433#else
Guido van Rossum775f4da1993-01-09 17:18:52 +0000434floatsleep(secs)
435 double secs;
Guido van Rossuma320fd31995-03-09 12:14:15 +0000436#endif /* MPW */
Guido van Rossum426035c1991-02-19 12:27:35 +0000437{
Guido van Rossumb6775db1994-08-01 11:34:53 +0000438#ifdef HAVE_SELECT
Guido van Rossum426035c1991-02-19 12:27:35 +0000439 struct timeval t;
Guido van Rossum775f4da1993-01-09 17:18:52 +0000440 double frac;
Guido van Rossum775f4da1993-01-09 17:18:52 +0000441 frac = fmod(secs, 1.0);
442 secs = floor(secs);
443 t.tv_sec = (long)secs;
444 t.tv_usec = (long)(frac*1000000.0);
Guido van Rossumb6775db1994-08-01 11:34:53 +0000445 if (select(0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &t) != 0) {
446 err_errno(IOError);
447 return -1;
448 }
449#else /* !HAVE_SELECT */
450#ifdef macintosh
451#define MacTicks (* (long *)0x16A)
452 long deadline;
453 deadline = MacTicks + (long)(secs * 60.0);
454 while (MacTicks < deadline) {
455 if (sigcheck())
456 return -1;
457 }
458#else /* !macintosh */
Guido van Rossumbceeac81996-05-23 22:53:47 +0000459#ifdef __WATCOMC__
460 /* XXX Can't interrupt this sleep */
461 delay((int)(secs * 1000 + 0.5)); /* delay() uses milliseconds */
462#else /* !__WATCOMC__ */
Guido van Rossume22e6441993-07-09 10:51:31 +0000463#ifdef MSDOS
Guido van Rossumb6775db1994-08-01 11:34:53 +0000464 struct timeb t1, t2;
465 double frac;
466 extern double fmod PROTO((double, double));
467 extern double floor PROTO((double));
468 if (secs <= 0.0)
469 return;
470 frac = fmod(secs, 1.0);
471 secs = floor(secs);
472 ftime(&t1);
473 t2.time = t1.time + (int)secs;
474 t2.millitm = t1.millitm + (int)(frac*1000.0);
475 while (t2.millitm >= 1000) {
476 t2.time++;
477 t2.millitm -= 1000;
478 }
479 for (;;) {
480#ifdef QUICKWIN
481 _wyield();
Guido van Rossum80c9d881991-04-16 08:47:51 +0000482#endif
Guido van Rossumb6775db1994-08-01 11:34:53 +0000483 if (sigcheck())
484 return -1;
485 ftime(&t1);
486 if (t1.time > t2.time ||
487 t1.time == t2.time && t1.millitm >= t2.millitm)
488 break;
489 }
490#else /* !MSDOS */
Guido van Rossumb2fb3641996-09-07 00:47:35 +0000491#ifdef MS_WIN32
Guido van Rossumb6775db1994-08-01 11:34:53 +0000492 /* XXX Can't interrupt this sleep */
493 Sleep((int)(secs*1000));
Guido van Rossumb2fb3641996-09-07 00:47:35 +0000494#else /* !MS_WIN32 */
Guido van Rossumb6775db1994-08-01 11:34:53 +0000495 /* XXX Can't interrupt this sleep */
496 sleep((int)secs);
Guido van Rossumb2fb3641996-09-07 00:47:35 +0000497#endif /* !MS_WIN32 */
Guido van Rossumb6775db1994-08-01 11:34:53 +0000498#endif /* !MSDOS */
Guido van Rossumbceeac81996-05-23 22:53:47 +0000499#endif /* !__WATCOMC__ */
Guido van Rossumb6775db1994-08-01 11:34:53 +0000500#endif /* !macintosh */
501#endif /* !HAVE_SELECT */
502 return 0;
Guido van Rossum80c9d881991-04-16 08:47:51 +0000503}