works with O_DIRECT
and the destination file system.
Here's the patch I expect to push soon:
>From 2f4004be6131e049a1452ee68377ae1756673bd4 Mon Sep 17 00:00:00 2001
From: Jim Meyering
Date: Tue, 4 Aug 2009 19:54:58 +0200
Subject: [PATCH] dd: work around buffer length restrictions with oflag=direct
(O_DIREC
; From: Jim Meyering
> Date: Tue, 4 Aug 2009 19:54:58 +0200
> Subject: [PATCH] dd: work around buffer length restrictions with oflag=direct
> (O_DIRECT)
In case anyone actually reviews this, I've fixed a few nits:
- mention the fix in NEWS
- s/oflags=/oflag=/
>From 5929322
or something I think.
> Here's the patch I expect to push soon:
>
> From 2f4004be6131e049a1452ee68377ae1756673bd4 Mon Sep 17 00:00:00 2001
> From: Jim Meyering
> Date: Tue, 4 Aug 2009 19:54:58 +0200
> Subject: [PATCH] dd: work around buffer length restrictions with oflag=direc
Eric Sandeen wrote:
> Jim Meyering wrote:
...
>> diff --git a/doc/coreutils.texi b/doc/coreutils.texi
>> index acec76e..6fa2602 100644
>> --- a/doc/coreutils.texi
>> +++ b/doc/coreutils.texi
>> @@ -7861,6 +7861,10 @@ dd invocation
>> @opindex direct
>> @cindex direct I/O
>> Use direct I/O for
Eric Sandeen wrote:
> Jim Meyering wrote:
>> Eric Sandeen mentioned that dd's O_DIRECT-exposing code
>> didn't always work. The problem is that the kernel imposes
>> draconian restrictions on the size of buffer that one may
>> write to an FD opened with O_DIRECT. Currently, at least on
>> ext4 an
Jim Meyering wrote:
> Eric Sandeen wrote:
> ...
>> I suppose it would be nice to at least make that last buffered IO
>> synchronous if possible, or sync the file afterwards.
>> POSIX_FADV_DONTNEED for extra credit? :)
>
> Good idea.
> What do you think of this?
> It feels slightly excessive to
Jim Meyering wrote:
> +#ifdef POSIX_FADV_DONTNEED
> + off_t off = lseek (STDOUT_FILENO, 0, SEEK_CUR);
> + if (0 <= off)
> +ignore_value (posix_fadvise (STDOUT_FILENO,
> + off, 0, POSIX_FADV_DONTNEED));
> +#endif
That reminds me that it would be