qsysetgid()--Set Group ID


  Syntax
 #include <qsysetid.h>    

 int qsysetgid(gid_t gid);  
  Service Program Name: QSYSETIDS

  Default Public Authority: *USE

  Threadsafe: Yes

If the thread has *ALLOBJ special authority, qsysetgid() sets the real, effective and saved groups to gid.

If the thread does not have *ALLOBJ special authority, but gid is equal to the real, effective or saved group IDs, the qsysetgid() function sets the effective group ID to gid. The real group and saved group IDs remain unchanged.

Any supplementary group IDs of the calling thread remain unchanged.

Job scoped locks with a lock state of *SHRRD are held on the user profiles associated with the real user ID, effective user ID, saved user ID, real group ID, effective group ID, saved group ID, and all of the supplemental groups.


Parameters

gid
(Input) Group ID.

This field must contain one of the following values:

0
There is no group ID. The effective group ID can be set to 0 only if there are no supplemental groups.
1 to 4294967294
The group ID value for the set operation.

Authorities and Locks

*ALLOBJ special authority
*ALLOBJ special authority is required if gid is not equal to the real, effective or saved group ID.
User profile associated with gid lock
*SHRRD

Return Value

0
qsysetgid() was successful.
-1
qsysetgid() was not successful. errno is set to indicate the error.

Error Conditions

If qsysetgid() is not successful, errno indicates one of the following errors.



API introduced: V4R5

[ Back to top | UNIX-Type APIs | APIs by category ]