Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

linux½ø³ÌͨÐÅ ÐźÅÁ¿Ê¹ÓÃ

±êÌ⣺Linux½ø³ÌͨÐÅ-ʹÓÃÐźÅÁ¿
Ò»¡¢Ïà¹ØÖªÊ¶
 ÐźÅÁ¿£ºÒ»¸öÕûÊý£»
  ´óÓÚ»òµÈÓÚ0ʱ´ú±í¿É¹©²¢·¢½ø³ÌʹÓõÄ×ÊԴʵÌåÊý£»
  СÓÚ0ʱ´ú±íÕýÔڵȴýʹÓÃÁÙ½çÇøµÄ½ø³ÌÊý£»
  ÓÃÓÚ»¥³âµÄÐźÅÁ¿³õʼֵӦ´óÓÚ0£»
  Ö»ÄÜͨ¹ýP¡¢VÔ­Óï²Ù×÷¶ø¸Ä±ä£»
 ÐźÅÁ¿ÔªËØ×é³É£º
  1¡¢±íʾÐźÅÁ¿ÔªËصÄÖµ£»
  2¡¢×îºó²Ù×÷ÐźÅÁ¿ÔªËصĽø³ÌID
  3¡¢µÈ´ýÐźÅÁ¿ÔªËØÖµ+1µÄ½ø³ÌÊý£»
  4¡¢µÈ´ýÐźÅÁ¿ÔªËØÖµÎª0µÄ½ø³ÌÊý£»
 
