Page MenuHomeFreeBSD

libc: Improve POSIX conformance of dirfd()
ClosedPublic

Authored by des on Jan 31 2026, 9:34 PM.
Tags
None
Referenced Files
F154273247: D55025.id.diff
Mon, Apr 27, 1:01 PM
F154218409: D55025.id170908.diff
Mon, Apr 27, 5:08 AM
Unknown Object (File)
Mon, Apr 20, 2:10 AM
Unknown Object (File)
Fri, Apr 17, 12:07 PM
Unknown Object (File)
Mar 1 2026, 8:58 PM
Unknown Object (File)
Mar 1 2026, 1:39 PM
Unknown Object (File)
Feb 28 2026, 9:55 PM
Unknown Object (File)
Feb 26 2026, 1:27 PM
Subscribers

Details

Summary

POSIX states that dirfd() should set errno to EINVAL and return -1 if
dirp does not refer to a valid directory stream. Our interpretation is
that this applies if dirp is null or the file descriptor associated
with it is negative.

MFC after: 1 week
Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable