![]() Chapter Contents |
![]() Previous |
![]() Next |
| geteuid |
| Portability: | POSIX.1 conforming, UNIX compatible |
| SYNOPSIS | |
| DESCRIPTION | |
| RETURN VALUE | |
| EXAMPLE | |
| RELATED FUNCTIONS |
| SYNOPSIS |
#include <sys/types.h> #include <unistd.h> uid_t geteuid(void);
| DESCRIPTION |
geteuid
determines the effective user ID of the calling process.
| RETURN VALUE |
If successful,
geteuid
returns the effective user ID of the calling process. Under
unusual conditions (for instance, if USS is not running)
getegid
can fail. In this case,
geteuid
issues an OS/390 user ABEND 1230 to indicate
the error.
| EXAMPLE |
The following code fragment illustrates
the use of
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 %d\n", (int) geteuid());
printf("The real user id is %d\n", (int) getuid());
if (uid == euid)
printf("Effective user id and Real user id are the samen");
}
| RELATED FUNCTIONS |
getegid
,
getuid
,
seteuid
,
setuid
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.