Is there a good reason to write my own daemonize function instead of using daemon(3)?

后端 未结 4 858
孤街浪徒
孤街浪徒 2021-01-13 20:37

There are a lot of example implementations of daemons on the net. Most that I saw do not use the daemon(3) function to run the program in the background. Is that just a matt

4条回答
  •  执笔经年
    2021-01-13 21:04

    The daemon() function was not historically available in all flavors of Unix, so a lot of "portable" code doesn't use it. There's really no reason to roll your own recipe as long as all the target platforms you care about have daemon().

提交回复
热议问题