Linux select()Ïê½â
selectϵͳµ÷ÓÃÊÇÓÃÀ´ÈÃÎÒÃǵijÌÐò¼àÊÓ¶à¸öÎļþ¾ä±ú(file descriptor)µÄ״̬±ä»¯µÄ¡£³ÌÐò»áÍ£ÔÚselectÕâÀïµÈ´ý£¬Ö±µ½±»¼àÊÓµÄÎļþ¾ä±úÓÐijһ¸ö»ò¶à¸ö·¢ÉúÁË״̬¸Ä±ä¡£
ÎļþÔÚ¾ä±úÔÚLinuxÀïºÜ¶à£¬Èç¹ûÄãmanij¸öº¯Êý£¬ÔÚº¯Êý·µ»ØÖµ²¿·Ö˵µ½³É¹¦ºóÓÐÒ»¸öÎļþ¾ä±ú±»´´½¨µÄ¶¼Êǵģ¬Èçman socket¿ÉÒÔ¿´µ½“On success, a file descriptor for the new socket is returned.”¶øman 2 open¿ÉÒÔ¿´µ½“open() and creat() return the new file descriptor”£¬ÆäʵÎļþ¾ä±ú¾ÍÊÇÒ»¸öÕûÊý£¬¿´socketº¯ÊýµÄÉùÃ÷¾ÍÃ÷°×ÁË£º
int socket(int domain, int type, int protocol);
µ±È»£¬ÎÒÃÇ×îÊìϤµÄ¾ä±úÊÇ0¡¢1¡¢2Èý¸ö£¬0ÊDZê×¼ÊäÈ룬1ÊDZê×¼Êä³ö£¬2ÊDZê×¼´íÎóÊä³ö¡£0¡¢1¡¢2ÊÇÕûÊý±íʾµÄ£¬¶ÔÓ¦µÄFILE *½á¹¹µÄ±íʾ¾ÍÊÇstdin¡¢stdout¡¢stderr£¬0¾ÍÊÇstdin£¬1¾ÍÊÇstdout£¬2¾ÍÊÇstderr¡£
±ÈÈçÏÂÃæÕâÁ½¶Î´úÂë¶¼ÊÇ´Ó±ê×¼ÊäÈë¶ÁÈë9¸ö×Ö½Ú×Ö·û£º
#include <stdio.h>
#include <unistd.h>
#include <string.h>
int main(int argc, char ** argv)
{
char buf[1 ......
Linux® ¿É¼ÓÔØÄÚºËÄ£¿é£¨´ÓÄÚºËµÄ 1.2 °æ±¾¿ªÊ¼ÒýÈ룩ÊÇ Linux Äں˵Ä×îÖØÒª´´ÐÂÖ®Ò»¡£ËüÃÇÌṩÁË¿ÉÉìËõµÄ¡¢¶¯Ì¬µÄÄںˡ£Ì½Ë÷Òþ²ØÔڿɼÓÔØÄ£¿éºóÃæµÄÔÀí£¬²¢Ñ§Ï°ÕâЩ¶ÀÁ¢µÄ¶ÔÏóÈçºÎ¶¯Ì¬µØ×ª»»³É Linux Äں˵ÄÒ»²¿·Ö¡£
Linux ¾ÍÊÇͨ³£Ëù˵µÄµ¥Äںˣ¨monolithic kernel£©
£¬¼´²Ù×÷ϵͳµÄ´ó²¿·Ö¹¦Äܶ¼±»³ÆÎªÄÚºË
£¬²¢ÔÚÌØÈ¨Ä£Ê½ÏÂÔËÐС£ËüÓë΢ÐÍÄÚºË
²»Í¬£¬ºóÕßÖ»°Ñ»ù±¾µÄ¹¦ÄÜ£¨½ø³Ì¼äͨÐÅ [IPC]¡¢µ÷¶È¡¢»ù±¾µÄÊäÈë/Êä³ö [I/O]
ºÍÄÚ´æ¹ÜÀí£©µ±×÷ÄÚºËÔËÐУ¬¶ø°ÑÆäËû¹¦ÄÜ£¨Çý¶¯³ÌÐò¡¢ÍøÂç¶ÑÕ»ºÍÎļþϵͳ£©ÅųýÔÚÌØÈ¨¿Õ¼äÖ®Íâ¡£Òò´Ë£¬Äú¿ÉÄÜÈÏΪ Linux
ÊÇÒ»¸öÍêÈ«¾²Ì¬µÄÄںˣ¬µ«ÊÂʵǡǡÏà·´¡£Í¨¹ý Linux ÄÚºËÄ£¿é£¨LKM£©¿ÉÒÔÔÚÔËÐÐʱ¶¯Ì¬µØ¸ü¸Ä Linux¡£
developerWorks ÉÏ Tim ËùÖøµÄÆäËûÆÊÎö……
ϵÁÐÎÄÕÂ
Linux flash ÎļþϵͳÆÊÎö
Security-Enhanced Linux£¨SELinux£©ÆÊÎö
ʵʱ Linux ¼Ü¹¹ÆÊÎö
Linux SCSI ×ÓϵͳÆÊÎö
......
.Wub131 { display:none; }
±¾½²Ö÷Òª¸ÅÊöLinuxÉ豸Çý¶¯¿ò¼Ü¡¢Çý¶¯³ÌÐòµÄÅäÖÃÎļþ¼°³£ÓõļÓÔØÇý¶¯³ÌÐòµÄ·½·¨£»²¢ÇÒ½éÉÜRed Hat Linux°²×°³ÌÐòÊÇÈçºÎ¼ÓÔØÇý¶¯µÄ£¬Í¨¹ýÁ˽âÕâ¸ö¹ý³Ì£¬ ÎÒÃÇ¿ÉÒÔ×Ô¼º½«Çý¶¯³ÌÐò·Åµ½Òýµ¼ÅÌÖУ»°²×°Íêϵͳºó£¬Ê¹ÓÃkudzu×Ô¶¯ÅäÖÃÓ²¼þ³ÌÐò¡£
54com.cn
LinuxÉ豸Çý¶¯¸ÅÊö
ÖйúÍø¹ÜÁªÃËwww.bitscn.com
1. Äں˺ÍÇý¶¯Ä£¿é
ÖйúÍø¹ÜÁªÃËwww¡¢bitsCN¡¢com
²Ù×÷ϵͳÊÇͨ¹ý¸÷ÖÖÇý¶¯³ÌÐòÀ´¼ÝÔ¦Ó²¼þÉ豸£¬ËüΪÓû§ÆÁ±ÎÁ˸÷ÖÖ¸÷ÑùµÄÉ豸£¬Çý¶¯Ó²¼þÊDzÙ×÷
ϵͳ×î»ù±¾µÄ¹¦ÄÜ£¬²¢ÇÒÌṩͳһµÄ²Ù×÷·½Ê½¡£ÕýÈçÎÒÃDz鿴ÆÁÄ»ÉϵÄÎĵµÊ±,²»ÓÃÈ¥¹Üµ½µ×ʹÓÃnVIDIAоƬ£¬»¹ÊÇATIоƬµÄÏÔʾ¿¨£¬Ö»ÐèÖªµÀÊäÈëÃüÁî
ºó£¬ÐèÒªµÄÎÄ×Ö¾ÍÏÔʾÔÚÆÁÄ»ÉÏ¡£Ó²¼þÇý¶¯³ÌÐòÊDzÙ×÷ϵͳ×î»ù±¾µÄ×é³É²¿·Ö£¬ÔÚLinuxÄÚºËÔ´³ÌÐòÖÐÒ²Õ¼ÓнϸߵıÈÀý¡£
Íø¹ÜÍøbitsCN.com
LinuxÄÚºËÖвÉÓÿɼÓÔØµÄÄ£¿é»¯Éè¼Æ£¨LKMs £¬Loadable Kernel Modules£©£¬Ò»°ãÇé¿öϱàÒëµÄLinuxÄÚºËÊÇÖ§³Ö¿É²åÈëʽģ¿éµÄ£¬Ò²¾ÍÊǽ«×î»ù±¾µÄºËÐÄ´úÂë±àÒëÔÚÄÚºËÖУ¬ÆäËüµÄ´úÂë¿ÉÒÔÑ¡ÔñÊÇÔÚÄÚºËÖУ¬»òÕß±àÒëΪÄں˵ÄÄ£¿éÎļþ¡£ ÖйúÍø¹ÜÁªÃËwww.bitscn.com
Èç¹ûÐèҪijÖÖ¹¦ÄÜ£¬±ÈÈçÐèÒª·ÃÎÊÒ»¸öNTFS ......
1¡¢Ê×ÏÈ´ÓÈí¼þ¹ÜÀíÀï°ÑËùÓÐÓйØÓʼþ·þÎñÈí¼þ¶¼×°ÉÏ£¬ÆäÖаüÀ¨ÁË£¬sendmailºÍdovecot
2
¡¢
DN
SÅä
ÖÃ
¡¡¡¡£¨1£©ÐÞ¸Ä/etc/named.conf
£¬´ËÎļþÒ»°ãÊǸöÈíÁ´½Ó£¬Ìí¼ÓÈçÏ£º
zone "excontainer.com" IN {
type master;
file "excontainer.com";
};
zone "47.7.33.10.in-addr.arpa" IN {
type master;
file "10.33.7.zone";
};
¡¡¡¡£¨2£©/etc/resolv.conf
£¨Ìí¼ÓÈçÏ£©
search excontainer.com
nameserver 10.33.7.47
£¨3£©/var/named/*£¨
ÏÂĿ¼Îļþ¶¼ÊÇÈíÁ´½Ó£¬ÎÒÃÇÒªµ½/var/named/chroot/var/named/*Ͻ¨Á¢Îļþ£¬È»ºóLINKµ½Õâ¸öÎļþÀ
ÕýÏò½âÎöÎļþexcontainer.comÎļþÀïÄÚÈÝ£º
$TTL 86400
@ IN SOA excontainer.com. root.excontainer.com. (
&nb ......
ÔÚÌÖÂÛÕâ¸öÎÊÌâ֮ǰ£¬ÎÒÃÇÏÈÀ´¿´¿´Linux×ÀÃæÓöµ½ÁËʲôÀ§ÄÑ¡£
Ŀǰ£¬LinuxÔÚ×ÀÃæÉϵÄÊг¡Õ¼ÓÐÂʾÝÓйط½Ãæ¹À¼ÆÔÚ1%×óÓÒ£¬Õâ¸ö±ÈÀýÉõÖÁ»¹²»ÈçAppleµÄMac OS X£¬È˼ҵÄÊг¡Õ¼ÓÐÂÊÒ²ÓÐ4%ÒÔÉÏ¡£¸ü±ðÌáMS Windows°Ù·ÖÖ®¾ÅÊ®ÒÔÉϵÄÊг¡Õ¼ÓÐÂÊ£¬¿ÉÒÔ˵Linux×ÀÃæËÆºõ¿ÉÒÔºöÂÔ²»¼Æ¡£ÔÚÖйúMSÒ»¼Ò¶À´óµÄ¾ÖÃæ¸üÊÇÈç´Ë£¬ÎÒ¹ú±¾ÊÇÊÀ½çÉÏ×î´óµÄ·¢Õ¹Öйú¼Ò£¬µ«°º¹óµÄWindowsϵͳµÄÕ¼ÓÐÂÊÈ´±ÈÈκÎÒ»¸ö¹ú¼Ò¶¼¸ß£¬ºÃÏñÎÒ¹úºÜÓÐÇ®ËÆµÄ¡£
ÁíÒ»·½Ã棬LinuxµÄʹÓÃÈËȺ·¶Î§¼°ÆäÕ£¬Ö»ÓÐÉÙÊýµÄ¿ª·¢ÈËÔ±ºÍ×ÔÓÉÈí¼þ°®ºÃÕßÔÚʹÓÃLinux¡£ÔÚ¼ÆËã»úרҵѧÉúÈËȺÖУ¬Á˽âºÍʹÓÃLinuxµÄѧÉúÒ²²¢²»¶à£¬ËûÃÇ»¹ÔÚD°æµÄWindowsÏÂÍæ×Å×Ô¼ºµÄÓÎÏ·ºÍ¿´×Å×Ô¼ºµÄµçÓ°£¬ºÁ²»ÖªµÀµ±Ç°Èí¼þ²úÒµµÄ·¢Õ¹·½Ïò£¬´ÓÀ´Ò²²»·´Ê¡·´Ê¡D°æµÄÈí¼þÓõ½Ê²Ã´Ê±ºò²ÅÊǾ¡Í·£¬´ÓÀ´²»Îª¹ú¼ÒµÄÈí¼þ²úÒµÏëÒ»Ïë¡£ÕâÓë¹ú¼ÊÉÏÅ·¢Õ¹µÄ×ÔÓÉ¿ªÔ´Èí¼þÔ˶¯¼«²»Ïà·û¡£
Linux¾¹ýÕâô¶àÄêµÄ·¢Õ¹£¬Æäƽ̨ÉϵÄÈí¼þÒ²±È½Ï·á¸»ÁË£¬µ«ÏÖ½ñºÜ¶àµÄ×ÀÃæ¼¶Ó¦ÓÃÈí¼þ»¹ÊDZȽÏȱ·¦£¬ÓÈÆäÊÇÓéÀÖºÍÓÎÏ··½Ãæ¡£ÁíÍâLinuxÉϺܶà×ÀÃæÈí¼þµÄÒ×ÓÃÐÔºÍÖÇÄÜÐԽϲ°²×°£¬Å ......
ubuntu ϱàÒë linux fetion Ó¦ÓóÌÐòdemo
×¢£ºÕâÀï¸ø³ö½çÃæÄ£¿éµÄÔ´´úÂ룬¶ølibfetion¿â(32λ)ÔòÊÇÒÔ¾²Ì¬¿âµÄÐÎʽ·Å½øÈ¥ÁË¡£
1£º½¨Á¢±àÒë»·¾³£º
ÔÚÖÕ¶ËÖ´ÐÐÒÔÏÂÃüÁ
sudo apt-get install automake
sudo apt-get install libc-dev
sudo apt-get install g++
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libqt4-dev qt4-dev-tools
2£ºÏÂÔØÔ´´úÂ룺
Ô´ÂëÏÂÔØ£º http://www.libfetion.cn/Linux_demoapp_download.html
½âѹÃüÁtar -zxvf linux_fetion-0.*.*.tar.gz
½øÈëÔ´´úÂëĿ¼£º cd linux_fetion-0.*.*
(64λÓû§ÐèÖ´ÐÐ: ./64_libfetion.sh ½Å±¾)
ÔËÐбàÒëÃüÁ qmake-qt4
make
°²×°³ÌÐò£º./install.sh
×¢Ò⣺QT°æ±¾ÎªÊÇ4.3.*ÒÔÉϵġ£
Èç¹ûÄãÊÇÓÃ4.2.*ÒÔϰ汾£¬Äã¿ÉÒÔ£º
(1) ÓÃ4.2.*һϰ汾µÄdesigner ³ÌÐò´ò¿ª±àÒë³ö´íµÄ *.uiÎļþ¡£
(2) ×¢Ê͵ôһЩ4.2.*һϰ汾ÖÐûÓеĺ¯Êý¡£
......