int daemon(int nochdir, int noclose);
来源:互联网 发布:算法与数据结构自测题 编辑:程序博客网 时间:2024/06/07 04:10
#include <unistd.h>
int daemon(int nochdir, int noclose);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
daemon(): _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
DESCRIPTION
The daemon() function is for programs wishing to detach themselves from the controlling terminal and run in
the background as system daemons.
If nochdir is zero, daemon() changes the calling process's current working directory to the root directory
("/"); otherwise, the current working directory is left unchanged.
If noclose is zero, daemon() redirects standard input, standard output and standard error to /dev/null; other‐
wise, no changes are made to these file descriptors.
RETURN VALUE
(This function forks, and if the fork(2) succeeds, the parent calls _exit(2), so that further errors are seen
by the child only.) On success daemon() returns zero. If an error occurs, daemon() returns -1 and sets errno
to any of the errors specified for the fork(2) and setsid(2).
int daemon(int nochdir, int noclose);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
daemon(): _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
DESCRIPTION
The daemon() function is for programs wishing to detach themselves from the controlling terminal and run in
the background as system daemons.
If nochdir is zero, daemon() changes the calling process's current working directory to the root directory
("/"); otherwise, the current working directory is left unchanged.
If noclose is zero, daemon() redirects standard input, standard output and standard error to /dev/null; other‐
wise, no changes are made to these file descriptors.
RETURN VALUE
(This function forks, and if the fork(2) succeeds, the parent calls _exit(2), so that further errors are seen
by the child only.) On success daemon() returns zero. If an error occurs, daemon() returns -1 and sets errno
to any of the errors specified for the fork(2) and setsid(2).
0 0
- int daemon(int nochdir, int noclose);
- int
- int?
- int ?
- int
- Int
- int?
- int*&、int&*
- int*&、int&*
- Int (*(*F)(int,int))(int)
- int (*func(int)) (int *,int)
- int; int*; int&区别
- int (*a)(int) ; int (*a[10])(int); int *(*a)(int) ;
- typedef int (* func)(int ,int )
- (int) &、(int)、(int &)的区别
- typedef int (* func)(int ,int )
- pair<int, int> set<pair<int, int>>
- int socket(int,int,int)详解
- mysql命令行操作
- 抽象数据类型
- Java的Random总结
- 用My97扩充成的ExtJs日期时间插件
- 题目1099:后缀子串排序
- int daemon(int nochdir, int noclose);
- C语言之冒泡排序
- Matlab实现批量处理图像的两种方法
- Android编译系统简要介绍和学习计划
- 电脑Cpu风扇噪音大怎么办?
- iOS:”NSURL中使用string拼接有时候会使NSURL成nil“解决方案
- zookeeper的使用场景
- cocos2d-x + TiledMap 详解
- quartz spring 版本兼容问题