Re: Guaranteed Term Restore w/ atexit(3) No Good
From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 08/31/05
- Previous message: John Bokma: "Re: Jargons of Info Tech industry"
- In reply to: Rich Teer: "Re: Guaranteed Term Restore w/ atexit(3) No Good"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 31 Aug 2005 00:23:01 -0400
In article <Pine.SOL.4.58.0508300919000.12892@zen.rite-group.com>,
Rich Teer <rich.teer@rite-group.com> wrote:
> On Tue, 30 Aug 2005, Michael B Allen wrote:
>
> > Can someone suggest an alternative method to ensure that
> > "tcsetattr(STDIN_FILENO, TCSANOW, &restore);" is called when only the
> > parent process exits?
>
> Not a particularly clever way, but how about making note of your
> PID in the parent and then checking your PID in your exit handler,
> calling tcsetattr only when getpid() == saved_parent_pid?
A common technique is to call exit() only in the parent process, and
_exit() in the children.
-- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***
- Previous message: John Bokma: "Re: Jargons of Info Tech industry"
- In reply to: Rich Teer: "Re: Guaranteed Term Restore w/ atexit(3) No Good"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|