O_CLOEXEC

Kostik Belousov kostikbel at gmail.com
Fri Mar 25 12:34:27 UTC 2011


On Fri, Mar 25, 2011 at 08:14:47AM -0400, John Baldwin wrote:
> On Thursday, March 24, 2011 8:59:24 pm Kostik Belousov wrote:
> > Hi,
> > below is the implementation of O_CLOEXEC flag for open(2). I also
> > handle the fhopen(2), since the man page states that fhopen(2) takes
> > the same flags as open(2), and it is more logical to change code
> > then man page.
> > 
> > It is somewhat curious that SUSv4 did not specified O_CLOEXEC behaviour
> > for posix_openpt(). I left it out, but it probably makes sense to
> > allow O_CLOEXEC there ?
> > 
> > The falloc() KPI is left as is because the function is often used
> > in the kernel and probably in the third-party modules. fdallocf()
> > takes additional flag argument to set close-on-exec before any other
> > thread might see new file descriptor.
> 
> Hmm, I don't actually expect falloc() to be used in 3rd party modules and 
> would be fine with just adding a new flags parameter to it.

The calls to falloc() appear in such modules as cryptodev(4).
I do not mind changing falloc interface, but I also intend to merge
O_CLOEXEC to stable/8. Are you fine with merging your suggestion to
stable branch, while falloc() is called from cryptodev, zlib,
linux (later is not a big issue if I bump __FreeBSD_version) ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20110325/49c5c8c1/attachment.pgp


More information about the freebsd-fs mailing list