daemon 函数

来源:互联网 发布:网络 问号 编辑:程序博客网 时间:2024/04/30 10:53

int   daemon(int   nochdir,   int   noclose);  
   
  DESCRIPTION  
                The     daemon()     function     is   for   programs   wishing   to   detach   themselves   from   the   con-  
                trolling   terminal   and   run   in   the   background   as   system   daemons.  
   
                Unless   the   argument   nochdir   is     non-zero,     daemon()     changes     the     current     working  
                directory   to   the   root   ("/").  
   
                Unless     the     argument     noclose     is   non-zero,   daemon()   will   redirect   standard   input,  
                standard   output   and   standard   error   to   /dev/null.