Re: [hackers] [PATCH] [ubase] dd: Use sigaction(2) to obviate select(2)

2017-09-10 Thread Eric Pruitt
On Sun, Sep 10, 2017 at 11:55:53AM +0100, Richard Ipsum wrote: > This isn't a comment on this patch exactly, since this call exists in > the existing handler, but unless I'm missing something about the way > you're doing this it isn't safe to call fprintf in a signal handler > since your signal

Re: [hackers] [PATCH] [ubase] dd: Use sigaction(2) to obviate select(2)

2017-09-10 Thread Richard Ipsum
On Sat, Sep 09, 2017 at 11:06:15PM -0700, Eric Pruitt wrote: > By setting the SIGINT handler using sigaction(2), automatic retries of > the splice(2) call can be disabled by not setting SA_RESTART. This makes > it possible to use Ctrl+C even if standard input is a terminal. > --- [snip] > +static

[hackers] [PATCH] [ubase] dd: Use sigaction(2) to obviate select(2)

2017-09-10 Thread Eric Pruitt
By setting the SIGINT handler using sigaction(2), automatic retries of the splice(2) call can be disabled by not setting SA_RESTART. This makes it possible to use Ctrl+C even if standard input is a terminal. --- dd.c | 58 +- 1 file changed,