From owner-svn-src-all@FreeBSD.ORG Thu Dec 26 20:44:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32D23124; Thu, 26 Dec 2013 20:44:48 +0000 (UTC) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EAC2210CA; Thu, 26 Dec 2013 20:44:47 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id C35233592DC; Thu, 26 Dec 2013 21:44:45 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id B0E6128497; Thu, 26 Dec 2013 21:44:45 +0100 (CET) Date: Thu, 26 Dec 2013 21:44:45 +0100 From: Jilles Tjoelker To: Sergey Kandaurov Subject: Re: svn commit: r259921 - head/lib/libc/sys Message-ID: <20131226204445.GA54038@stack.nl> References: <201312261916.rBQJGVcs034015@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201312261916.rBQJGVcs034015@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 20:44:48 -0000 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. > +.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. > [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. > [snip] -- Jilles Tjoelker