#include <sys/types.h> #include <unistd.h> uid_t geteuid(void);
geteuid
determines the effective user ID of the calling process.
geteuid
returns the effective user ID of the calling
process.
Under
unusual conditions (for instance, if OpenEdition is not running)
getegid
can fail. In this case, geteuid
issues an MVS user ABEND 1230
to indicate the error.
geteuid
to determine the effective user ID of a calling process:
#include <sys/types.h> #include <unistd.h> #include <stdio.h> main() { uid_t uid, euid; uid = getuid(); euid = geteuid(); printf("The effective user id is %dn", (int) geteuid()); printf("The real user id is %dn", (int) getuid()); if (uid == euid) printf("Effective user id and Real user id are the samen"); }
getegid
, getuid
, seteuid
, setuid
Copyright (c) 1998 SAS Institute Inc. Cary, NC, USA. All rights reserved.