3 ms·
>2. Sockets are files. No, they don't have filenames usually, but they do have file descriptors and even inode numbers. I challenge you to create a symbolic li
by hueving 8y ago
>2. Sockets are files. No, they don't have filenames usually, but they do have file descriptors and even inode numbers.
I challenge you to create a symbolic link to one. :)
- burfog 8y agoln -s /proc/`pidof Xorg`/fd/1 here-you-go Really though, it's the file descriptor that matters. This is the abstraction that lets you do things like pass a socket between different processes in the same way that you'd pass an opened directory between different processes. The few places where this abstraction is missing are painful. A good example is ptrace. You can't pass a ptrace between processes. Handling it nicely in poll or select isn't easy. The use of file descriptors might not seem so amazing today, now that Windows has the HANDLE and MacOS X has the Mach port, but it was revolutionary when it was introduced. For about 15 years, it was just a UNIX thing. MS-DOS had separate ways to deal with everything: files, directories, each different vendor's network stack, etc. Every other OS was like that, more or less.
- hueving 8y agoAh, my memory fails me of the limitation I was running into. IIRC it was passing socket FDs from a process in an ip namespace to a parent process outside of the namespace via a unix domain socket.