xref: /csrg-svn/lib/libc/compat-43/setruid.3 (revision 60986)
1*60986Sbostic.\" Copyright (c) 1983, 1991, 1993
2*60986Sbostic.\"	The Regents of the University of California.  All rights reserved.
358276Smckusick.\"
458276Smckusick.\" %sccs.include.redist.man%
558276Smckusick.\"
6*60986Sbostic.\"     @(#)setruid.3	8.1 (Berkeley) 06/02/93
758276Smckusick.\"
858276Smckusick.Dd
958276Smckusick.Dt SETRUID 3
1058276Smckusick.Os BSD 4.2
1158276Smckusick.Sh NAME
1258276Smckusick.Nm setruid ,
1358276Smckusick.Nm setrgid
1458276Smckusick.Nd set user and group ID
1558276Smckusick.Sh SYNOPSIS
1658276Smckusick.Fd #include <sys/types.h>
1758276Smckusick.Ft int
1858276Smckusick.Fn setruid "uid_t ruid"
1958276Smckusick.Ft int
2058276Smckusick.Fn setrgid "gid_t rgid"
2158276Smckusick.Sh DESCRIPTION
2258276SmckusickThe
2358276Smckusick.Fn setruid
2458276Smckusickfunction
2558276Smckusick.Pq Fn setrgid
2658276Smckusicksets the real user ID (group ID) of the
2758276Smckusickcurrent process.
2858276Smckusick.Sh RETURN VALUES
2958276SmckusickUpon success, these functions return 0;
3058276Smckusickotherwise \-1 is returned.
3158276Smckusick.Pp
3258276SmckusickIf the user is not the super user, or the uid
3358276Smckusickspecified is not the real or effective ID, these
3458276Smckusickfunctions return \-1.
3558276Smckusick.Pp
3658276SmckusickThe use of these calls is not portable.
3758276SmckusickTheir use is discouraged; they will be removed in the future.
3858276Smckusick.Sh SEE ALSO
3958276Smckusick.Xr setuid 2 ,
4058276Smckusick.Xr setgid 2 ,
4158276Smckusick.Xr seteuid 2 ,
4258276Smckusick.Xr setegid 2 ,
4358276Smckusick.Xr getuid 2 ,
4458276Smckusick.Xr getgid 2
4558276Smckusick.Sh HISTORY
4658276SmckusickThe
4758276Smckusick.Fn setruid
4858276Smckusickand
4958276Smckusick.Fn setrgid
5058276Smckusicksyscalls appeared in
5158276Smckusick.Bx 4.2
5258276Smckusickand were dropped in
5358276Smckusick.Bx 4.4 .
54