[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dd hangs with SIGINT
From: |
Bruno Haible |
Subject: |
Re: dd hangs with SIGINT |
Date: |
Fri, 8 Apr 2005 13:34:41 +0200 |
User-agent: |
KMail/1.5 |
Jim Meyering wrote:
> Thanks for the patch, but that `cure' seems worse than the disease.
I agree. The real good way to make this work on POSIX systems (without
assuming multithreading) is to use fork().
- Let the parent process fork a child process, block the signals SIGHUP,
SIGQUIT, SIGPIPE in the parent, and watch the child's exit status.
If the exit status of the child is 128 + SIGHUP/SIGQUIT/SIGPIPE,
print the statistics.
- Let the child process to the real I/O work.
With this approach, you don't install any signal handlers, therefore you
don't even need to think about which functions are async-signal safe. You
can use full malloc(), quote(), ngettext(), fprintf() etc. at will.
Bruno
- Re: dd hangs with SIGINT, (continued)
- Re: dd hangs with SIGINT, Guillaume Chazarain, 2005/04/06
- Re: dd hangs with SIGINT, Bruno Haible, 2005/04/06
- Re: dd hangs with SIGINT, Jim Meyering, 2005/04/07
- Re: dd hangs with SIGINT, Guillaume Chazarain, 2005/04/07
- Re: dd hangs with SIGINT, Jim Meyering, 2005/04/07
- Re: dd hangs with SIGINT, Guillaume Chazarain, 2005/04/07
- Re: dd hangs with SIGINT, Jim Meyering, 2005/04/07
- Re: dd hangs with SIGINT, Guillaume Chazarain, 2005/04/08
- Re: dd hangs with SIGINT, Paul Eggert, 2005/04/07
- Re: dd hangs with SIGINT, Andreas Schwab, 2005/04/07
- Re: dd hangs with SIGINT,
Bruno Haible <=
- Re: dd hangs with SIGINT, Guillaume Chazarain, 2005/04/08
- Re: dd hangs with SIGINT, Andreas Schwab, 2005/04/08
- Re: dd hangs with SIGINT, James Youngman, 2005/04/08