setregid(2) System Calls Manual setregid(2)Name
setregid - set real and effective group ID
Syntax
setregid(rgid, egid)
int rgid, egid;
Description
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.
Environment
BSD
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.
POSIX
SYSTEM-FIVE
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.
Return Values
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.
Diagnostics
[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 ID
SYNOPSIS
#include <unistd.h>
setregid( gid_t rgid, gid_t egid );
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
setregid(): XPG4-UNIX
Refer to the standards(5) reference page for more information about industry standards and associated tags.
PARAMETERS
Specifies the new real group ID. Specifies the new effective group ID.
DESCRIPTION
The setregid() function sets the real group ID of the current process to the value specified by the rgid parameter, and sets the effective
group ID to the value specified by the egid parameter. If the value of rgid is -1, the real group ID is not changed; if the value of egid
is -1, the effective group ID is not changed. The real and effective group IDs may be set to different values in the same call.
Unprivileged users may change the effective group ID to the real group ID; only the superuser may make other changes.
Any supplementary group IDs of the calling process remain unchanged.
RETURN VALUES
Upon successful completion, a value of 0 (zero) is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.
ERRORS
The setregid() function sets errno to the specified values for the following conditions:
The value of the rgid egid parameter is invalid or out of range. The current process does not have superuser privilege and a change other
than changing the effective group ID to the real group ID was specified.
RELATED INFORMATION
Functions: getgid(2), setgid(2), setrgid(3), setreuid(2)
Standards: standards(5) delim off
setregid(2)
Hi,
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:
FLAG=0
$Process_Date="20060631"
. $COM/cat.ksh inquire file1 dat
if (( $? == 0 ))
then
... (6 Replies)
Hi there,
I am working on Anomaly based Network IDS...
Statistical based technique is simple but not quite effective in
real scenario...
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)
hi Guys,
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.
Austin.PEACE!Bey bey.
Your friend TAKA.Good... (1 Reply)