svn commit: r259921 - head/lib/libc/sys

Sergey Kandaurov pluknet at freebsd.org
Fri Dec 27 17:01:48 UTC 2013


On 27 December 2013 00:44, Jilles Tjoelker <jilles at stack.nl> wrote:
> On Thu, Dec 26, 2013 at 07:16:31PM +0000, Sergey Kandaurov wrote:
>> Author: pluknet
>> Date: Thu Dec 26 19:16:30 2013
>> New Revision: 259921
>> URL: http://svnweb.freebsd.org/changeset/base/259921
>
>> Log:
>>   Provide the manual page for aio_fsync(2).
>
>>   Reviewed by:        davidxu
>>   MFC after:  1 week
>
>> Added: head/lib/libc/sys/aio_fsync.2
>> ==============================================================================
>> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
>> +++ head/lib/libc/sys/aio_fsync.2     Thu Dec 26 19:16:30 2013        (r259921)
>> @@ -0,0 +1,152 @@
>> [snip]
>> +The
>> +.Fa op
>> +argument could be set only to
>
> I suppose the op argument "must" be set to O_SYNC, rather than "could
> only" be set to O_SYNC. Alternatively, it "can only" be set to O_SYNC.

Thank you for feedback.
Right, this can/could was overlooked.

>
>> +.Dv O_SYNC
>> +to cause all currently queued I/O operations to be completed
>> +as if by a call to
>> +.Xr fsync 2 .
>> +.Pp
>> [snip]
>> +.Bl -tag -width Er
>> +.It Bq Er EBADF
>> +The
>> +.Fa iocb->aio_fildes
>> +is invalid for writing.
>
> This is what current POSIX standards say, but it does not make sense and
> does not work that way. Any open file descriptor is sufficient, since
> the access mode does not affect whether there are pending I/O operations
> on the underlying file. See http://austingroupbugs.net/view.php?id=671
> which FreeBSD already implements (from reading the code).
>
> The text from fsync(2) can be used:
>
> .It Bq Er EBADF
> The
> .Fa iocb->aio_fildes
> argument
> is not a valid descriptor.

This was one of those tricky parts in writing this man page...

>
>> [snip]
>> +.Pp
>> +If the request is successfully enqueued, but subsequently cancelled
>> +or an error occurs, the value returned by the
>> +.Fn aio_return
>> +system call is per the
>> +.Xr read 2
>> +and
>> +.Xr write 2
>> +system calls, and the value returned by the
>> +.Fn aio_error
>> +system call is one of the error returns from the
>> +.Xr read 2
>> +or
>> +.Xr write 2
>> +system calls.
>
> The reference to read() and write() is in fact correct, and is missing
> from the fsync(2) page. For example, [EDQUOT] or [ENOSPC] may be seen on
> a network filesystem.

Ok.

-- 
wbr,
pluknet


More information about the svn-src-head mailing list