[uClibc 0000668]: opendir should not set FD_CLOEXEC
bugs at busybox.net
bugs at busybox.net
Sat Feb 4 02:33:00 UTC 2006
A NOTE has been added to this issue.
======================================================================
http://busybox.net/bugs/view.php?id=668
======================================================================
Reported By: rfelker
Assigned To: uClibc
======================================================================
Project: uClibc
Issue ID: 668
Category: Standards Compliance
Reproducibility: always
Severity: minor
Priority: normal
Status: assigned
======================================================================
Date Submitted: 01-30-2006 19:02 PST
Last Modified: 02-03-2006 18:32 PST
======================================================================
Summary: opendir should not set FD_CLOEXEC
Description:
uClibc opendir sets FD_CLOEXEC. This contradicts POSIX which says
either the parent or child may continue using the directory handle,
just not both.
======================================================================
----------------------------------------------------------------------
vapier - 02-03-06 18:32
----------------------------------------------------------------------
glibc uses FD_CLOEXEC and it was added to uClibc due to POSIX conformance
http://www.opengroup.org/onlinepubs/009695399/functions/exec.html
exec() has this to say:
Directory streams open in the calling process image shall be closed in the
new process image.
http://www.opengroup.org/onlinepubs/009695399/functions/opendir.html
opendir() has this to say:
Based on historical implementations, the rules about file descriptors
apply to directory streams as well. However, this volume of IEEE Std
1003.1-2001 does not mandate that the directory stream be implemented
using file descriptors. The description of closedir() clarifies that if a
file descriptor is used for the directory stream, it is mandatory that
closedir() deallocate the file descriptor. When a file descriptor is used
to implement the directory stream, it behaves as if the FD_CLOEXEC had
been set for the file descriptor.
so, since our opendir() utilizes file descriptors in the backend, it
sounds like using the FD_CLOEXEC on the file descriptor is the correct
behavior
Issue History
Date Modified Username Field Change
======================================================================
01-30-06 19:02 rfelker New Issue
01-30-06 19:02 rfelker Status new => assigned
01-30-06 19:02 rfelker Assigned To => uClibc
02-03-06 18:32 vapier Note Added: 0001034
======================================================================
More information about the uClibc-cvs
mailing list