diff options
author | Guido van Rossum <guido@python.org> | 1993-01-21 16:07:51 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1993-01-21 16:07:51 (GMT) |
commit | 0b0db8e3a07c92786fde60bf53bd1d5aa32e0aae (patch) | |
tree | 8750daf2aeb5be8cdb034755f883c1c3557ea809 /Modules/posixmodule.c | |
parent | 80530ce8754956c8d5349d4644dc83113a63cfc1 (diff) | |
download | cpython-0b0db8e3a07c92786fde60bf53bd1d5aa32e0aae.zip cpython-0b0db8e3a07c92786fde60bf53bd1d5aa32e0aae.tar.gz cpython-0b0db8e3a07c92786fde60bf53bd1d5aa32e0aae.tar.bz2 |
Added separate main program for the Mac: macmain.c
stdwinmodule.c: wsetfont can now return an error
Makefile: add CL_USE and CL_LIB*S; config.c: move CL part around
New things in imgfile; also in Makefile.
longobject.c: fix comparison of negative long ints... [REAL BUG!]
marshal.c: add dumps() and loads() to read/write strings
timemodule.c: make sure there's always a floatsleep()
posixmodule.c: rationalize struct returned by times()
Makefile: add test target, disable imgfile by default
thread.c: Improved coexistance with dl module (sjoerd)
stdwinmodule.c: Change include stdwin.h if macintosh
rotormodule.c: added missing last argument to RTR_?_region calls
confic.c: merged with configmac.c, added 1993 to copyright message
fileobject.c: int compared to NULL in writestring(); change fopenRF ifdef
timemodule.c: simplify times() using mkvalue; include myselect.h
earlier (for sequent).
posixmodule: for sequent, include unistd.h instead of explicit
extern definitions and don't define rename()
Makefile: change misleading/wrong MD5 comments
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index bab0c59..a600115 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -75,6 +75,9 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "modsupport.h" #include "ceval.h" +#ifdef _SEQUENT_ +#include <unistd.h> +#else /* _SEQUENT_ */ /* XXX Aren't these always declared in unistd.h? */ extern char *strerror PROTO((int)); extern int chmod PROTO((const char *, mode_t)); @@ -87,6 +90,7 @@ extern int rmdir PROTO((const char *)); extern int stat PROTO((const char *, struct stat *)); extern int unlink PROTO((const char *)); extern int pclose PROTO((FILE *)); +#endif /* _SEQUENT_ */ #ifdef NO_LSTAT #define lstat stat #else @@ -375,7 +379,7 @@ posix_nice(self, args) } #endif -#ifdef i386 +#if i386 && ! _SEQUENT_ int rename(from, to) char *from; @@ -388,7 +392,7 @@ rename(from, to) return status; return unlink(from); } -#endif /* i386 */ +#endif /* i386 && ! _SEQUENT_ */ static object * posix_rename(self, args) @@ -833,7 +837,6 @@ posix_times(self, args) { struct tms t; clock_t c; - object *tuple; if (!getnoarg(args)) return NULL; errno = 0; @@ -842,18 +845,11 @@ posix_times(self, args) err_errno(PosixError); return NULL; } - tuple = newtupleobject(4); - if (tuple == NULL) - return NULL; - settupleitem(tuple, 0, newfloatobject((double)t.tms_utime / HZ)); - settupleitem(tuple, 1, newfloatobject((double)t.tms_stime / HZ)); - settupleitem(tuple, 2, newfloatobject((double)t.tms_cutime / HZ)); - settupleitem(tuple, 3, newfloatobject((double)t.tms_cstime / HZ)); - if (err_occurred()) { - DECREF(tuple); - return NULL; - } - return tuple; + return mkvalue("dddd", + (double)t.tms_utime / HZ, + (double)t.tms_stime / HZ, + (double)t.tms_cutime / HZ, + (double)t.tms_cstime / HZ); } #endif /* DO_TIMES */ |