NAME
setreuid - set real and effective user ID

The real and effective user ID's of the current process are set to the arguments. Unprivileged users may change the real user ID to the effective user ID and vice-versa; only the super-user may make other changes. Supplying a value of -1 for either the real or effective user ID forces the system to substitute the current ID in place of the -1 parameter. In Linux 0.99.11, unprivileged users may change the real user ID to the effective uid or vice versa. (BSD-style) When you set the effective uid, it sets the saved uid too. This makes it possible for a setuid program to completely drop its privileges, which is often a useful assertion to make when you are doing a security audit over a program. The general idea is that a program which uses just will be 100% compatible with BSD. A program which uses just will be 100% compatible with POSIX w/ Saved ID's. On success, zero is returned. On error, -1 is returned, and is set appropriately. The current process is not the super-user and a change other than changing the effective user-id to the real user-id was specified. The function call appeared in BSD 4.2. BSD 4.3