Copyright (c) 2000 Sheldon Hearn. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/...
NAMEgetresgid getresuid setresgid setresuid - get or set real, effective and saved user or group ID
SYNOPSISIn sys/types.h In unistd.h Ft int Fn getresgid gid_t *rgid gid_t *egid gid_t *sgid Ft int Fn getresuid uid_t *ruid uid_t *euid uid_t *suid Ft int Fn setresgid gid_t rgid gid_t egid gid_t sgid Ft int Fn setresuid uid_t ruid uid_t euid uid_t suid
DESCRIPTIONThe Fn setresuid system call sets the real, effective and saved user IDs of the current process. The analogous Fn setresgid sets the real, effective and saved group IDs.
Privileged processes may set these IDs to arbitrary values. Unprivileged processes are restricted in that each of the new IDs must match one of the current IDs.
Passing -1 as an argument causes the corresponding value to remain unchanged.
The Fn getresgid and Fn getresuid calls retrieve the real, effective, and saved group and user IDs of the current process, respectively.
RETURN VALUESRv -std
- Bq Er EPERM
- The calling process was not privileged and tried to change one or more IDs to a value which was not the current real ID, the current effective ID nor the current saved ID.
- Bq Er EFAULT
- An address passed to Fn getresgid or Fn getresuid was invalid.