3 ms·
Not who you're replying to, but it's trivial as long as you don't use threads. I suppose third-party code could be opening up file-descriptors behind your back
by aidenn0 5y ago
Not who you're replying to, but it's trivial as long as you don't use threads.
I suppose third-party code could be opening up file-descriptors behind your back and privately maintaining that state in private storage, but third-party code that does that without documenting it is relatively rare in the Unix/C world in my experience.
- cryptonector 5y agoHistorically getXbyY functions and the name service switch had a way of doing that, and that was one reason for nscd to come along (another was to cache better, naturally).
- aidenn0 5y agoMost (all?) of the nsswitch functions were datagram based back in the day, so those would be safe. I've certainly never had issues using e.g. getpwent on a NIS setup with forking and modern rpcbind may use TCP I believe. Maybe it opens a new connection each time?