Date: Fri, 27 Dec 2013 21:01:45 +0400 From: Sergey Kandaurov <pluknet@freebsd.org> To: Jilles Tjoelker <jilles@stack.nl> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r259921 - head/lib/libc/sys Message-ID: <CAE-mSO%2BJf%2BMhg4h9cUx2AdmA37MrFvTYKg4A7b0X%2Bb_WDLQd1w@mail.gmail.com> In-Reply-To: <20131226204445.GA54038@stack.nl> References: <201312261916.rBQJGVcs034015@svn.freebsd.org> <20131226204445.GA54038@stack.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
On 27 December 2013 00:44, Jilles Tjoelker <jilles@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAE-mSO%2BJf%2BMhg4h9cUx2AdmA37MrFvTYKg4A7b0X%2Bb_WDLQd1w>