I have an implementation of a bi-directional message channel which, to reduce overhead, I implemented as a couple of circular buffers of messages. To write from one end to t
A file descriptor is an index into a kernel-managed array of open files and similar objects (pipes, FIFOs, sockets), so it's not possible to associate a file descriptor with anything not managed by the kernel.
If your message channels and semaphores are entirely in user space (implemented in your own application with recourse to system calls), then you can't get a file descriptor for it. Sorry.