summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-05-15 11:05:24 (GMT)
committerGuido van Rossum <guido@python.org>1992-05-15 11:05:24 (GMT)
commit46003ff66a76d382cfff09b64933f382c64fa207 (patch)
treefca09e4ae80779424048cd7c2e5efe1f030515b4 /Modules/posixmodule.c
parent899dcf36a04a401381fbfdcc3e355010543dc3c3 (diff)
downloadcpython-46003ff66a76d382cfff09b64933f382c64fa207.zip
cpython-46003ff66a76d382cfff09b64933f382c64fa207.tar.gz
cpython-46003ff66a76d382cfff09b64933f382c64fa207.tar.bz2
Added gete?[gu]id functions
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r--Modules/posixmodule.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 992147f..8ae1758 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -551,6 +551,36 @@ posix_fork(self, args)
}
static object *
+posix_getegid(self, args)
+ object *self;
+ object *args;
+{
+ if (!getnoarg(args))
+ return NULL;
+ return newintobject((long)getegid());
+}
+
+static object *
+posix_geteuid(self, args)
+ object *self;
+ object *args;
+{
+ if (!getnoarg(args))
+ return NULL;
+ return newintobject((long)geteuid());
+}
+
+static object *
+posix_getgid(self, args)
+ object *self;
+ object *args;
+{
+ if (!getnoarg(args))
+ return NULL;
+ return newintobject((long)getgid());
+}
+
+static object *
posix_getpid(self, args)
object *self;
object *args;
@@ -585,6 +615,16 @@ posix_getppid(self, args)
}
static object *
+posix_getuid(self, args)
+ object *self;
+ object *args;
+{
+ if (!getnoarg(args))
+ return NULL;
+ return newintobject((long)getuid());
+}
+
+static object *
posix_kill(self, args)
object *self;
object *args;
@@ -768,9 +808,13 @@ static struct methodlist posix_methods[] = {
{"_exit", posix__exit},
{"exec", posix_exec},
{"fork", posix_fork},
+ {"getegid", posix_getegid},
+ {"geteuid", posix_geteuid},
+ {"getgid", posix_getgid},
{"getpid", posix_getpid},
{"getpgrp", posix_getpgrp},
{"getppid", posix_getppid},
+ {"getuid", posix_getuid},
{"kill", posix_kill},
{"popen", posix_popen},
{"wait", posix_wait},