000301 Klaus Weide wrote:
> On Tue, 29 Feb 2000, Philip Webb wrote:
>> since Lynx  ^t  doesn't help, i remembered  strace 
> Good idea!
>> read(0, "7", 1)                         = 1
-- snip --
> I assume this is from the 'P'rint Options page.  What is your link #7?

 /usr/local/bin/edit %s  [ in its proper place in the line ]
 
-- snip -- 
>> write(1, "Printing file.  Please wait...", 30) = 30
> Now lynx is going to invoke a command via its LYSystem() function.
> What command exactly depends on what link #7 is.
> The following  3 lines  are under control of lynx code, see  LYSystem() :
>> sigaction(SIGPIPE, {SIG_DFL}, {SIG_IGN}) = 0
>> sigaction(SIGTSTP, NULL, {0xfa6d8f8, [], SA_RESETHAND|SA_NODEFER}) = 0
>> sigaction(SIGTSTP, {SIG_DFL}, {0xfa6d8f8, [], SA_RESETHAND|SA_NODEFER}) = 0
> Then  LYSystem()  calls  system() ,
> all the following happens within the system's  system()  implementation:
>> sigaction(SIGCHLD, {SIG_DFL}, {SIG_DFL}) = 0
>> fork()                                  = 26308
> A child process is created to execute the external command.
> the parent Lynx process now just waits:
>> waitid(P_PID, 26308,  <unfinished ...>
>> --- SIGINT (Interrupt) ---
> ... and gets a SIGINT signal before the child exists.
> Assuming you pressed  ^g  -- the child changed the tty settings
> so that  ^G  means  intr  (this would show up unter  'stty -a'
> as  'intr = ^G' , if you could look at it at it at this stage).

see below

>> <... waitid resumed> 0x7fffa138, WEXITED|WTRAPPED) = -1 EINTR (Interrupted system 
>call)
>> --- SIGINT (Interrupt) ---
>  ^G  causes a SIGINT signal, the same as  ^C  normally,
> which gets delivered to the parent Lynx as well as the child.
> It causes the Lynx process to terminate besides what it does
> to the child process - probably terminate it, too).
> The problem is the system's system() implementation,
> it doesn't behave as it should.  From a Linux system(2) man page:
>   system() executes a command specified in string by calling
>   /bin/sh -c string, and returns after the command has  been
>   completed.   During execution of the command, SIGCHLD will
>   be blocked, and SIGINT and SIGQUIT will be ignored.
-- FreeBSD snipped --
> The important part here is ignoring SIGINT.
> Your system() doesn't do that.  What does its man page say?

your analysis is very clear & makes sense;
your other message is taken up further down.

there appear to be  2  versions of  system()  at CHASS,
neither of which says it ignores SIGINT.

SYSTEM(3F)       Silicon Graphics    SYSTEM(3F)

NAME  system  - issue a shell command from Fortran

SYNOPSIS  character*N c

 call system(c)

DESCRIPTION

system causes its character argument to begiven to sh(1) as input,
as if the string had been typed at a terminal.
The current process waits until the shell has completed.

SEE ALSO  exec(2), system(3S).  sh(1) in the User's Reference Manual.

ORIGIN  AT&T V.3

system(3S)    system(3S)

NAME  system  - issue a shell command

SYNOPSIS  #include <stdlib.h>

int system(const char *string);

DESCRIPTION

system causes the string to be given to the shell [see sh(1)] as input,
as if the string had been typed as a command at a terminal.
The current process waits until the shell has completed, then returns
the exit status of the shell in the format specified by waitpid(2).

If string is a NULL pointer, system checks if  /sbin/sh  exists
and is executable.  If  /sbin/sh  is available, system returns non-zero;
otherwise it returns zero.

system fails if one or more of the following are true:

EAGAIN  The system-imposed limit on the total number of processes
under execution by a single user would be exceeded.

EINTR  system was interrupted by a signal.

ENOMEM  The new process requires more memory
than is allowed by the system-imposed maximum MAXMEM.

SEE ALSO  exec(2), waitpid(2), sh(1).

DIAGNOSTICS  system forks to create a child process
that in turn execs  /sbin/shin  order to execute string.
If the fork or exec fails, system returns -1 and sets errno.

>> if i enter  ^g  after starting Mutt from the Print screen,
>> but before Mutt calls the editor, the print request is cancelled.
> Is that how Mutt, on its own, is supposed to react to ^g?

