Linux³ÌʽÉè¼Æ
http://www.openchess.org/noitatsko/programming/ (2001-05-24 16:47:48)
ÐźŴ¦Àí
--------------------------------------------------------------------------------
ÐźŴ¦Àí¸Å˵
ËͳöÐźÅ
½ÓÊÕÐźÅ
ÐźŵĴ¦Àí
ÈÎÎñ¿ØÖÆ
--------------------------------------------------------------------------------
POSIX IPC
reliable/unreliable
reentrant
pending
sending signals
catching signals
manipulating
signal definitions
--------------------------------------------------------------------------------
ÐźÅsingals
ÐźŵĴ¦Àí¿ÉÒÔÓÃÒ»´óÕÂÀ´Ð´£¬Éæ¼°µÄ²ãÃæÒ²»áÉîÈëÕû¸ö×÷ҵϵͳÖУ¬ÎÒ²¢²»´òËãÕâÑù×ö£¬ÒòΪÄú¿ÉÄÜ»áÔ½¸ãÔ½ÃÔºý¡£ÕâÀïÎÒÖ»¸æËßÄúÈçºÎ½ÓÉÏÐźţ¬ÔÚʵÓõIJãÃæÉÏ£¬ÕâÑù±ãºÜ¹»ÓÃÁË¡£Äú¿ÉÒÔÏÈÀûÓÃÕâЩ»ù±¾µÄ¼¼ÇÉÀ´×«Ð´³Ìʽ£¬µÈµ½ÓнøÒ»²½¸ßµÈÓ¦ÓõÄÐèҪʱ£¬ÕÒÒ»±¾½ÏÉîÈëµÄUNIX Programming½Ì²Ä£¬×¨ÃÅÑо¿signalµÄд·¨¡£
Ò»°ã¼òµ¥µÄsignalд·¨ÈçÏÂ:
void mysignal(int signo)
{
/* my signal handler */
}
void initsignal(void)
{
struct sigaction act;
act.sa_handler = mysignal;
act.sa_flags = 0;
sigemptyset(&act.sa_mask);
sigaction(SIGHUP,&act,NULL);
sigaction(SIGINT,&act,NULL);
sigaction(SIGQUIT,&act,NULL);
sigaction(SIGILL,&act,NULL);
sigaction(SIGTERM,&act,NULL);
}
ÀýÒ»: lock.c
ÔÚforkµÄÀýÈýÖÐÌáµ½£¬ÔÚdaemon±»É±µôʱ£¬ÐèÒªÔÚÀ뿪ǰ£¬½«/var/run/lock.pidɾ³ý¡£ÕâÀïÎÒÃÇ¿ÉÒÔÀûÓÃsignalÀ´´¦ÀíÕâ¼þÊ¡£
#include
#include
#include
#include
#define LOCK_FILE "/var/run/lock.pid"
void quit(int signo)
{
printf("Receive signal %d\n",signo);
unlink(LOCK_FILE);
exit
Ïà¹ØÎĵµ£º
Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖÐÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀÐÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......
/etc/sysconfig/i18n
±à¼/etc/sysconfig/i18nÕâ¸öÎļþ£¬
²»¹ÜÄã×°µÄÊÇÖÐÎİæ,»¹ÊÇÓ¢Îİæ.ɾµôÔÀ´µÄÅäÖÃ,°ÑÏÂÃæµÄ¿½±´¹ýÈ¥
LANG="zh_CN.GB18030"
SUPPORTED="zh_CN.GB18030:zh_CN:zh:en_US.UTF-8:en_US:en"
SYSFONT="latarcyrheb-sun16"
±£´æ,ÖØÆð.OKÁË
×¢:
I18N ÊÇ internationalization µÄËõдÐÎʽ£¬Òâ¼´ÔÚ i ºÍ ......
¸úÎÒÒ»Æðд Makefile
³Âð© (CSDN)
¸ÅÊö
——
ʲ
ôÊÇmakefile£¿»òÐíºÜ¶àWinodwsµÄ³ÌÐòÔ±¶¼²»ÖªµÀÕâ¸ö¶«Î÷£¬ÒòΪÄÇЩWindowsµÄIDE¶¼ÎªÄã×öÁËÕâ¸ö¹¤×÷£¬µ«ÎÒ¾õµÃÒª×÷Ò»¸öºÃµÄºÍ
professionalµÄ³ÌÐòÔ±£¬makefile»¹ÊÇÒª¶®¡£Õâ¾ÍºÃÏñÏÖÔÚÓÐÕâô¶àµÄHTMLµÄ±à¼Æ÷£¬µ«Èç¹ûÄãÏë³ÉΪһ¸öרҵÈËÊ¿£¬Ä㻹ÊÇÒªÁ˽ ......
LinuxÐÐÒµÕÐÆ¸¼¼ÊõÃæÊÔÌâ»ã×Ü
1. ÔÚLinuxϵͳÖУ¬ÒÔ Îļþ ·½Ê½·ÃÎÊÉ豸 ¡£
2. LinuxÄÚºËÒýµ¼Ê±£¬´ÓÎļþ /etc/fstab ÖжÁȡҪ¼ÓÔØµÄÎļþϵͳ¡£
3. LinuxÎļþϵͳÖÐÿ¸öÎļþÓà i½Úµã À´±êʶ¡£
4. È«²¿´ÅÅÌ¿éÓÉËĸö²¿·Ö×é³É£¬·Ö±ðΪÒýµ¼¿é ¡¢×¨ÓÃ¿é ¡¢ i½Úµã±í¿é ºÍÊý¾Ý´æ´¢¿é¡£
5. Á´½Ó·ÖΪ£º Ó²Á´½Ó ºÍ ·ûºÅÁ´½ ......