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

linuxÍøÂç±à³Ì

 ¹ØÓÚlinuxµÄ¶Áд²Ù×÷
½¨Á¢ÁËÁ¬½Ó,¾Í¿ÉÒÔ½øÐÐͨѶÁË,ÍùÎļþÃèÊö·ûÀï¶Áд,ºÍ¶ÁдÎļþÊÇÒ»ÑùµÄ.
дº¯Êý:
ssize_t write(int fd,(void *)buf,size_t nbytes)
½«bufÖеÄnbytesдÈëµ½fdÖÐ,³É¹¦Ê±·µ»ØËùдµÄ×Ö½ÚÊý,ʧ°Üʱ·µ»Ø-1,²¢Ð´Èëerrno±äÁ¿.
µ±ÎÒÃÇÏóÌ×½Ó×ÖдÊý¾Ýʱ,¿ÉÄÜ»áÓÐÁ½ÖÖÇé¿ö:
a.writeµÄ·µ»ØÖµ´óÓÚ0,±íʾдÁ˲¿·Ö»òÕßÊÇÈ«²¿µÄÊý¾Ý
b.·µ»ØµÄֵСÓÚ0,´Ëʱ³öÏÖÁË´íÎó.ÎÒÃÇÒª¸ù¾Ý´íÎóÀàÐÍÀ´´¦Àí
Èç¹û´íÎóΪEINTR±íʾÔÚдµÄʱºò³öÏÖÁËÖжϴíÎó.
Èç¹ûΪEPIPE±íʾÍøÂçÁ¬½Ó³öÏÖÁËÎÊÌâ(¶Ô·½ÒѾ­¹Ø±ÕÁËÁ¬½Ó).
¶Áº¯Êý:
ssize_t read(int fd,(void *)buf,size_t nbytes)
´ÓfdÖжÁÄÚÈÝ,µ±¶Á³É¹¦Ê±,·µ»Ø¶ÁÈëµÄ×Ö½ÚÊý,·µ»ØÊÇ0,Ôð±íʾÒѾ­¶ÁÈëµ½Îļþ½áÊøÁË,СÓÚ0±íʾ³öÏÖÁË´íÎó.
Êý¾Ý±¨µÄ·¢ËÍ:
int recvfrom(int sockfd,void *buf,int len,unsigned int flags,struct sockaddr *from,int *fromlen);
int sendto(int sockfd,const void *msg,int len,unsigned int flags,struct sockaddr *to,int tolen);
sockfd,buf,lenµÄÒâÒåºÍread,writeÒ»Ñù,·Ö±ð±íʾÌ×½Ó×ÖÃèÊö·û,·¢ËÍ»ò½ÓÊյĻº³åÇø¼°´óС.recvfrom¸ºÔð´Ósockfd½ÓÊÕÊý¾Ý,Èç¹ûfrom²»NULL,ÄÇôÔÚfromÀïÃæ´æ´¢ÁËÐÅÏ¢À´Ô´µÄÇé¿ö,Èç¹û¶ÔÐÅÏ¢µÄÀ´Ô´²»¸ÐÐËȤ,¿ÉÒÔ½«fromºÍfromlenÉèÖÃΪNULL.sendto¸ºÔðÏòto·¢ËÍÐÅÏ¢.´ËʱÔÚtoÀïÃæ´æ´¢ÁËÊÕÐÅÏ¢·½µÄÏêϸ×ÊÁÏ.
¸ß¼¶Ì×½Ó×Öº¯Êý:
int recv(int sockfd,void *buf,int len,int flags)
int send(int sockfd,void *buf,int len,int flags)
Ç°ÃæµÄÈý¸ö²ÎÊýºÍread()ºÍwrite()º¯ÊýÒ»ÑùµÄ,²ÎÊýflags¿ÉÒÔÊÇ0»òÕßÒÔÏÂÈκÎÒ»Ïî:
MSG_DONTROUTE:ÊÇsend()º¯ÊýʹÓõıêʶ,¸æËßIPЭÒé,Ä¿µÄÖ÷»úÔÚ±¾ÍøÂçÉÏÃæ,ûÓбØÒª²éÕÒ·Óɱí;
MSG_OOB:½ÓÊÜ»òÕß·¢Ë͸½´øÊý¾Ý;
MSG_PEEK:recv()º¯ÊýʹÓõIJÎÊý,±íʾֻ´Óϵͳ»º³åÇøÖжÁÈ¡Êý¾Ý,¶ø²»Çå³ýϵͳ»º³åµÄÄÚÈÝ,Ò»°ãÔÚ¶à¸ö½ø³Ì¶ÁдÊý¾ÝµÄʱºòʹÓÃ;
MSG_WAITALL:ÊÇrecv()º¯ÊýʹÓõIJÎÊý,±íʾµÈµ½ËùÓеÄÊý¾Ýµ½´ïºó²Å·µ»Ø.ʹÓÃÕâ¸ö²ÎÊýʱ,recv()º¯Êý»áÒ»Ö±×èÈû.
Ì×½Ó×ֵĹرÕ:
Ì×½Ó×ֵĹرÕÓÐÁ½¸öº¯Êý:
shutdown()ºÍclose()
int shutdown(int sockfd,int howto)
TCPÁ¬½ÓÊÇË«ÏòµÄ(ÊǿɶÁдµÄ),µ±ÎÒÃÇʹÓÃcloseʱ,»á°Ñ¶ÁдͨµÀ¶¼¹Ø±Õ,ÓÐʱºîÎÒÃÇÏ£ÍûÖ»¹Ø±ÕÒ»¸ö·½Ïò,Õâ¸öʱºòÎÒÃÇ¿ÉÒÔʹÓÃshutdown.Õë¶Ô²»Í¬µÄhowto,ϵͳ»Ø²ÉÈ¡²»Í¬µÄ¹Ø±Õ·½Ê½.
howto=0Õâ¸öʱºòϵͳ»á¹Ø±Õ¶ÁͨµÀ.µ«ÊÇ¿ÉÒÔ¼ÌÐøÍù½Ó×ÖÃèÊö·ûд.
howto=1¹Ø


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì£¨ËÄ£© L2CAP²ã±à³Ì

