svn commit: r184849 - in head: lib/libc/sys sys/amd64/linux32
sys/i386/linux sys/kern sys/sys
John Baldwin
jhb at freebsd.org
Wed Nov 12 05:11:42 PST 2008
On Tuesday 11 November 2008 09:55:59 am Ed Schouten wrote:
> Author: ed
> Date: Tue Nov 11 14:55:59 2008
> New Revision: 184849
> URL: http://svn.freebsd.org/changeset/base/184849
>
> Log:
> Several cleanups related to pipe(2).
>
> - Use `fildes[2]' instead of `*fildes' to make more clear that pipe(2)
> fills an array with two descriptors.
>
> - Remove EFAULT from the manual page. Because of the current calling
> convention, pipe(2) raises a segmentation fault when an invalid
> address is passed.
>
> - Introduce kern_pipe() to make it easier for binary emulations to
> implement pipe(2).
>
> - Make Linux binary emulation use kern_pipe(), which means we don't have
> to recover td_retval after calling the FreeBSD system call.
To close fd's safely on error you need to use fdclose(). That would mean
returning the actual 'struct file *' pointers from kern_pipe() and requiring
the caller to fdrop(), but that is not a big deal.
--
John Baldwin
More information about the svn-src-all
mailing list