This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug manual/6891] New: description of dirfd() doesnt mention returned fd is unusable


Hello again everyone,

In manual, function dirfd() is described :

 int dirfd( DIR* DIRSTREAM )
	 returns file descriptor associated with directory stream DIRSTREAM.
	 This descriptor can be used until directory is closed with `closedir'.
	 If directory stream implementation is not using file descriptors,
	   return value is -1 .

but this does not mention that
 returned filedescriptior is only usable for passing on to fchdir().

from my experiments, i found :
TestMmapDir: getfd ok ; flags = 0x1
TestMmapDir: flag cloexec = 1
TestMmapDir: getfl ok ; flags = 0x98800
TestMmapDir: flag read-access    = 0
TestMmapDir: flag write-access   = 0
TestMmapDir: flag append-mode    = 0
TestMmapDir: flag non-blocking   = 1
TestMmapDir: flag async          = 0
TestMmapDir: flag fsync          = 0
TestMmapDir: flag no-atime       = 0

So i won't be able to mmap a directory :0/

I think it would be usefull to mention
 lack of permissions of returned filedescriptor
 in manual.

-- 
           Summary: description of dirfd() doesnt mention returned fd is
                    unusable
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: manual
        AssignedTo: roland at gnu dot org
        ReportedBy: siward at wanadoo dot nl
                CC: glibc-bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=6891

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]