Chapter Contents

Previous

Next
setreuid

setreuid



Set Real and/or Effective user ID

Portability: UNIX compatible


SYNOPSIS
DESCRIPTION
RETURN VALUE
USAGE NOTES
EXAMPLE
RELATED FUNCTIONS


SYNOPSIS

#include <sys/types.h>
#include <unistd.h>
int setreuid(uid_t realuid, uid_t effuid);


DESCRIPTION

The setreuid function is used to set the real and/or the effective user ids for the calling process. A superuser or daemon process has the ability to set any valid user id. Other processes are limited in their use of setreuid .

Note:   See the IBM UNIX System Services Assembler Callable Services publication, SC28-2899, for more information on the use of setreuid by unprivileged processes.  [cautionend]
The realuid argument to setreuid specifies the new real user id. If realuid is specified as -1 , the real user id is unchanged. The effuid argument to setreuid specifies the new effective user id. If effuid is specified as -1 , the effective user id is unchanged.


RETURN VALUE

setreuid returns 0 if successful, or -1 if unsuccessful.


USAGE NOTES

The setreuid function can only be used with MVS 5.2.2 or a later release.


EXAMPLE

Refer to setregid for an example that demonstrates the use of the UNIX System Services functions setregid() and setreuid() .


RELATED FUNCTIONS

geteuid , getuid , seteuid , setuid


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.