Along with the os module's get functions are the set functions. Many of the set functions complement the get functions, and one need usually only change the first letter. Most of the system calls are available only on Unix-like platforms, however some may be used on Windows, too.
- setgroups(groups): Set the group access list of the current process. The argument groups is a sequence of integers specifying group identifiers. As this call involves administrative permissions, it can only be called as the root or administrative user on a Unix-like system.
- setgid(gid): Sets the group ID of the current process.
- setpgrp(): Creates a new process group. Where implemented, it functions by passing a system call of either setpgrp() or setpgrp(0, 0). It then returns the ID of the new group.
- setpgid(pid, pgrp): Assigns process ID pid to process group pgrp. If both are equal, the process becomes the process leader for the group. If unequal, the process is added to an existing group. Where 0 is used for pid, the current process is used. If 0 is used for pgrp, the process specified by pid becomes a process group leader.
- setreuid(ruid, euid): Sets the real and effective user ID of the calling process.
- setregid(rgid, egid): Sets the real and effective group ID of the calling process.
- setsid(): Creates a new session and returns its session ID. Session IDs are typically used for terminal devices and may be used to administer the jobs created within them.
- setuid(uid): Sets the real user ID of the current process. Usually, this system call requires administrative (root) privileges.
