Page MenuHomeFreeBSD

libc: Improve POSIX conformance of dirfd()
ClosedPublic

Authored by des on Jan 31 2026, 9:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 1, 8:58 PM
Unknown Object (File)
Sun, Mar 1, 1:39 PM
Unknown Object (File)
Sat, Feb 28, 9:55 PM
Unknown Object (File)
Thu, Feb 26, 1:27 PM
Unknown Object (File)
Sun, Feb 22, 7:02 PM
Unknown Object (File)
Thu, Feb 19, 5:26 AM
Unknown Object (File)
Wed, Feb 18, 2:05 AM
Unknown Object (File)
Sat, Feb 14, 8:23 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