linux daemon() 用法
名称
daemon-运行于后台
概要
#include <unistd.h>
int daemon(int nochdir, int noclose);
描述
daemon()函数,主要用于某些程序希望自己脱离终端的控制而运行于后台的情况。
除非nochdir为非零值,如果nochdir为0,那么daemon会从当前目录,更改到根目录(“/”)下运行。
除非noclose为非零值,如果noclose为0,那么daemon会将标准输入,标准输出,标准错误输出重定向到/dev/null。
返回值
成功返回0,失败返回-1。
NAME
daemon - run in the background
SYNOPSIS
#include <unistd.h>
int daemon(int nochdir, int noclose);
DESCRIPTION
The daemon() function is for programs wishing to detach themselves
from the controlling 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 stan-
dard input, standard output and standard error to /dev/null.
RETURN VALUE
(This function forks, and if the fork() succeeds, the parent does
_exit(0), so that further errors are seen by the child only.) On
success zero will be returned. If an error occurs, daemon() returns
&nb
相关文档:
正式实习一周,有点感触。本来就没指望能成为什么技术大牛,用自己调侃的话来说就是“混口饭吃”。不过老大对me的期望值那么高,经理管得这么严,压力颇大。对自己挺失望,没能开好头,有点对不起这么成功的老大。还好没准备做什么大事,要不然这性格得费多大力气才能重塑。。。
都是逼出来的,被经理训后,一天 ......
#ifdef XP_UNIX
/*
* Set up the plugin function table that Netscape will use to
* call us. Netscape needs to know about our version and size
* and have a UniversalProcPointer for every function we
* implement.
*/
pluginFuncs->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR;
......
我就是一个小新手+小菜鸟,正在发奋学习linux,初有心得遂决定记录下来,也许对有些人来说我写的都太浅显,但是对初学者来说绝对是有用的,可以让你少走很多弯路,况且我会由浅入深的,沿着我的足迹一起学习吧,加油!
本来想先写系统安装,然后环境配置, ......
1、系统时钟(System Clock)与实时时钟(Real Time Clock)
实时时钟指的是硬件时钟,而系统时钟指的是软件时钟,存在于Linux系统之中。当系统启动时,Linux会从硬件读取时间做为系统时间,之后便一直采用系统时间。Linux命令date可以用来设置系统时钟,而hwclock或者clock则用来设置实时时钟,即硬件时钟。
2、时钟频率
单 ......
SUSE Linux 维护笔记 一
1. Linux时间更新设置
时区设定:
#主要文件
/etc/sysconfig/clock
#用北京时间的正确内容应该是
TIMEZONE="Asia/Beijing"
DEFAULT_TIMEZONE="Asia/Beijing"
#同时确保 /etc/localtime文件是/usr/share/zoneinfo/Asia/Beijing的拷贝
保持更新:
在/etc/crontab中加入一 ......