summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-09-29 09:50:09 (GMT)
committerGuido van Rossum <guido@python.org>1994-09-29 09:50:09 (GMT)
commit14ed0b2cd3d814874b7ce03201fd4b634dbec63e (patch)
treef8d466be2ad5f1da7ed12141cf90f9a96a265c82 /Modules/posixmodule.c
parent180d7b4d5588737601b3242d8ce9cab59a75286f (diff)
downloadcpython-14ed0b2cd3d814874b7ce03201fd4b634dbec63e.zip
cpython-14ed0b2cd3d814874b7ce03201fd4b634dbec63e.tar.gz
cpython-14ed0b2cd3d814874b7ce03201fd4b634dbec63e.tar.bz2
* 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.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 7ffcd66..59e27a7 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 *