lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LYNX-DEV Control-Z and SIGSTOP mysteries


From: Bela Lubkin
Subject: Re: LYNX-DEV Control-Z and SIGSTOP mysteries
Date: Sat, 17 May 1997 19:18:45 -0700

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
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.)

>Bela<
;
; To UNSUBSCRIBE:  Send a mail message to address@hidden
;                  with "unsubscribe lynx-dev" (without the
;                  quotation marks) on a line by itself.
;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]