Inherited UNIX Sock File Descriptor Ownership

I don't have to rely on the parent processes' handed down connection; I know I can readlink the relevant /proc/self/fd file and open a new connection.

Per the behaviour described in the original post, you have to do it to implement the specification.

You don't know you can open a new connection either, that's a question of permissions and security policy. Being able to write to a file descriptor given to you doesn't mean you have permission to touch any sockets or files on the filesystem or even the ability to see them.

Chances are if you're given a file descriptor it's specifically to make you not open a socket for some reason, so going against that is going to create fragile code.

See the discussion in I/O safety forbids the "pass FD via env var" pattern (e.g., jobserver) · Issue #116059 · rust-lang/rust · GitHub

A way to represent a process-wide shared resource would be BorrowedFd<'static>.
Though since wayland sockets unfortunately are SOCK_STREAM and not SOCK_SEQPACKET it probably doesn't make much sense to share them unsynchronized across threads.
So if you need exclusive ownership anyway another option is to turn it into an OwnedFd then try_clone() it (to get a new FD number) and close the original. Anything trying to use the original will hopefully error and abort the process.

See remove_var in std::env - Rust
It's ok to call it early in main when no other threads are running.