unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

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



setregid(2)							  setregid(2)



NAME

  setregid - Sets the real and effective group ID

SYNOPSIS

  #include <&lt;unistd.h>&gt;

  setregid(
	  gid_t	rgid,
	  gid_t	egid );

STANDARDS

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

  setregid():  XPG4-UNIX

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

PARAMETERS

  rgid	    Specifies the new real group ID.

  egid	    Specifies the new effective	group ID.

DESCRIPTION

  The setregid() function sets the real	group ID of the	current	process	to
  the value specified by the rgid parameter, and sets the effective group ID
  to the value specified by the	egid parameter.	 If the	value of rgid is -1,
  the real group ID is not changed; if the value of egid is -1,	the effective
  group	ID is not changed.  The	real and effective group IDs may be set	to
  different values in the same call.

  Unprivileged users may change	the effective group ID to the real group ID;
  only the superuser may make other changes.

  Any supplementary group IDs of the calling process remain unchanged.

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 setregid() function sets errno to	the specified values for the follow-
  ing conditions:


  [EINVAL]  The	value of the rgid egid parameter is invalid or out of range.

  [EPERM]   The	current	process	does not have superuser	privilege and a
	    change other than changing the effective group ID to the real
	    group ID was specified.

RELATED	INFORMATION

  Functions: getgid(2),	setgid(2), setrgid(3), setreuid(2)

  Standards: standards(5)