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)
Mon, May 18, 3:19 AM
Unknown Object (File)
Mon, May 18, 3:11 AM
Unknown Object (File)
Sat, May 16, 7:21 PM
Unknown Object (File)
Sat, May 16, 7:21 PM
Unknown Object (File)
Sat, May 16, 7:17 PM
Unknown Object (File)
Sun, May 10, 12:24 PM
Unknown Object (File)
Sun, May 10, 12:16 PM
Unknown Object (File)
Sun, May 10, 6:22 AM
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