add c code snppit daemonize.c for writing a daemon program