diff options
| author | Guido van Rossum <guido@python.org> | 1994-09-29 09:50:09 +0000 |
|---|---|---|
| committer | Guido van Rossum <guido@python.org> | 1994-09-29 09:50:09 +0000 |
| commit | 14ed0b2cd3d814874b7ce03201fd4b634dbec63e (patch) | |
| tree | f8d466be2ad5f1da7ed12141cf90f9a96a265c82 /Modules/posixmodule.c | |
| parent | 180d7b4d5588737601b3242d8ce9cab59a75286f (diff) | |
| download | cpython-git-14ed0b2cd3d814874b7ce03201fd4b634dbec63e.tar.gz | |
* Modules/xxmodule.c: integrated with xxobject.c by Jack
* Modules/(posix,socket}module.c: more NT changes
Diffstat (limited to 'Modules/posixmodule.c')
| -rw-r--r-- | Modules/posixmodule.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 7ffcd660a7..59e27a7e7b 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -76,6 +76,11 @@ extern int symlink(); #include <utime.h> #endif /* HAVE_UTIME_H */ +#ifdef HAVE_SYS_UTIME_H +#include <sys/utime.h> +#define HAVE_UTIME_H /* pretend we do for the rest of this file */ +#endif /* HAVE_SYS_UTIME_H */ + #ifdef HAVE_SYS_TIMES_H #include <sys/times.h> #endif /* HAVE_SYS_TIMES_H */ @@ -1010,6 +1015,26 @@ posix_times(self, args) (double)t.tms_cstime / HZ); } #endif /* HAVE_TIMES */ +#ifdef NT +#define HAVE_TIMES /* so the method table will pick it up */ +static object * +posix_times(self, args) + object *self; + object *args; +{ + FILETIME create, exit, kernel, user; + HANDLE hProc; + if (!getnoarg(args)) + return NULL; + hProc = GetCurrentProcess(); + GetProcessTimes(hProc,&create, &exit, &kernel, &user); + return mkvalue("dddd", + (double)(kernel.dwHighDateTime*2E32+kernel.dwLowDateTime) / 2E6, + (double)(user.dwHighDateTime*2E32+user.dwLowDateTime) / 2E6, + (double)0, + (double)0); +} +#endif /* NT */ #ifdef HAVE_SETSID static object * |
