Page MenuHomeFreeBSD

sockets: use positive flag for file descriptor socket reference
ClosedPublic

Authored by glebius on Jun 30 2022, 3:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Aug 14, 11:20 PM
Unknown Object (File)
Sat, Aug 9, 6:31 PM
Unknown Object (File)
Mon, Aug 4, 1:17 AM
Unknown Object (File)
Sat, Aug 2, 9:55 AM
Unknown Object (File)
Wed, Jul 23, 1:26 AM
Unknown Object (File)
Jul 21 2025, 3:40 PM
Unknown Object (File)
Jul 21 2025, 10:52 AM
Unknown Object (File)
Jul 21 2025, 10:41 AM
Subscribers

Details

Summary

Rename SS_NOFDREF to SS_FDREF and flip all bitwise operations.
Mark sockets created by socreate() with SS_FDREF.

This change is mostly illustrative. With it we see that SS_FDREF
is a debugging flag, since:

  • socreate() takes a reference with soref().
  • on accept path solisten_dequeue() takes a reference with soref() and then soaccept() sets SS_FDREF.
  • soclose() checks SS_FDREF, removes it and does sorele().

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 46208
Build 43097: arc lint + arc unit