pid_t setsid(void);
Creates a new session for the current process by setting the process group ID to the current process ID. Returns the new process group ID.
getpgid, getpgrp, setpgid