summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-06-28 18:55:32 (GMT)
committerGuido van Rossum <guido@python.org>1996-06-28 18:55:32 (GMT)
commitc012547142cfa91192f562ea0204fcf6f5275708 (patch)
tree680f9f6855ba61b747f3e1e5966099641e23d9ca /Modules
parentcd6aab91a5fb9607ba8b731f906c5738a2409384 (diff)
downloadcpython-c012547142cfa91192f562ea0204fcf6f5275708.zip
cpython-c012547142cfa91192f562ea0204fcf6f5275708.tar.gz
cpython-c012547142cfa91192f562ea0204fcf6f5275708.tar.bz2
Added plock() system call.
Changed test for Windows times() emulation.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/posixmodule.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 16bfe09..e843cfe 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -1060,6 +1060,27 @@ posix_kill(self, args)
}
#endif
+#ifdef HAVE_PLOCK
+
+#ifdef HAVE_SYS_LOCK_H
+#include <sys/lock.h>
+#endif
+
+static object *
+posix_plock(self, args)
+ object *self;
+ object *args;
+{
+ int op;
+ if (!getargs(args, "i", &op))
+ return NULL;
+ if (plock(op) == -1)
+ return posix_error();
+ INCREF(None);
+ return None;
+}
+#endif
+
#ifdef HAVE_POPEN
static object *
posix_popen(self, args)
@@ -1220,7 +1241,7 @@ posix_times(self, args)
(double)c / HZ);
}
#endif /* HAVE_TIMES */
-#if defined(MS_WIN32) && !defined(HAVE_TIMES)
+#if defined(_MSC_VER) && _MSC_VER > 850
#define HAVE_TIMES /* so the method table will pick it up */
static object *
posix_times(self, args)
@@ -1645,6 +1666,9 @@ static struct methodlist posix_methods[] = {
#ifdef HAVE_KILL
{"kill", posix_kill},
#endif /* HAVE_KILL */
+#ifdef HAVE_PLOCK
+ {"plock", posix_plock},
+#endif /* HAVE_PLOCK */
#ifdef HAVE_POPEN
{"popen", posix_popen, 1},
#endif /* HAVE_POPEN */