Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > S

seteuid(2)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

seteuid(), setegid() — set effective user and group IDs

SYNOPSIS

#include <unistd.h>

int seteuid(uid_t euid);

int setegid(gid_t egid);

DESCRIPTION

seteuid() sets the effective user ID of the calling process, if euid is equal to the current real or saved user ID, or if the process has appropriate privileges. The real user ID and saved set-user-ID remain unchanged.

setegid() sets the effective group ID of the calling process, if egid is equal to the current real or saved group ID, or if the process has appropriate privileges. The real group ID, saved set-group-ID and any supplementary group IDs remain unchanged.

RETURN VALUE

Upon successful completion, seteuid() and setegid() return 0; otherwise, they return -1 and set errno to indicate the error.

ERRORS

seteuid() and setegid() fail if any of the following conditions are encountered:

EINVAL

euid, or egid, is not a valid user or group ID.

EPERM

The process does not have appropriate privileges and euid/egid does not match the real use/group ID or the saved set-user-ID/set-group-ID.

AUTHOR

seteuid() and setegid() were developed by HP.

SEE ALSO

exec(2), getegid(2), geteuid(2), getuid(2), setregid(2), setresgid(2), setresuid(2), setreuid(2), setuid(2).

STANDARDS CONFORMANCE

seteuid(): UNIX 03

setegid(): UNIX 03

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.