Hacker News new | past | comments | ask | show | jobs | submit login

If only we had an API to tell us when a fork happened. We could place it into the usual library for threading stuff: pthread, and could call it, oh I don't know, maybe pthread_atfork()

https://man7.org/linux/man-pages/man3/pthread_atfork.3.html




It is mentioned in the glibc bug tracker entry as a replacement to the polling. systemd didn't use it because they thought it would be impossible for a library using to be dlclose'd as there is no way to unregister the callback. But apparently glibc has (undocumented) magic under the hood to take care of it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: