help / color / mirror / Atom feed
* Confused by SIGCONT sent to running processes
@ 2020-06-24  7:49 Roman Perepelitsa
  0 siblings, 0 replies; only message in thread
From: Roman Perepelitsa @ 2020-06-24  7:49 UTC (permalink / raw)
  To: Zsh hackers list

Consider the following command:

  ( foo | bar )

As soon as foo or bar exits, zsh sends SIGCONT to the remaining
running process. If there are N processes in the pipeline, zsh sends
SIGCONT to all running processes after one of the processes exits. I'm
wondering about the purpose of sending SIGCONT to running jobs here.

SIGCONT is sent from these lines in zwaitjob:

  if (subsh)
      killjb(jn, SIGCONT);

killjb sends the specified signal (SIGCONT in this case) to all
processes in the job that have been stopped or are running. Here's the
check from killjb:

  if (pn->status == SP_RUNNING || WIFSTOPPED(pn->status)) {

I could understand sending SIGCONT to stopped jobs but why send it to
running jobs? Also, why is it conditional on subsh?


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-24  7:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-24  7:49 Confused by SIGCONT sent to running processes Roman Perepelitsa


This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/zsh-workers

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 zsh-workers zsh-workers/ http://inbox.vuxu.org/zsh-workers \
	public-inbox-index zsh-workers

Example config snippet for mirrors.
Newsgroup available over NNTP:

code repositories for the project(s) associated with this inbox:


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git