POSIX_GETEGID(3) 1 POSIX_GETEGID(3)posix_getegid - Return the effective group ID of the current processSYNOPSIS
int posix_getegid (void )
DESCRIPTION
Return the numeric effective group ID of the current process.
RETURN VALUES
Returns an integer of the effective group ID.
EXAMPLES
Example #1
posix_getegid(3) example
This example will print out the effective group id, once it is changed with posix_setegid(3).
<?php
echo 'My real group id is '.posix_getgid(); //20
posix_setegid(40);
echo 'My real group id is '.posix_getgid(); //20
echo 'My effective group id is '.posix_getegid(); //40
?>
NOTES posix_getegid(3) is different than posix_getgid(3) because effective group ID can be changed by a calling process using posix_setegid(3).
SEE ALSO posix_getgrgid(3), posix_getgid(3), posix_setgid(3).
PHP Documentation Group POSIX_GETEGID(3)
Check Out this Related Man Page
setregid(2) System Calls setregid(2)NAME
setregid - set real and effective group IDs
SYNOPSIS
#include <unistd.h>
int setregid(gid_t rgid, gid_t egid);
DESCRIPTION
The setregid() function is used to set the real and effective group IDs of the calling process. If rgid is -1, the real group ID is not
changed; if 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.
If the {PRIV_PROC_SETID} privilege is asserted in the effective set of the calling process, the real group ID and the effective group ID
can be set to any legal value.
If the {PRIV_PROC_SETID} privilege is not asserted in the effective set of the calling process, either the real group ID can be set to the
saved set-group-ID from execve(2), or the effective group ID can either be set to the saved set-group-ID or the real group ID.
In either case, if the real group ID is being changed (that is, if rgid is not -1), or the effective group ID is being changed to a value
not equal to the real group ID, the saved set-group-ID is set equal to the new effective group ID.
RETURN VALUES
Upon successful completion, 0 is returned. Otherwise, -1 is returned, errno is set to indicate the error, and neither of the group IDs will
be changed.
ERRORS
The setregid() function will fail if:
EINVAL The value of rgid or egid is less than 0 or greater than UID_MAX (defined in <limits.h>).
EPERM The {PRIV_PROC_SETID} privilege is not asserted in the effective set of the calling processes and a change was specified
other than changing the real group ID to the saved set-group-ID or changing the effective group ID to the real group ID or
the saved group ID.
USAGE
If a set-group-ID process sets its effective group ID to its real group ID, it can still set its effective group ID back to the saved set-
group-ID.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO execve(2), getgid(2), setreuid(2), setuid(2), attributes(5), privileges(5), standards(5)SunOS 5.10 22 Mar 2004 setregid(2)
Is there any way that I can mailx to a distribution list without having a $HOME/.mailrc file?
We have a distribution list in Outlook for our group say group@something.com.
I am trting to do echo "Something"|mailx -s "Subject" group@something.com
it doesnt work
Any ideas?
Thanks (1 Reply)
Hi all,
I want transfer the echo data into file.txt.how?
echo " $dir $group " >> ${file.txt}
---------- Post updated at 04:11 PM ---------- Previous update was at 03:10 PM ----------
anybody can help ?
i mean in script output like
echo " hello"
i want transfer that output to file.txt. (4 Replies)
Hi,
I have 2 input files:
File 1:
echo Name > create_Name.txt
echo Group /dir/group, Name >> create_Name.txt
File 2:
Name AAA BBB CCC
group A B C
dir A1 B1 C1
................................
Need to replace the contents of File 1 with column 2, 3 & 4 values of File 2... (8 Replies)