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
Ïà¹ØÎĵµ£º
´´½¨×ÀÃæÍ¼±ê
Ŀǰ½«ÍøÂçÓ¦ÓÃÀ©Õ¹µ½×ÀÃæÊÇÒ»¸öÇ÷ÊÆ£¬´æÔÚןܶà½â¾ö·½°¸£¬±¾ÎÄÒÔ Mozilla Prism ΪÀý£¬ÀàËÆµÄ·½·¨Í¬ÑùÊÊÓÃÓÚ Google Chrome ¡£
1. µ½ Mozilla Prism µÄÍøÕ¾ÉÏÏÂÔØ Prism£¬µã»÷ Download Now Ö®ºó»áÌáʾÓÐÁ½ÖÖ£¬Ò»ÖÖÊÇÒÔ Mozilla Firefox À©Õ¹µÄ·½Ê½£¬ÊʺÏÒѾ°²×°ÓÐ Firefox µÄÅóÓÑ£»Ò»Ö ......
Ò»¡¢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 ......
ÎÄÕÂÀ´Ô´£ºhttp://blog.chinaunix.net/u1/51562/showart_405963.html
http://ericxiao.cublog.cn/¶ÔÄÚºËÔ´Âë·ÖÎöµÄ±È½ÏÏêϸ£¬¸ÐлÎÄÕÂ×÷ÕßÎÞ˽·îÏ×
±¾ÎÄ»¶Ó×ªÔØ!
×ªÔØÇë×¢Ã÷³ö´¦:http://ericxiao.cublog.cn/
------------------------------------------
<<prison break>>µÚÈý¼¾µÄµÚÎ弯£¬ÖÕÓÚÔÚÇÌÊׯóÅÎ ......
Ŀ¼Ë÷Òý
Ò»¡¢ÓëÓû§¹ÜÀíÏà¹ØµÄ
ÅäÖÃÎļþ£»
1¡¢/etc
/passwd ºÍ/etc/groups
2¡¢³¬¼¶È¨
ÏÞ¿ØÖÆ sudo µÄÅäÖÃÎļþ/etc/sudoers £»
3¡¢Ìí¼ÓÓÃ
»§¹æÔòÎļþ /etc/login.defs ºÍ /etc/default/useradd
¶þ¡¢Ìí¼ÓÓû§¹¤¾ßºÍ·½
·¨£»
1¡¢useradd
¹¤¾ß£»
1.1¡¢
useraadd ÃüÁîÖÐµÄ -DÔËÓÃ
1.2¡¢
useradd Ìí¼ÓÓû§£»
......
ÔÚÕýʽ½éÉÜ iptables
µÄʹÓÃ
֮ǰ£¬ÎÒÃÇÏÈÀ´¿´Ò»ÏÂºÍ iptables
Ïà¹ØµÄһЩ»ù±¾¸ÅÄî¡£ÎÒÃÇÏÂÃæ½«»áƵ·±Ê¹ÓÃ
µ½
ËüÃÇ¡£
Æ¥Å䣨match£©£º·ûºÏÖ¸¶¨µÄÌõ¼þ£¬±ÈÈçÖ¸¶¨µÄ IP µØÖ·ºÍ¶Ë¿Ú¡£
¶ªÆú£¨drop£©£ºµ±Ò»¸ö°üµ½´ïʱ£¬¼òµ¥µØ¶ªÆú£¬²»×öÆäËüÈκδ¦Àí¡£
½ÓÊÜ£¨accept£©£ººÍ¶ªÆúÏà·´£¬½ÓÊÜÕâ¸ö°ü£¬ÈÃÕâ¸ö°üͨ¹ý¡£
¾ ......