Page MenuHomeFreeBSD

tests: unix: allow passfd's recvfd_payload() to fail
AbandonedPublic

Authored by kevans on Jun 4 2026, 5:05 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jun 28, 9:45 AM
Unknown Object (File)
Wed, Jun 24, 9:59 PM
Unknown Object (File)
Sat, Jun 20, 7:01 PM
Unknown Object (File)
Sat, Jun 20, 7:00 PM
Unknown Object (File)
Thu, Jun 18, 8:21 AM
Unknown Object (File)
Thu, Jun 18, 8:18 AM
Unknown Object (File)
Mon, Jun 15, 2:38 PM
Unknown Object (File)
Mon, Jun 15, 2:19 PM
Subscribers

Details

Reviewers
markj
kib
glebius
Summary

We're going to add some tests that exercise failure at one or both of
these points, so add an argument to allow it and return the len -- for
the control message failure, the caller will be verifying that we
received data but no files.

No functional change.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 73652
Build 70535: arc lint + arc unit

Event Timeline

kevans requested review of this revision.Jun 4 2026, 5:05 AM
This revision is now accepted and ready to land.Jun 8 2026, 5:52 PM

I know I'm being annoying, but I really don't like naked bool function parameters. They're expedient but they make function calls harder to read and add complexity to the function itself. It would be cleaner to refactor recvfd_payload(): add a helper function which sets up the msghdr and calls recvmsg(), letting the caller provide a cmsg buffer and letting it decide what to do with the return value. Use that helper directly in your new test case.

Anyway, I don't object to this, I just try to avoid this pattern myself.

I know I'm being annoying, but I really don't like naked bool function parameters.

Nah, that's completely fair criticism. Doing so also allows me to better confirrm that the cmsg was empty.