linux process group

man setpgrp

 

...

 

NOTES

       A child created via fork(2) inherits its parent?. process group ID.  The PGID is preserved across an execve(2).

 

       Each process group is a member of a session and each process is a member of the session of which its process group is a member.

 

       A session can have a controlling terminal.  At any time, one (and only one) of the process groups in the session can be the foreground process group for the  termi?

       nal;  the remaining process groups are in the background.  If a signal is generated from the terminal (e.g., typing the interrupt key to generate SIGINT), that sig?

       nal is sent to the foreground process group.  (See termios(3) for a description of the characters that generate signals.)  Only the  foreground  process  group  may

       read(2)  from  the  terminal;  if  a  background  process group tries to read(2) from the terminal, then the group is sent a SIGTSTP signal, which suspends it.  The

       tcgetpgrp(3) and tcsetpgrp(3) functions are used to get/set the foreground process group of the controlling terminal.

 

       The setpgid() and getpgrp() calls are used by programs such as bash(1) to create process groups in order to implement shell job control.

 

       If a session has a controlling terminal, and the CLOCAL flag for that terminal is not set, and a terminal hangup occurs, then the session leader is sent  a  SIGHUP.

       If the session leader exits, then a SIGHUP signal will also be sent to each process in the foreground process group of the controlling terminal.

 

       If  the  exit  of the process causes a process group to become orphaned, and if any member of the newly orphaned process group is stopped, then a SIGHUP signal fol?

       lowed by a SIGCONT signal will be sent to each process in the newly orphaned process group.

...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值