Is there any way to pass an open file descriptor to another process that does not require an unix doman sockets or being a child process?
Edit: and not /proc due to not being portable.
Is there any way to pass an open file descriptor to another process that does not require an unix doman sockets or being a child process?
Edit: and not /proc due to not being portable.
Not quiet what I asked for but a way to bypass the limitations of sun_path may be sufficient for my case.
A mix of a symlink (for long dirname) and rename (for long basename) seems to work. To be portable (eg. not relying on unprivileged user namespaces) it requires a temp directory with a short name to be accessible.
proof of concept: https://paste.sr.ht/~sertonix/174ff4632315aeae300752c8b27e18ddc847e86e
@sertonix IPCPATH_MAX cannot increase since there is no guarantee that a given system can hold more than 108 characters in its sun_path. If I increased it, it would break.
I don't quite understand what your program is supposed to do. To pass a file descriptor to an unrelated process, you have to do fd-passing over a Unix domain socket, there's no alternative; I'm not sure what you accomplish with your directory and socket stuff.