qsysetuid()--Set User ID


  Syntax
 #include <qsysetid.h>    

 int qsysetuid(uid_t uid);
  Service Program Name: QSYSETIDS

  Default Public Authority: *USE

  Threadsafe: Yes

If the thread has *ALLOBJ special authority, qsysetuid() sets the real, effective, and saved user ID to uid.

If the thread does not have *ALLOBJ special authority, but uid is equal to the real, effective or saved user ID, qsysetuid() sets the effective user ID to uid. The real and saved user IDs 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

uid
(Input) User ID.

This field must contain one of the following values:

0 to 4294967294
The user ID value for the set operation.

Authorities and Locks

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

Return Value

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

Error Conditions

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



API introduced: V4R5

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