linux daemon() Ó÷¨
Ãû³Æ
daemon-ÔËÐÐÓÚºǫ́
¸ÅÒª
#include <unistd.h>
int daemon(int nochdir, int noclose);
ÃèÊö
daemon()º¯Êý£¬Ö÷ÒªÓÃÓÚijЩ³ÌÐòÏ£Íû×Ô¼ºÍÑÀëÖն˵ĿØÖƶøÔËÐÐÓÚºǫ́µÄÇé¿ö¡£
³ý·Ç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
Ïà¹ØÎĵµ£º
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌá¹©ÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
LINUXÏ mysql¿Í»§¶Ë²»ÄÜÊäÈëÖÐÎÄ
½ñÌìÓöµ½ÁËÕâ¸öÎÊÌ⣬ÔÚLINUXÏÂÊäÈëÖÐÎÄ£¬Ã»ÓÐÎÊÌ⣬µ«ÔÚMYSQL¿Í»§¶ËÉÏÎÞ·¨ÊäÈëÖÐÎÄ£¬ºÜÆæ¹Ö£¿
ÕÒÁ˺ܶà×ÊÁÏÖÕÓÚ½â¾öÁËÕâ¸öÎÊÌ⣬ÆäʵÕâ¸öºÍ×Ö·û¼¯Î޹ء£Í¨³£³öÏÖÔÚ×Ô¼º±àÒëµÄmysql°æ±¾ÉÏ£¬Èç¹ûÊÇREDHATµÄ»°£¬ÇëʹÓÃϵͳ×Ô´øMYSQL¿Í»§¶Ë¡£ÏµÍ³Ä¬ÈÏrpm°²×°µÄmysqlÔòûÓÐÕâ¸öÎÊÌâ³öÏÖ¡£
Á ......
sudo apt-get build-dep firefox
Èô³öÏÖÏÂÃæµÄ´íÎó£º
²»ÄÜÂú×ãÈí¼þ°ü firefox ËùÒªÇóµÄ¹¹½¨ÒÀÀµ¹ØÏµ
Ç뽫 /etc/apt/sources.list ¸ÄΪĬÈϵÄÔ´ ÓоÍÊÇ ×°Íêϵͳºó×Ô´øµÄ£º
#deb cdrom:[Ubuntu 9.04 _Jaunty Jackalope_ - Release i386 (20090421.3)]/ jaunty main restricted
# See http://help.ubuntu ......
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <errno.h>
#include <string.h>
#define MAX 1024
int get_file_count(char *root)
{
DIR *dir;
struct dirent * ptr;
int total = 0;
char path[MAX];
dir = opendir(root ......
2009 Äê 10 ÔÂ 29 ÈÕ
±¾ÎÄÊÇ Unix/Linux ϵͳ¹ÜÀí×Ô¶¯»¯ÏµÁÐÖеÄһƪÎÄÕ£¬Ö÷Òª½éÉÜÁËÄÚ´æ¹ÜÀíËùÉæ¼°µÄÃüÁ²¢Í¨¹ý±àд×Ô¶¯»¯½Å±¾ÊµÏÖÁËÄÚ´æ¹ÜÀíÓë¼à¿ØµÄ×Ô¶¯»¯
ÄÚ´æÊÇ Unix/Linux ÄÚºËËù¹ÜÀíµÄ×îÎªÖØÒªµÄ×ÊÔ´Ö®Ò»£¬ÄÚ´æ¹ÜÀíÊÇϵͳ¹ÜÀíÖзdz£ÖØÒªÒ²ÊÇ×ÔӵĵIJ¿·Ö¡£ÏµÍ³¹ÜÀíÔ±ÐèÒªÕÆÎÕÄÚ´æ¹ÜÀíµÄ»ù±¾¹¤×÷ÔÀíÒÔ¼°Ê¹Óú ......