Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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ÏÂʵÏÖweb qqµÄ×ÀÃæ»¯


´´½¨×ÀÃæÍ¼±ê
Ŀǰ½«ÍøÂçÓ¦ÓÃÀ©Õ¹µ½×ÀÃæÊÇÒ»¸öÇ÷ÊÆ£¬´æÔÚןܶà½â¾ö·½°¸£¬±¾ÎÄÒÔ Mozilla Prism ΪÀý£¬ÀàËÆµÄ·½·¨Í¬ÑùÊÊÓÃÓÚ Google Chrome ¡£
1. µ½ Mozilla Prism µÄÍøÕ¾ÉÏÏÂÔØ Prism£¬µã»÷ Download Now Ö®ºó»áÌáʾÓÐÁ½ÖÖ£¬Ò»ÖÖÊÇÒÔ Mozilla Firefox À©Õ¹µÄ·½Ê½£¬ÊʺÏÒѾ­°²×°ÓÐ Firefox µÄÅóÓÑ£»Ò»Ö ......

ÔÚLinuxÏÂÅäÖÃjdk»·¾³

Ò»¡¢JDKÏÂÔØ:http://java.sun.comÏÂÔØ×Ô½âѹ°ü:jdk.bin
#sh jdk.bin °´ÌáʾѡÔñyes¡£µ½´ËJDKÒѾ­°²×°Íê³É
¶þ¡¢ÉèÖû·¾³±äÁ¿
¼ÙÈçjdk°²×°µ½ÁË/usrĿ¼Ï¡£ÔÚ/etc/profileÖеÄ×îµ×¶ËÀïдÈëÈçÏÂ:
#vi /etc/profile
#Set Environment by NetSeek (2005/9/5)
export JAVA_HOME=/usr/jdk
export JRE_HOME=/usr/jdk/jre
PA ......

LinuxÖ®Ïß³Ìͬ²½Æª

½øÐжàÏ̱߳à³Ì£¬×îÍ·Ì۵ľÍÊÇÄÇЩ¹²ÏíµÄÊý¾Ý¡£ÒòΪÄãÎÞ·¨ÖªµÀÄĸöÏ̻߳áÔÚÄĸöʱºò¶ÔËü½øÐвÙ×÷£¬ÄãÒ²ÎÞ·¨µÃÖªÄǸöÏ̻߳áÏÈÔËÐУ¬ÄĸöÏ̻߳áºóÔËÐС£ÏÂÃæ½éÉÜһЩ¼¼Êõ£¬Í¨¹ýËûÃÇ£¬Äã»áºÏÀí°²ÅÅÄãµÄÏß³ÌÖ®¼ä¶Ô×ÊÔ´µÄ¾ºÕù¡£
l         »¥³âÌåMutex
l    &nbs ......

Linux×Ö·û¼¯ ÒÔ¼° ÍøÂçͨÐżàÌý

²é¿´µ±Ç°ÅäÖÃ×Ö·û¼¯ locale 
²é¿´È«²¿×Ö·û¼¯ locale -a
ÉèÖÃ×Ö·û¼¯ export LANG=zh_CN.gbk
easy
tcpdump Ò»¸ölinux¼àÌýÍøÂç·ÃÎʵŤ¾ß
¼àÌý·þÎñÆ÷¼°¶Ë¿Ú
tcpdump -nn -i eth0 src host www.codigg.com and src port 80
ÕýÔÚʹÓõÄsql
tcpdump -s 0 -l -w - dst port 3306 | strings ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