3 ms·
files on unix are referenced counted. and unix sockets are just a type of file. every link adds to the count, a link can be a filesystem name but open file hand
by somat 2y ago
files on unix are referenced counted. and unix sockets are just a type of file. every link adds to the count, a link can be a filesystem name but open file handles are also links. once there are no more links to a file the file can be deleted.
so this is opening a unix socket with a no name(the initial null terminates the C style string) thus leaving the only link to it as the file discripter.
One trick I used to do was to sneak another link to the file to keep it around before the process ended , The serious real use case for this was if you had accidentally deleted a file but some process was keeping it open somewhere, but I mainly used it back when youtube was flash based it would try and keep the video cache file hidden this way. and you could make a copy of the video by snaging the correct file descriptor.
- jumploops 2y agoI have fond memories of modifying the memory of flash-based games when they first launched on Facebook. I don't remember the FB account credentials, but I received thousands of messages from people either telling me I was a terrible person, or trying to bribe me so they could beat their sibling... all for a simple helicopter game. Fun times.
- 9dev 2y agoThat sounds like a bug in the spec rather than an intentional feature, though?