[Bug 246412] Return EISDIR when reading a directory

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue May 12 02:46:26 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246412

            Bug ID: 246412
           Summary: Return EISDIR when reading a directory
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs at FreeBSD.org
          Reporter: delphij at FreeBSD.org

FreeBSD have shipped with readdir() and allowing read() on directories is not
very useful.

Other POSIX compliant operating systems like macOS returns EISDIR when
read()ing a directory too, it is allowed in the specification:

Quote https://pubs.opengroup.org/onlinepubs/009695399/functions/read.html :

EISDIR

[XSI] The fildes argument refers to a directory and the implementation does not
allow the directory to be read using read() or pread(). The readdir() function
should be used instead.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list