What's the difference between calling daemon() and calling fork(), setsid(), fork(), etc.?

前端 未结 3 677
不思量自难忘°
不思量自难忘° 2020-12-28 21:19

I\'ve been looking at creating Unix dæmons, and there seem to be two methods. The long-winded one, which seems to come up when searching is to call fork(),

3条回答
  •  攒了一身酷
    2020-12-28 21:39

    Note that daemon is not conforming to any standard. Better use standard conforming functions (like POSIX-defined fork and setsid).

提交回复
热议问题