£¨L2CAPЭÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPЭÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼­Á¬½Ó¿ØÖƺÍÊÊÅäЭÒé (L2CAP) ΪÉϲãЭÒéÌṩÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àЭÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãЭÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......

linuxºê¶¨Òårequest_mem_region()

 
»ùÓÚI/O RegionµÄ²Ù×÷º¯Êý__XXX_region()£¬LinuxÔÚÍ·Îļþinclude/linux/ioport.hÖж¨ÒåÁËÈý¸ö¶ÔI/OÄÚ´æ×ÊÔ´½øÐвÙ×÷µÄºê£º
¡¡¡¡¢Ùrequest_mem_region()ºê£¬ÇëÇó·ÖÅäÖ¸¶¨µÄI/OÄÚ´æ×ÊÔ´¡£
¡¡¡¡¢Úcheck_ mem_region()ºê£¬¼ì²éÖ¸¶¨µÄI/OÄÚ´æ×ÊÔ´ÊÇ·ñÒѱ»Õ¼Óá£
¡¡¡¡¢Ûrelease_ mem_region()ºê£¬ÊÍ·ÅÖ¸¶¨µÄI/OÄÚ´æ×ÊÔ ......

Linux»·¾³MySQLµÄC±à³ÌÆð²½

Ê×ÏÈ°²×°±ØÐèµÄ¿ª·¢
°ü
sudo apt-get install gcc g++ libgcc1 libg++ make gdb
°²×°MYSQLµÄCÓïÑÔ¿ª·¢°ü
sudo apt-get install libmysql++-dev libmysql++2c2a libmysqlclient15-dev libmysqlclient15off
°ÑlibÎļþ¿½±´µ½¹«ÓÃ
sudo cp /usr/lib/mysql/* /usr/lib/
½¨Á¢Ò»¸öÐÂÎļþtest.cpp
vim test.cpp
ÊäÈëÄÚÈÝ
......

ÉîÈëÀí½âLinuxµÄϵͳµ÷ÓÃ

Ò»¡¢ ʲôÊÇϵͳµ÷ÓÃ
 
ÔÚLinuxµÄÊÀ½çÀÎÒÃǾ­³£»áÓöµ½ÏµÍ³µ÷ÓÃÕâÒ»ÊõÓËùνϵͳµ÷Ó㬾ÍÊÇÄÚºËÌṩµÄ¡¢¹¦ÄÜÊ®·ÖÇ¿´óµÄһϵÁеĺ¯Êý¡£ÕâЩϵͳµ÷ÓÃÊÇÔÚÄÚºËÖÐʵÏֵģ¬ÔÙͨ¹ýÒ»¶¨µÄ·½Ê½°Ñϵͳµ÷ÓøøÓû§£¬Ò»°ã¶¼Í¨¹ýÃÅ(gate)ÏÝÈë(trap)ʵÏÖ¡£ÏµÍ³µ÷ÓÃÊÇÓû§³ÌÐòºÍÄں˽»»¥µÄ½Ó¿Ú¡£
 
¶þ¡¢ ϵͳµ÷ÓõÄ×÷Ó ......

LinuxÖ®NFS·þÎñÆ÷°²×°ÅäÖÃ

 Èç¹ûÔÚRed Hat 9°²×°Ê±ÒѾ­Ä¬ÈÏ°²×°ÁËNFS×é¼þ£¬½ÓÏÂÀ´µÄ¹¤×÷Ö÷ÒªÊÇÅäÖÃÏà¹ØÎļþʹ·þÎñÆ÷ÌṩNFS·þÎñ£¬²½ÖèÈçÏ¡£
¡¡¡¡£¨1£©É趨ij̨¼ÆËã»úΪNFS·þÎñÆ÷£¬²¢ÔÚºǫ́Æô¶¯Ïà¹ØµÄÊØ»¤½ø³Ì£¨ÔÚ"·þÎñÅäÖÃ"ÖÐÆô¶¯£©¡£Ò»°ãÀ´Ëµ£¬Èç¹ûNFS·þÎñÆ÷ÒªÌṩ·þÎñ£¬±ØÐëÆô¶¯inet¡¢portmap¡¢nfsºÍmountÕâ4¸öÊØ»¤½ø³Ì²¢±£³ÖÔÚºó ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