From owner-cvs-all@FreeBSD.ORG Sat Oct 7 08:31:33 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F1F6B16A40F; Sat, 7 Oct 2006 08:31:32 +0000 (UTC) (envelope-from ru@rambler-co.ru) Received: from relay0.rambler.ru (relay0.rambler.ru [81.19.66.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6E6E743D45; Sat, 7 Oct 2006 08:31:31 +0000 (GMT) (envelope-from ru@rambler-co.ru) Received: from relay0.rambler.ru (localhost [127.0.0.1]) by relay0.rambler.ru (Postfix) with ESMTP id 7A9D9604F; Sat, 7 Oct 2006 12:31:30 +0400 (MSD) Received: from edoofus.park.rambler.ru (unknown [81.19.65.108]) by relay0.rambler.ru (Postfix) with ESMTP id 405936049; Sat, 7 Oct 2006 12:31:30 +0400 (MSD) Received: (from ru@localhost) by edoofus.park.rambler.ru (8.13.8/8.13.8) id k978VVXG099325; Sat, 7 Oct 2006 12:31:31 +0400 (MSD) (envelope-from ru) Date: Sat, 7 Oct 2006 12:31:31 +0400 From: Ruslan Ermilov To: Tom Rhodes Message-ID: <20061007083131.GA82415@rambler-co.ru> References: <200610070534.k975Yq52033812@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Nq2Wo0NMKNjxTN9z" Content-Disposition: inline In-Reply-To: <200610070534.k975Yq52033812@repoman.freebsd.org> User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: No virus found Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libc/sys aio_return.2 X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Oct 2006 08:31:33 -0000 --Nq2Wo0NMKNjxTN9z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Tom, On Sat, Oct 07, 2006 at 05:34:51AM +0000, Tom Rhodes wrote: > trhodes 2006-10-07 05:34:51 UTC >=20 > FreeBSD src repository >=20 > Modified files: > lib/libc/sys aio_return.2=20 > Log: > Fix ambiguity in description. Note that the aio_return() system call s= hould > only be called once after failure or completion of an AIO request. Bum= p doc > date while I'm here. > =20 > Noticed by: Samy Al Bahra > =20 > Revision Changes Path > 1.18 +9 -5 src/lib/libc/sys/aio_return.2 >=20 To me, what's now is more confusing than what it was, see below. : The : .Fn aio_return : system call : should only be called once, to obtain the final status of an asynchronous : I/O operation once : .Xr aio_error 2 : returns something other than : .Er EINPROGRESS . What was there was technically correct and unambiguous: once the request has completed (which can be determined by aio_error() returning !EINPROGRESS), either successfully or unsuccessfully, the aio_return() may be called, only once, to return a status of an operation (return value and errno if return value =3D=3D -1). Now, : The : .Fn aio_return : system call : should only be called once, to obtain the final status of an asynchronous : I/O operation. : If the error status of the request is : .Er EINPROGRESS , : an undefined value is returned. : The : .Fn aio_return : function should only be called on completion or failure of an : AIO request. it is more confusing. You removed the description of how you can determine when it's safe to call aio_return() (when the operation has completed): If an operation is still in progress, and you call aio_return(), the results are undefined, both for an operation and this function. Both POSIX standard and our manpage (both old and new versions) say that calling it again is prohibited. So before calling aio_return() you need to make sure that the call has completed. "If the error status of the request is EINPROGRESS, an undefined value is returned." This is very confusing while correct for a standard. I think this is a deficiency in the standard; I'd expect that for in-progress operations, aio_return() returned -1 and set errno =3D=3D EINPROGRESS, and allowed to be called again. Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --Nq2Wo0NMKNjxTN9z Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFFJ2XjqRfpzJluFF4RAt+LAKCRGxb79eVrcMMop0EfHpCjp5hBgACfXM9G pv1MySlvGT5RaucOy7brQmc= =cVvT -----END PGP SIGNATURE----- --Nq2Wo0NMKNjxTN9z--