zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Richard Curnow <Richard.Curnow@st.com>, zsh-users@sunsite.dk
Subject: Re: Zsh Guide chapter 5 (substitutions)
Date: Tue, 21 Aug 2001 15:34:21 +0000	[thread overview]
Message-ID: <1010821153422.ZM21739@candle.brasslantern.com> (raw)
In-Reply-To: <20010821152154.A8668@popov.bri.st.com>

On Aug 21,  3:21pm, Richard Curnow wrote:
}
} On page 74, 2nd para from the end,
} 
}   It seems a bit odd to signal a process to restart; why can't the
}   operating system just restart it when you ask? The real answer is
}   probably that signals provide an easy way for you to talk to the
}   operating system without grovelling around in the dirt too much.
} 
} I think it's to provide a way for a process to save and restore state
} across the suspension, by installing handlers for SIGTSTP and SIGCONT.

Saving and restoring state is one reason that there are four signals to
stop a process (STOP, TSTP, TTIN, TTOU).  However, it's not the reason
that a signal is used for SIGCONT; Peter's more on target with that one.

There's no such thing as a SIGCONT handler, by the way.  The process
just picks up where it left off (possibly with system calls interrupted
depending on the operating system).  A typical TSTP handler looks like

    save_state();
    kill(getpid(), SIGSTOP);	/* STOP is not catchable */
    restore_state();

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


  reply	other threads:[~2001-08-21 15:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-15 23:00 Peter Stephenson
2001-08-16  2:31 ` Bart Schaefer
2001-08-17 16:55 ` Bart Schaefer
2001-08-20 18:26 ` Bart Schaefer
2001-08-20 18:35   ` Phil Pennock
2001-08-21 16:38   ` Bart Schaefer
2001-08-21 14:21 ` Richard Curnow
2001-08-21 15:34   ` Bart Schaefer [this message]
2001-08-22 17:10 martin.ebourne
2001-08-23  7:30 ` Borsenkow Andrej
2001-08-23  7:41   ` Borsenkow Andrej

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1010821153422.ZM21739@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=Richard.Curnow@st.com \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).