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

From: Michael Forney <mforney_AT_mforney.org>
Date: Sun, 8 Oct 2017 13:01:55 -0700

On 2017-09-17, Eric Pruitt <eric.pruitt_AT_gmail.com> wrote:
> On Sun, Sep 10, 2017 at 04:31:24AM -0700, Eric Pruitt wrote:
>> By setting the SIGINT handler with sigaction(2), automatic retries of
>> the splice(2) syscall can be disabled by not setting SA_RESTART. This
>> makes it possible to use Ctrl+C even if the "if" operand refers to the
>> controlling terminal. The SIGINT message has also been moved outside the
>> signal handler since fprintf(3) is not an async-signal-safe function.
>
> I'm wondering if the ubase maintainer(s) have looked at this patch and
> whether or not they think there are some problems with it.

I can reproduce the issue (select spinning) and I verified that the
patch does indeed fix the issue, so I think it should be applied.

I am curious why ubase dd is using splice instead of just read/write
(as you noted most other implementations do). Unless there is a big
performance win, I would think that simplicity and portability would
be preferable.
Received on Sun Oct 08 2017 - 22:01:55 CEST

This archive was generated by hypermail 2.3.0 : Sun Oct 08 2017 - 22:12:22 CEST