tcsetsid
(void)tcsetsid(STDIN_FILENO, rootpid);
int tcsetsid(int, pid_t);
if (tcsetsid(fd, s) == -1)
error = tcsetsid(STDIN_FILENO, sid);