I'm trying to parse some code which works with O_DIRECT files.
ssize_t written = write(fd, buf, size);
What is confusing is that size can be lower than the sector size of the disk, thus does write(fd,buf,size)
write the entirety of buf
to fd
or only the first size
bytes of buf
to disk?
Without O_DIRECT this is simply the second case, but I can't find any documentation about in the case of O_DIRECT, and from what I've read it will still send buf
to the disk, so the only thing I can think of is that it also tells the disk to only write size
...