2 ms·
There is not an arrow pointing to "SDL input". Look again. :-) Spoiler: There is an arrow pointing to a large red box that happens to contain libevdev right b
by burfog 8y ago
There is not an arrow pointing to "SDL input". Look again. :-)
Spoiler:
There is an arrow pointing to a large red box that happens to contain libevdev right below the arrow. To see the edge of the box, you may need to scroll right if your browser has a narrow window.
It is a terrible diagram, but it is correct.
In UNIX terminology, anything with a file descriptor is a file. Plan 9 would have a filename, but that is a different OS.
See the man page for stat(1) where you will find S_IFSOCK. The st_mode value is 0140000 for a socket, which is 0xc000 in hex.
I just hacked up the program shown by "man 3 getaddrinfo" to call fstat on the file descriptor and show the results. I get this:
fd 3 has inode 325043100, mode 140777 0xc1ff, dev 8 rdev 0
That inode number is the one that shows as symlink content
in the /proc/*/fd/ directory listing.
Clearly, it works. Sockets do have file descriptors and inode numbers. Inside the kernel, there is even a "struct inode" for each socket.