svn commit: r194262 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern tools/regression/file/closefrom

Kostik Belousov kostikbel at gmail.com
Mon Jun 15 21:02:28 UTC 2009


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
> 
> 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 not
>   multithread safe.
...
> +	FILEDESC_SLOCK(fdp);
> +	for (fd = uap->lowfd; fd < fdp->fd_nfiles; fd++) {
> +		if (fdp->fd_ofiles[fd] != 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 ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20090615/e7d93f34/attachment.pgp


More information about the svn-src-head mailing list