Re: process group = job, and signal question
- From: "Bill Pursell" <bill.pursell@xxxxxxxxx>
- Date: 19 Jun 2006 21:26:13 -0700
Schüle Daniel wrote:
// pipewriter.c
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
void sigint(int signum){
printf("writer INT\n");
exit(0);
}
A small, somewhat pedantic point that is not
relevant to this example, but is an important piece
of information: this is unsafe. You cannot reliably
call printf from your signal handler. See signal(2)
for more information.
<snip>
finally I let pipewriter write into the pipe
./pipewriter | ./pipereader
and after 7 seconds I send SIGINT (type cntr-Z in terminal)
this is the message I see
reader INT
buffer = abcdefg
well, does this mean that only last process in the pipe
executes its "sigint" handler?
does it become process leader?
No. It means that pipewriter wrote it's message into the
pipe, but didn't flush it. But ctrl-z doesn't send SIGINT, that's
ctrl-C, so I'm not sure exactly what you did. The problem
you're seeing is probably just a result of failing to flush
the buffers, and then stopping your test too early.
.
- Follow-Ups:
- Re: process group = job, and signal question
- From: Bill Pursell
- Re: process group = job, and signal question
- References:
- process group = job, and signal question
- From: Schüle Daniel
- process group = job, and signal question
- Prev by Date: Re: GTK application query
- Next by Date: Re: process group = job, and signal question
- Previous by thread: process group = job, and signal question
- Next by thread: Re: process group = job, and signal question
- Index(es):
Relevant Pages
|