setregid(2) System Calls Manual setregid(2)Name
setregid - set real and effective group ID
int rgid, egid;
The real and effective group ID's of the current process are set to the arguments.
Supplying a value of -1 for either the real or effective group ID forces the system to substitute the current ID for the -1 parameter.
If the process is superuser, or and matches with the real group ID, the effective group ID, or the saved set-group-id (as described in ),
then the real, effective, and saved set-group-id are set to and respectively.
When your program is compiled in POSIX or SYSTEM-FIVE mode, the following semantics apply when using the function.
If the process is the superuser, the real, effective, and saved set-group-id (as described in ) are set to and respectively.
If the process is not the superuser, but the and matches the real group ID, the effective group ID (only in SYSTEM-FIVE and BSD environ-
ment), or the saved set-group-id, then the effective ID is set to The real group ID and the saved set-group-id are left unchanged.
Upon successful completion, a value of zero (0) is returned. Otherwise, a value of -1 is returned, and errno is set to indicate the error.
[EPERM] The current process is not the superuser and the and specified does not match with the real group ID or the effective group
ID (only in SYSTEM-FIVE and BSD environment) or the saved set-group-id.
See Alsogetgid(2), setreuid(2), setgid(3)setregid(2)
Check Out this Related Man Page
setregid(2) System Calls Manual setregid(2)NAME
setregid - sets the real and effective group IDs
sets the real and effective group IDs of the calling process.
Only a privileged process can set the real group ID and/or the effective group ID to any valid value. A nonprivileged process can set the
real group ID to the saved set-group-ID from one of the exec family of functions, or the effective group ID to either the saved set-group-
ID or the real group ID.
Any supplementary group IDs of the calling process remain unchanged.
Argument rgid is the read group ID value to be set with. If rgid is set to the real group ID is not be changed.
Argument egid is the effective group ID value to be set with. If egid is set to -1, the effective group ID is not changed.
The real and effective group IDs may be set to different values in the same call.
Some or all of the actions associated with this system call require the privilege (CHSUBJIDENT). Processes owned by the superuser will
have this privilege. Processes owned by other users may have this privilege, depending on system configuration.
See privileges(5) for more information about privileged access on systems that support fine-grained privileges.
Upon successful completion is set to Otherwise, errno is set to indicate the type of error and neither group IDs are changed.
is set to one of the following values if the corresponding condition is detected.
The value of the
rgid or egid argument is invalid or out-of-range.
The process does NOT have all the appropriate privileges other
than to change the real group ID to the saved set-group-ID, or to change the effective group ID to either the real group ID
or the saved set-group-ID.
was developed by the University of California, Berkeley and HP.
SEE ALSO exec(2), geteuid(2), getgid(2), getuid(2), setegid(2), setgid(2), setreuid(2), setuid(2).
I am little new to unix programming. I need some help in the program I am working on. I am looking for some effective way to do this. I have few file process something like below:
. $COM/cat.ksh inquire file1 dat
if (( $? == 0 ))
... (6 Replies)
I am working on Anomaly based Network IDS...
Statistical based technique is simple but not quite effective in
I understand Bayesian classifier/Network is more effective in the
context of anomaly detection, but i have very little idea about Bayesian approach for... (0 Replies)
Just wondering whether if I execute the ps v 1818740 and I get the below ouput what column should I use If I need to calculate how much real memory (private) is use by those process. Thanks.
PID TTY STAT TIME PGIN SIZE RSS LIM TSIZ TRS %CPU %MEM COMMAND
... (1 Reply)
I'm searching the most effective way of doing the following task, so if someone can either provide a working solution with sed or one totally different but more effective then what I've got so far then please go ahead!
The debugme directory has 3 subdirectorys and each of them has one .txt file... (7 Replies)
THANKS UNIX SYSTEM®.I was found my job from UNIX®.I USE MONKEY WRENCH WITH WARTER.I am now studying my studio with UNIX SYSTEM®.
THANKS UNIX SYSTEM®.
THANKS OUR OPEN GROUP.
from Takayasu Sakashita.My name is Takayasu Sakashita.
I respect you.
Your friend TAKA.Good... (1 Reply)