2008 May 30 Friday (五月 三十日 金曜日)

来源:互联网 发布:苹果手机界面设计软件 编辑:程序博客网 时间:2024/05/01 16:10
#include <unistd.h>  pid_t setsid(void);    setsid()  creates  a new session if the calling process is not a process group leader.  The calling process is theleader of the new session, the process group leader of the new process group, and has no controlling tty.  The processgroup ID and session ID of the calling process are set to the PID of the calling process.  The calling process will bethe only process in this new process group and in this new session.  #include <unistd.h>  pid_t tcgetpgrp(int fd);  int tcsetpgrp(int fd, pid_t pgrp);  The function tcgetpgrp() returns the process group ID of the foreground process group on the terminal associated tofd, which must be the controlling terminal of the calling process.  The function tcsetpgrp() makes the process group with process group ID pgrp the foreground process group on the terminalassociated to fd, which must be the controlling terminal of the calling process, and still be associated with its session.Moreover, pgrp must be a (nonempty) process group belonging to the same session as the calling process.  If tcsetpgrp() is called by a member of a background process group in its session, and the calling process is not blockingor ignoring SIGTTOU, a SIGTTOU signal is sent to all members of this background process group.
原创粉丝点击