unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (OSF1-V5.1-alpha)
Page:
Section:
Apropos / Subsearch:
optional field



setreuid(2)							  setreuid(2)



NAME
  setreuid - Sets real and effective user IDs

SYNOPSIS

  #include <&lt;unistd.h>&gt; setreuid(
	  uid_t	ruid,
	  uid_t	euid );

STANDARDS

  Interfaces documented	on this	reference page conform to industry standards
  as follows:

  setreuid:  XPG4-UNIX

  Refer	to the standards(5) reference page for more information	about indus-
  try standards	and associated tags.

PARAMETERS

  ruid	    Specifies the new real user	ID.

  euid	    Specifies the new effective	user ID.

DESCRIPTION

  The setreuid() function sets the real	and effective user IDs of the current
  process to the values	specified by the ruid and euid parameters.  If ruid
  or euid is -1, the corresponding effective or	real user ID of	the current
  process is not changed.

  Users	may change the effective user ID to the	real user ID; only processes
  with superuser privilege may make other changes.  This task is normally
  done by the system's authentication program (for example, login), but	is
  not done for system daemons.

RETURN VALUES

  Upon successful completion, a	value of 0 (zero) is returned.	Otherwise, a
  value	of -1 is returned and errno is set to indicate the error.

ERRORS

  The setreuid() function sets errno to	the specified values for the follow-
  ing conditions:

  [EINVAL]  The	value of the ruid or euid parameter is invalid or out of
	    range.

  [EPERM]   The	current	process	is not the superuser and a change other	than
	    changing the effective user	ID to the real user ID was specified.

RELATED	INFORMATION

  Functions: getuid(2),	setgid(2), setregid(2),	setruid(3)

  Standards: standards(5)