Psetreuid()

LONG Psetreuid(ruid, euid)

WORD ruid;
WORD euid;
Psetreuid() sets the real and/or effective user id for the calling process.
Opcode334 (0x014e)
AvailabilityAvailable when a 'MiNT' cookie with a version of at least 1.12 exists.
Parametersruid specifies the new real user id and euid specifies the new effective user id for the calling process. If either argument is -1, only the other gets changed.
Binding
move.w	euid,-(sp)
move.w	ruid,-(sp)
move.w	#$014e,-(sp)
trap	#1
addq.l	#6,sp
Return ValuePsetreuid() returns E_OK on success or a negative GEMDOS error code otherwise.
CaveatsSetting user ids needs root privileges.
CommentsThis call is often used by daemon processes to downgrade their privileges to user level.
See Also Psetregid(), Pseteuid()