*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->FreeBSD man pages -> setruid (3)              



NAME    [Toc]    [Back]

     setruid, setrgid -- set user and group ID

LIBRARY    [Toc]    [Back]

     Standard C Library (libc, -lc)

SYNOPSIS    [Toc]    [Back]

     #include <unistd.h>

     setruid(uid_t ruid);

     setrgid(gid_t rgid);

DESCRIPTION    [Toc]    [Back]

     The setruid() function (setrgid()) sets the real user ID (group ID) of
     the current process.

RETURN VALUES    [Toc]    [Back]

     Upon successful completion, the value 0 is returned; otherwise the
     value -1 is returned and the global variable errno is set to indicate the

ERRORS    [Toc]    [Back]

     The functions fail if:

     [EPERM]		The user is not the super user and the ID specified is
			not the real or effective ID.

COMPATIBILITY    [Toc]    [Back]

     The use of these calls is not portable.  Their use is discouraged; they
     will be removed in the future.

SEE ALSO    [Toc]    [Back]

     getgid(2), getuid(2), setegid(2), seteuid(2), setgid(2), setuid(2)

HISTORY    [Toc]    [Back]

     The setruid() and setrgid() syscalls appeared in 4.2BSD and were dropped
     in 4.4BSD.

FreeBSD 5.2.1			 June 2, 1993			 FreeBSD 5.2.1
[ Back ]
 Similar pages
Name OS Title
setuid IRIX set user and group IDs
setgid HP-UX set user and group IDs
seteuid IRIX set user and group IDs
setuid HP-UX set user and group IDs
group Linux user group file
adduser Linux add a user or group to the system
id IRIX print the user name and ID, and group name and ID
seteuid Linux set effective user or group ID
cd_idmap Tru64 sets or gets mappings of User and Group IDs on
getegid HP-UX get real user, effective user, real group, and effective group IDs
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service