[Swan-dev] management of whack socket file descriptors

Andrew Cagney andrew.cagney at gmail.com
Fri Jun 22 15:40:41 UTC 2018


I just spent some time reverse-engineering what you describe, and then
some.  For instance, understanding how it all interacts with the
static global whack_log_fd, and how comments like "Release all the
whacks awaiting the completion of this state." relate to code trying
to backgrounds a connection.

I found it too hairy, and backed away.

> I guess we could add a wrapper around whack socket file descriptor
> handling.  We could make leaks and use-after-close detectable at
> runtime.

Making reference counting explicit, instead of hiding it behind FDs,
would probably help (this code is so hairy it may be safer to use
something similar to so_serial_t when storing references).

Pretending the code is written in rust probably won't.


More information about the Swan-dev mailing list