01.01.2013 Views

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

SETUID ( 2 ) SETUID ( 2 )<br />

NAME<br />

setuid, setgid - set user and group IDs<br />

SYNOPSIS<br />

int setuid (uid)<br />

int uid;<br />

int setgid (gid)<br />

int gid;<br />

DESCRIPTION<br />

Setuid ( setgid ) is used to set the real user (group) ID and effective<br />

user (group) ID of the calling process.<br />

If the effective user ID of the calling process is super-user, the real<br />

user (group) ID and effective user (group) ID are set to uid (gid).<br />

If the effective user ID of the calling process is not super-user, but<br />

its real user (group) ID is equal to uid (gid), the effective user<br />

(group) ID is set to uid (gid).<br />

Setuid ( setgid) will fail if the real user (group) ID of the calling<br />

process is not equal to uid (gid) and its effective user ID is not<br />

super-user. ]EPERM]<br />

RETURN VALUE<br />

Upon successful completion, a value of 0 is returned. Otherwise, a<br />

value of -1 is returned and errno is set to indicate the error.<br />

SEE ALSO<br />

getuid(2), intro(2).<br />

- 1 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!