Page MenuHomeFreeBSD

kern: replace several EBADF with EINVAL
ClosedPublic

Authored by kib on Sep 7 2025, 11:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 11, 5:36 AM
Unknown Object (File)
Fri, Oct 10, 10:25 PM
Unknown Object (File)
Fri, Oct 10, 10:25 PM
Unknown Object (File)
Fri, Oct 10, 10:25 PM
Unknown Object (File)
Fri, Oct 10, 4:24 PM
Unknown Object (File)
Sat, Sep 27, 4:25 AM
Unknown Object (File)
Fri, Sep 26, 12:14 AM
Unknown Object (File)
Wed, Sep 24, 3:01 AM
Subscribers

Details

Summary
EBADF semantic is that the passed fd is invalid, not that it is of wrong
type.  Using EBADF in these places in kern_event.c and sys_procdesc.c
give bad examples to copy from.

Note that places in kern_event.c that checks KQ_CLOSING and return EBADF
are kept, since KQ_CLOSING is the transient state before the fd is
finally closed and become eligible for EBADF.

Diff Detail

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