SETRUID(3)
π SETRUID(3) β Library Functions Manual π
okay bestie, this is the glow-up of the SETRUID(3) manual page β same facts, way more group-chat energy. Letβs get into it β¨
πΈ NAME πΈ
setruid, setrgid β set user and group ID
π§ LIBRARY π§
Standard C Library (libc, -lc) β yes, she lives in libc, iconic behavior.
β¨ SYNOPSIS β¨
#include <unistd.h>
int
setruid(uid_t ruid);
int
setrgid(gid_t rgid);
π¦ DESCRIPTION π¦
The setruid() function (and setrgid(), her matching bestie) sets the real user ID (group ID) of the current process. lowkey straightforward, no cap.
π RETURN VALUES π
Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable errno is set to indicate the error. so if you see -1, check errno β sheβs trying to tell you something π
β οΈ COMPATIBILITY β οΈ
Heads up, bestie: The use of these calls is not portable. Their use is discouraged; they will be removed in the future. not a drill, fr fr π
π¨ ERRORS π¨
The functions fail if:
[EPERM]β The user is not the super user and the ID specified is not the real or effective ID.
π SEE ALSO π
getgid(2), getuid(2), setegid(2), seteuid(2), setgid(2), setuid(2) β go read the whole squad π«Ά
π HISTORY π
The setruid() and setrgid() syscalls appeared in 4.2BSD and were dropped in 4.4BSD. historical icons, honestly π
Source/version + date moment: this page is from Debian, dated June 2, 1993, and the manual page is SETRUID(3). mwah πβ¨
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 1983, 1991, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms