[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: LYNX-DEV Control-Z and SIGSTOP mysteries
From: |
Kari E. Hurtta |
Subject: |
Re: LYNX-DEV Control-Z and SIGSTOP mysteries |
Date: |
Sun, 18 May 1997 20:40:49 +0300 (EDT) |
Bela Lubkin:
> Klaus Weide wrote:
>
> > Ok, that encouraged me to look at the suspend issues more closely.
> > I am sure some unix guru (from the east or west coast or anywhere else)
> > would be more qualified...
> >
> > Here's one problem: do something that invoke a child process which
> > can be suspended with ^Z. For example, I have a PRINTER: which displays
> > the file with a shell command which invokes `less'. While in less,
> > I can suspend with ^Z. When I fg, both processes come alive (less and
> > lynx) and compete for the display and keyboard, which is a bit confusing
> > to say the least... This happens with curses, ncurses, and slang.
> >
> > I am experimenting with a LYSystem() wrapper to be used instead of
> > system(), which changes signal(SIGTSTP,...) before calling system().
> > This is of course only for unix - there already is something similar
> > for VMS. But there should be a better way than this - how do other
> > programs which use system() deal with it?
>
> Unix gurus from any coast agree: system() does not give the programmer
> enough control, and should only be used in one-off or prototype
> programs. For real use you should construct your own subprocess
> handling code out of the underlying fork(), exec(), wait() functions.
> One system() problem which is especially relevant to Lynx is that its
> underlying implementation varies from one Unix to another. These
> variations will show up particularly in areas like the signal handling
> anomalies you're experiencing.
>
> Any time Lynx is waiting on a subprocess, I believe it should be
> completely ignoring job control signals (SIGSTOP, SIGTSTP, SIGTTIN,
> SIGTTOU, SIGCONT). It should neither stop nor continue; it should
No. If it does not stop and you are on running some subprocess:
user hits Ctrl-Z
terminal driver deriver SIGTSTP foreground process group
subprocess and lynx gets SIGTSTP
subprocess stops
lynx continues waits to end subprocess
> shell does not see that lynx stops
it is still waiting that lynx either
stops or terminates
-> there is no process left which takes user input!
> That is hang from user point of view
> tenaciously wait for its child, nothing else. (The rules are very
> different for asynchronous subprocesses; but I can't think of any cases
> where Lynx uses one. Mailcap items such as "xv %s &" in mailcap do not
> count: as far as Lynx is concerned, they are synchronous; they detach
> *themselves* and live on after Lynx has finished launching them.)
;
; To UNSUBSCRIBE: Send a mail message to address@hidden
; with "unsubscribe lynx-dev" (without the
; quotation marks) on a line by itself.
;
- LYNX-DEV Control-Z and SIGSTOP mysteries, Klaus Weide, 1997/05/17
- Re: LYNX-DEV Control-Z and SIGSTOP mysteries, Foteos Macrides, 1997/05/17
- Re: LYNX-DEV Control-Z and SIGSTOP mysteries, Klaus Weide, 1997/05/17
- Re: LYNX-DEV Control-Z and SIGSTOP mysteries, Hiram Lester, Jr., 1997/05/18
- Re: LYNX-DEV Control-Z and SIGSTOP mysteries, Kari E. Hurtta, 1997/05/19
- Re: LYNX-DEV Control-Z and SIGSTOP mysteries, T.E.Dickey, 1997/05/19
- Re: LYNX-DEV Control-Z and SIGSTOP mysteries, Hiram Lester, Jr., 1997/05/19
Re: LYNX-DEV Control-Z and SIGSTOP mysteries, Bela Lubkin, 1997/05/17
Re: LYNX-DEV Control-Z and SIGSTOP mysteries, John E. Davis, 1997/05/17
Re: LYNX-DEV Control-Z and SIGSTOP mysteries, John E. Davis, 1997/05/18
Re: LYNX-DEV Control-Z and SIGSTOP mysteries, Bela Lubkin, 1997/05/18
Re: LYNX-DEV Control-Z and SIGSTOP mysteries, Foteos Macrides, 1997/05/19
Re: LYNX-DEV Control-Z and SIGSTOP mysteries, Hiram Lester, Jr., 1997/05/20