Expand description
Control socket for the Selkies V4L2 interposer.
Each application open() of the virtual device becomes one client connection. The server sends
the ring configuration once, with the ring memfd attached as SCM_RIGHTS ancillary data, then
only ever writes one-byte doorbells — one per published frame — so the interposer can block in
poll()/VIDIOC_DQBUF on plain socket readability. Frame bytes never cross the socket. The
interposer answers the handshake with a single byte; until that arrives a client gets no
doorbells, and a closed connection is retired the moment its read end reports hangup.
The accept/hangup loop runs on its own thread, woken through an eventfd for shutdown, so a process that opens the device while no frames flow is still served immediately.
Structs§
Functions§
- accept_
clients 🔒 - peer_
is_ 🔒session_ user - Whether a socket’s peer runs as this process’s user or as root, who passes the
socket’s mode anyway: one that connected before
restrict_to_owneris refused here. - restrict_
to_ 🔒owner - Make a socket this process bound connectable by its user alone, whatever the umask.
- send_
config_ 🔒with_ fd - Send the configuration struct with the ring memfd attached as
SCM_RIGHTS. - serve 🔒