D and i/o

ikod geller.garry at gmail.com
Tue Nov 12 07:43:19 UTC 2019


On Monday, 11 November 2019 at 10:14:51 UTC, Patrick Schluter 
wrote:
> On Sunday, 10 November 2019 at 20:33:35 UTC, Jonathan Marler 
> wrote:
>> On Sunday, 10 November 2019 at 19:41:52 UTC, Jon Degenhardt 
>> wrote:
>>> [...]
>>
>> For "cat" I believe there is a system call to tell the kernel 
>> to forward data from one file descriptor to the other, meaning 
>> you could implement cat without ever mapping the data into 
>> user-space at all. I'm sure this would be the fastest 
>> mechanism to implement cat, and I've seen this system call 
>> used by a version of cat somewhere out there.
>
> Looks like sendfile(), which as said is not portable. It exists 
> on different Unixes but with different semantics. Requires also

There are more non-portable options for fast disk io - O_DIRECT 
flag for open()[1] and readahead()[2].

1. http://man7.org/linux/man-pages/man2/open.2.html
2. http://man7.org/linux/man-pages/man2/readahead.2.html



More information about the Digitalmars-d mailing list