Date: Tue, 16 Jun 2009 00:02:18 +0300 From: Kostik Belousov <kostikbel@gmail.com> To: John Baldwin <jhb@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194262 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern tools/regression/file/closefrom Message-ID: <20090615210218.GS23592@deviant.kiev.zoral.com.ua> In-Reply-To: <200906152038.n5FKctaR001026@svn.freebsd.org> References: <200906152038.n5FKctaR001026@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--8DtChEGCcMdSgkU2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 15, 2009 at 08:38:55PM +0000, John Baldwin wrote: > Author: jhb > Date: Mon Jun 15 20:38:55 2009 > New Revision: 194262 > URL: http://svn.freebsd.org/changeset/base/194262 >=20 > Log: > Note that this implementation of closefrom(2) does not make any effort = to > resolve userland races with open(2) in other threads. As such, it is n= ot > multithread safe. =2E.. > + FILEDESC_SLOCK(fdp); > + for (fd =3D uap->lowfd; fd < fdp->fd_nfiles; fd++) { > + if (fdp->fd_ofiles[fd] !=3D NULL) { > + FILEDESC_SUNLOCK(fdp); > + (void)kern_close(td, fd); > + FILEDESC_SLOCK(fdp); > + } > + } > + FILEDESC_SUNLOCK(fdp); Just curious why this was not implemented in userspace ? Audit + fd_nfiles, perhaps ? I am sorry, but somebody would ask this question anyway, so why not me ? --8DtChEGCcMdSgkU2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAko2ttoACgkQC3+MBN1Mb4iPSACg1BIc0glya2bZEbey8ZPT24jr Q8oAoKoh7FSS1wqf4SL5e/Qofxnrv2tK =Q9Ng -----END PGP SIGNATURE----- --8DtChEGCcMdSgkU2--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090615210218.GS23592>