if you start Mutt to send a message (cp Elm, if that's what you use),
it prompts eg for Cc: if you enter  ^g  there, it exits (outside Lynx).
this is probably not important, as there's more direct evidence below.

> Since you are using Screen, you sb able to verify
> that while Mutt is in control,  intr = ^G  is in effect:
> 1. Open two screen sessions -- snip --

strictly, you need only  1  session, surely.
anyway, i did as you suggested, testing my editor & Most in/outside Lynx.
the editor is a very slick little version of Emacs
-- it contrasts with Emacs/Vi as Lynx does with IE/NN -- ,
which is available only here (someone wrote it long ago),
but you use Most, so maybe we should concentrate on that.

there were no differences in output from  stty -a
for pseudo-prompt, Print screen & 1st Mutt prompt (asks for filename);
there was a tiny one after 2nd Mutt prompt ( istrip  ->  -istrip );
the editor had the same output invoked directly from the Print screen
& invoked by Mutt which had been invoked from the Print screen;
otherwise, i got the following diffs:

(1)  pseudo-prompt  vs  Most from Print screen

2,3c2,3
< intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^A; eol = ^@; old-swtch = ^Z; 
susp = ^Z
< lnext = ^V; werase = ^W; rprnt = ^R; flush = ^O; stop = ^S; start = ^Q; dsusp = ^@
---
> intr = ^G; quit = ^@; erase = ^H; kill = ^U; eof = ^A; eol = ^@; old-swtch = ^@; 
>susp = ^@
> lnext = ^@; werase = ^W; rprnt = ^R; flush = ^O; stop = ^S; start = ^Q; dsusp = ^@
7,8c7,8
< isig -icanon -xcase -echo echoe echok echoke echoctl -echoprt -echonl -noflsh 
-flusho -pendin 
< opost -olcuc -onlcr -ocrnl -onocr -onlret -ofill -ofdel 
---
> isig -icanon -xcase -echo -echoe -echok -echoke -echoctl -echoprt -echonl noflsh 
>-flusho -pendin 
> opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3 

(2)  pseudo-prompt  vs  Edit from Print screen

2c2
< intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^A; eol = ^@; old-swtch = ^Z; 
susp = ^Z
---
> intr = ^G; quit = ^G; erase = ^H; kill = ^U; eof = ^A; eol = ^@; old-swtch <undef>; 
>susp <undef>
5,7c5,7
< -ignbrk brkint ignpar -parmrk -inpck istrip -inlcr -igncr -icrnl -iuclc 
< ixon ixany -ixoff -imaxbel 
< isig -icanon -xcase -echo echoe echok echoke echoctl -echoprt -echonl -noflsh 
-flusho -pendin 
---
> ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -iuclc 
> -ixon ixany -ixoff -imaxbel 
> isig -icanon -xcase -echo echoe echok echoke -echoctl -echoprt -echonl -noflsh 
>-flusho -pendin 

(3)  pseudo-prompt  vs  Edit outside Lynx

2,3c2,3
< intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^A; eol = ^@; old-swtch = ^Z; 
susp = ^Z
< lnext = ^V; werase = ^W; rprnt = ^R; flush = ^O; stop = ^S; start = ^Q; dsusp = ^@
---
> intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^A; eol = ^@; old-swtch = ^@; 
>susp = ^@
> lnext = ^@; werase = ^@; rprnt = ^@; flush = ^O; stop = ^S; start = ^Q; dsusp = ^@
5c5
< -ignbrk brkint ignpar -parmrk -inpck istrip -inlcr -igncr -icrnl -iuclc 
---
> -ignbrk brkint ignpar -parmrk -inpck istrip inlcr -igncr icrnl -iuclc 
7,8c7,8
< isig -icanon -xcase -echo echoe echok echoke echoctl -echoprt -echonl -noflsh 
-flusho -pendin 
< opost -olcuc -onlcr -ocrnl -onocr -onlret -ofill -ofdel 
---
> isig -icanon -xcase -echo echoe -echok echoke echoctl -echoprt -echonl -noflsh 
>-flusho -pendin 
> opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3 

(4)  pseudo-prompt  vs  Most outside Lynx

2,3c2,3
< intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^A; eol = ^@; old-swtch = ^Z; 
susp = ^Z
< lnext = ^V; werase = ^W; rprnt = ^R; flush = ^O; stop = ^S; start = ^Q; dsusp = ^@
---
> intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^A; eol = ^@; old-swtch = ^@; 
>susp = ^@
> lnext = ^@; werase = ^@; rprnt = ^@; flush = ^O; stop = ^S; start = ^Q; dsusp = ^@
5c5
< -ignbrk brkint ignpar -parmrk -inpck istrip -inlcr -igncr -icrnl -iuclc 
---
> -ignbrk brkint ignpar -parmrk -inpck istrip inlcr -igncr icrnl -iuclc 
7,8c7,8
< isig -icanon -xcase -echo echoe echok echoke echoctl -echoprt -echonl -noflsh 
-flusho -pendin 
< opost -olcuc -onlcr -ocrnl -onocr -onlret -ofill -ofdel 
---
> isig -icanon -xcase -echo echoe -echok echoke echoctl -echoprt -echonl -noflsh 
>-flusho -pendin 
> opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3 

-- 
========================,,============================================
SUPPORT     ___________//___,  Philip Webb : [EMAIL PROTECTED]
ELECTRIC   /] [] [] [] [] []|  Centre for Urban & Community Studies
TRANSIT    `-O----------O---'  University of Toronto

Reply via email to