C library for daemons