diff options
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 */ |