Page MenuHomeFreeBSD

pdkill(2), pdgetpid(2): return EBADF if the file type is not procdesc
ClosedPublic

Authored by kib on Aug 5 2026, 8:09 AM.
Tags
None
Referenced Files
F170661795: D58666.diff
Sat, Sep 5, 9:22 PM
Unknown Object (File)
Fri, Sep 4, 1:49 PM
Unknown Object (File)
Fri, Sep 4, 1:49 PM
Unknown Object (File)
Fri, Sep 4, 1:46 PM
Unknown Object (File)
Fri, Sep 4, 7:38 AM
Unknown Object (File)
Mon, Aug 31, 2:51 PM
Unknown Object (File)
Sun, Aug 30, 4:48 AM
Unknown Object (File)
Sat, Aug 29, 10:36 PM
Subscribers

Diff Detail

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

Event Timeline

kib requested review of this revision.Aug 5 2026, 8:09 AM

Why not return EBADF unconditionally?

This revision is now accepted and ready to land.Aug 5 2026, 1:18 PM

Why not return EBADF unconditionally?

In e18844223d1eabb7e435ff9da20d88915d3f4675 I changed from unconditional EBADF to unconditional EINVAL, because pdwait::einval test caught it.
Changing it back seems to be not an option.

In D58666#1346166, @kib wrote:

Why not return EBADF unconditionally?

In e18844223d1eabb7e435ff9da20d88915d3f4675 I changed from unconditional EBADF to unconditional EINVAL, because pdwait::einval test caught it.
Changing it back seems to be not an option.

Yes, pdwait::einval and pdwait(2) are already in 15.1-R so we need to keep EINVAL in 15.x (I don't object having EBADF in 16 if that makes more sense.)

BTW in lib/libsys/pdfork.2 we still say pddupfd(2) returns EBADF. In this patch we change it to EINVAL. It's only in main so I think we can just choose preferred one and sync the manpage.

This revision now requires review to proceed.Aug 5 2026, 4:35 PM

Thanks and confirmed konsole(1) doesn't report false shell crash now.

This revision is now accepted and ready to land.Aug 5 2026, 5:24 PM