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: Sun, 18 May 1997 11:13:05 -0700

Kari E. Hurtta wrote:

> Bela Lubkin:
> > 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

Thank you for correcting me.  You are right.  The behavior that started
this thread is undoubtably due to the behavior of system() on the test
machine.  It must not assume that when wait() returns, the child is
necessarily finished.  wait() might have returned -1, errno = EINTR or
ERESTART, in which case it must loop back and wait again.  Code should
be along these lines:

  while (wait(...) < 0) {
    if ((errno != EINTR)
#if defined(ERESTART)
        && (errno != ERESTART)
#endif /* ERESTART */
#if defined(SOME_OTHER_OS'S_TRY_AGAIN_INDICATOR)
        && (errno != SOME_OTHER_OS'S_TRY_AGAIN_INDICATOR)
#endif /* SOME_OTHER_OS'S_TRY_AGAIN_INDICATOR */
       ) break;
  }

>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]