]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added gete?[gu]id functions
authorGuido van Rossum <guido@python.org>
Fri, 15 May 1992 11:05:24 +0000 (11:05 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 15 May 1992 11:05:24 +0000 (11:05 +0000)
Modules/posixmodule.c

index 992147fc74c8ba955e4e60d6430bd9d53e648b83..8ae1758fe353c989e9a7d50168928c6a51d8830c 100644 (file)
@@ -550,6 +550,36 @@ posix_fork(self, args)
        return newintobject((long)pid);
 }
 
+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;
@@ -584,6 +614,16 @@ posix_getppid(self, args)
        return newintobject((long)getppid());
 }
 
+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;
@@ -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},