Page MenuHomeFreeBSD

sockets: use positive flag for file descriptor socket reference
ClosedPublic

Authored by glebius on Jun 30 2022, 3:12 PM.

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
rG FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.