¶þ¡¢Ö÷Òªº¯Êý
 
 1.1 ´´½¨ÐźÅÁ¿
 int semget(
  key_t key,  //±êʶÐźÅÁ¿µÄ¹Ø¼ü×Ö£¬ÓÐÈýÖÖ·½·¨£º1¡¢Ê¹ÓÃIPC——PRIVATEÈÃϵͳ²úÉú£¬
     // 2¡¢Ìôѡһ¸öËæ»úÊý£¬3¡¢Ê¹ÓÃftok´ÓÎļþ·¾¶ÃûÖвúÉú
  int nSemes,  //ÐźÅÁ¿¼¯ÖÐÔªËØ¸öÊý
  int flag  //IPC_CREAT£»IPC_EXCL Ö»ÓÐÔÚÐźÅÁ¿¼¯²»´æÔÚʱ´´½¨
 )
 ³É¹¦£º·µ»ØÐźÅÁ¿¾ä±ú
 Ê§°Ü£º·µ»Ø-1
 
 1.2 ʹÓÃftokº¯Êý¸ù¾ÝÎļþ·¾¶Ãû²úÉúÒ»¸ö¹Ø¼ü×Ö
 key_t ftok(const char *pathname,int proj_id);
 Â·¾¶Ãû³Æ±ØÐëÓÐÏàӦȨÏÞ
 
 1.3 ¿ØÖÆÐźÅÁ¿
 int semctl(
  int semid,  //ÐźÅÁ¿¼¯µÄ¾ä±ú
  int semnum,  //ÐźÅÁ¿¼¯µÄÔªËØÊý
  int cmd,  //ÃüÁî
  /*union senum arg */... // 
 )
 ³É¹¦£º·µ»ØÏàÓ¦µÄÖµ
 Ê§°Ü£º·µ»Ø-1
 
 ÃüÁîÏêϸ˵Ã÷:
 cmd:   IPC_RMID ɾ³ýÒ»¸öÐźÅÁ¿
  IPC_EXCL Ö»ÓÐÔÚÐźÅÁ¿¼¯²»´æÔÚʱ´´½¨
  IPC_SET ÉèÖÃÐźÅÁ¿µÄÐí¿ÉȨ
  SETVAL ÉèÖÃÖ¸¶¨ÐźÅÁ¿µÄÔªËØµÄֵΪ agc.val
  GETVAL »ñµÃÒ»¸öÖ¸¶¨ÐźÅÁ¿µÄÖµ
  GETPID »ñµÃ×îºó²Ù×Ý´ËÔªËØµÄ×îºó½ø³ÌID
  GETNCNT »ñµÃµÈ´ýÔªËØ±äΪ1µÄ½ø³ÌÊý
  GETZCNT »ñµÃµÈ´ýÔªËØ±äΪ0µÄ½ø³ÌÊý
 
 union senum ¶¨ÒåÈçÏ£º
 union senum{
  int val;
  struct semid_ds *buf;
  unsigned short * array;
 }agc;
 ÆäÖÐ semid_ds ¶¨ÒåÈçÏ£º
 struct semid_ds{
  struct ipc_pem sem_pem;  //operation pemission struct
  time_t sem_otime;  //last semop()time
  time_t sem_ctime;  //last


Ïà¹ØÎĵµ£º

Linux ¸÷Ä£¿é¼Ü¹¹Í¼


 
  Resources on the site
• Interactive map of GNU/Linux OS and FOSS
• "GNU/Linux is my home" - map of GNU/Linux system
• Interactive map of Linux kernel
• Linux inside
• Linux Technology Reference (single page view)
• Linux kernel diagram
• Li ......

linux ͼÐνçÃæ

¹ØÓÚlinuxͼÐνçÃæµÄ»ù±¾ÖªÊ¶
×÷Õß:GuCuiwen email:win2linux@163.com 
    ºÜ¶àLinux³õѧÕß·Ö²»Çå³þLinuxºÍXÖ®¼ä, XºÍXfree86Ö®¼ä, XºÍKDE, GNOMEµÈÖ®¼äÊÇʲô¹ØÏµ. ³£³£»ìÏý¸ÅÄî,ÎÒÏëÒԱȽÏÒ×ÓÚÀí½âµÄ·½Ê½ËµÃ÷Ò»ÏÂX,X11,XFREE,WM,KDE,GNOMEµÈÖ®¼äµÄ¹ØÏµ.ÓÉÓÚ±¾ÈËˮƽÓÐÏÞ¿ÉÄÜ´æÔÚ´íÎó,Çë¸ßÊÖÖ¸Õý ......

Linux ѧϰʹÓà iptables


ÔÚÕýʽ½éÉÜ iptables
µÄʹÓÃ
֮ǰ£¬ÎÒÃÇÏÈÀ´¿´Ò»ÏÂºÍ iptables

Ïà¹ØµÄһЩ»ù±¾¸ÅÄî¡£ÎÒÃÇÏÂÃæ½«»áƵ·±Ê¹ÓÃ
µ½
ËüÃÇ¡£
Æ¥Å䣨match£©£º·ûºÏÖ¸¶¨µÄÌõ¼þ£¬±ÈÈçÖ¸¶¨µÄ IP µØÖ·ºÍ¶Ë¿Ú¡£
¶ªÆú£¨drop£©£ºµ±Ò»¸ö°üµ½´ïʱ£¬¼òµ¥µØ¶ªÆú£¬²»×öÆäËüÈκδ¦Àí¡£
½ÓÊÜ£¨accept£©£ººÍ¶ªÆúÏà·´£¬½ÓÊÜÕâ¸ö°ü£¬ÈÃÕâ¸ö°üͨ¹ý¡£
¾ ......

LinuxÏÂMySQL5.1µÄ°²×°

×î½üÏëÔÚ·þÎñÆ÷ÉÏÊÔÊÔMySQL5.1µÄ·ÖÇø£¬ÓÚÊǾÍÏë×Å×°¸öMySQL5.1£¬¾­¹ýÍ´¿àµÄÒ»¶Î¾­Àúºó£¬ÖÕÓÚÕÒ¸öÏÂÃæ×°¸öºÜºÃµÄ½Ì³Ì£¬ÌûÉÏÀ´±¸Íü¡£
1¡¢MySQLÃâ°²×°°æ/¶þ½øÖưæÈí¼þ£¬²»ÓñàÒ룬ÏÂÔØµØÖ·£º
     http://dev.mysql.com/downloads/
     Îļþ¸ñʽ£ºMYSQL-VERSION-OS.tar.gz
2¡¢´ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