Linux ÉÏʵÏÖË«Ïò½ø³Ì¼äͨÐŹܵÀ(ת)
ÎÊÌâºÍ³£¼û·½·¨
Linux ÌṩÁË popen ºÍ pclose º¯Êý (1)£¬ÓÃÓÚ´´½¨ºÍ¹Ø±Õ¹ÜµÀÓëÁíÍâÒ»¸ö½ø³Ì½øÐÐͨÐÅ¡£Æä½Ó¿ÚÈçÏ£º
FILE *popen(const char *command£¬ const char *mode);
int pclose(FILE *stream);
Òź¶µÄÊÇ£¬popen ´´½¨µÄ¹ÜµÀÖ»ÄÜÊǵ¥ÏòµÄ -- mode Ö»ÄÜÊÇ "r" »ò "w" ¶ø²»ÄÜÊÇijÖÖ×éºÏ--Óû§Ö»ÄÜÑ¡ÔñҪôÍùÀïд£¬ÒªÃ´´ÓÖжÁ£¬¶ø²»ÄÜͬʱÔÚÒ»¸ö¹ÜµÀÖнøÐжÁд¡£Êµ¼ÊÓ¦ÓÃÖУ¬¾³£»áÓÐͬʱ½øÐжÁдµÄÒªÇ󣬱ÈÈ磬ÎÒÃÇ¿ÉÄÜÏ£Íû°ÑÎı¾Êý¾ÝËÍÍùsort¹¤¾ßÅÅÐòºóÔÙÈ¡»Ø½á¹û¡£´Ëʱpopen¾ÍÎÞ·¨ÓÃÉÏÁË¡£ÎÒÃÇÐèҪѰÕÒÆäËüµÄ½â¾ö·½°¸¡£
ÓÐÒ»ÖÖ½â¾ö·½°¸ÊÇʹÓà pipe º¯Êý (2)´´½¨Á½¸öµ¥Ïò¹ÜµÀ¡£Ã»ÓдíÎó¼ì²âµÄ´úÂëʾÒâÈçÏ£º
int pipe_in[2], pipe_out[2];
pid_t pid;
pipe(&pipe_in); // ´´½¨¸¸½ø³ÌÖÐÓÃÓÚ¶ÁÈ¡Êý¾ÝµÄ¹ÜµÀ
pipe(&pipe_out); // ´´½¨¸¸½ø³ÌÖÐÓÃÓÚдÈëÊý¾ÝµÄ¹ÜµÀ
if ( (pid = fork()) == 0) { // ×Ó½ø³Ì
close(pipe_in[0]); // ¹Ø±Õ¸¸½ø³ÌµÄ¶Á¹ÜµÀµÄ×Ó½ø³Ì¶Á¶Ë
close(pipe_out[1]); // ¹Ø±Õ¸¸½ø³ÌµÄд¹ÜµÀµÄ×Ó½ø³Ìд¶Ë
dup2(pipe_in[1], STDOUT_FILENO); // ¸´ÖƸ¸½ø³ÌµÄ¶Á¹ÜµÀµ½×Ó½ø³ÌµÄ±ê×¼Êä³ö
dup2(pipe_out[0], STDIN_FILENO); // ¸´ÖƸ¸½ø³ÌµÄд¹ÜµÀµ½×Ó½ø³ÌµÄ±ê×¼ÊäÈë
close(pipe_in[1]); // ¹Ø±ÕÒѸ´ÖƵĶÁ¹ÜµÀ
close(pipe_out[0]); // ¹Ø±ÕÒѸ´ÖƵÄд¹ÜµÀ
/* ʹÓÃexecÖ´ÐÐÃüÁî */
} else { // ¸¸½ø³Ì
close(pipe_in[1]); // ¹Ø±Õ¶Á¹ÜµÀµÄд¶Ë
close(pipe_out[0]); // ¹Ø±Õд¹ÜµÀµÄ¶Á¶Ë
/* ÏÖÔÚ¿ÉÏòpipe_out[1]ÖÐдÊý¾Ý£¬²¢´Ópipe_in[0]ÖжÁ½á¹û */
close(pipe_out[1]); // ¹Ø±Õд¹ÜµÀ
/* ¶ÁÈ¡pipe_in[0]ÖеÄÊ£ÓàÊý¾Ý */
close(pipe_in[0]); // ¹Ø±Õ¶Á¹ÜµÀ
/* ʹÓÃwaitϵÁк¯ÊýµÈ´ý×Ó½ø³ÌÍ˳ö²¢È¡µÃÍ˳ö´úÂë */
}
µ±È»£¬ÕâÑùµÄ´úÂëµÄ¿É¶ÁÐÔ£¨ÌرðÊǼÓÉÏ´íÎó´¦Àí´úÂëÖ®ºó£©±È½Ï²î£¬Ò²²»ÈÝÒ×·â×°³ÉÀàËÆÓÚpopen/pcloseµÄº¯Êý£¬·½±ã¸ß²ã´úÂëʹÓ᣾¿ÆäÔÒò£¬ÊÇpipeº¯Êý·µ»ØµÄÒ»¶ÔÎļþÃèÊö·ûÖ»ÄÜ´ÓµÚÒ»¸öÖжÁ¡¢µÚ¶þ¸öÖÐд£¨ÖÁÉÙ¶ÔÓÚLinuxÊÇÈç´Ë£©¡£ÎªÁËͬʱ¶Áд£¬¾ÍÖ»ÄܲÉÈ¡ÕâôÀÛ׸µÄÁ½¸öpipeµ÷Óá¢Á½¸öÎļþÃèÊö·ûµÄÐÎʽÁË¡£
»ØÒ³Ê×
Ò»¸ö¸üºÃµÄ·½°¸
ʹÓÃpipe¾ÍÖ»ÄÜÈç´ËÁË¡£²»¹ý£¬LinuxʵÏÖÁËÒ»¸öÔ´×ÔBSDµÄsocketpairµ÷Óà (3)£¬¿ÉÒÔʵÏÖÉÏÊöÔÚͬһ¸öÎļþÃèÊö·ûÖнøÐжÁдµÄ¹¦ÄÜ£¨¸Ãµ÷ÓÃĿǰҲÊÇPOSIX¹æ·¶µÄÒ»²¿·Ö (4)£©¡£¸Ãϵͳµ÷ÓÃÄÜ´´½¨Ò»¶Ô
Ïà¹ØÎĵµ£º
ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......
ÏëÕýʽµØÊÔÓÃÒ»ÏÂubuntu£¬×°ÁË9.10 £¬·Ö10GµÄ¿Õ¼ä£¬ÃãÇ¿×ã¹»£¬ÎªÁ˴һ¸öPHP¿ª·¢Æ½Ì¨¡£
ѧУÊǵç×ӿƼ¼´óѧÖÐɽѧԺ£¬ÉÏÍøµÄ·½Ê½ÊÇdr.comÈÏÖ¤£¬windowsϵİ汾ÊÇ3.46£¬ÎÒ×Ô¼º¸ÄÁËһϣ¬¿ÉÒÔÓÃÄÚÍø¡£
wubi°²×°·½Ê½£¬ÉÏÍøËÑË÷µÄ½Ì³Ì£¬·¢ÏÖÐèÒª°²×°build-essential À´±àÒëdr.com£¬ºóÀ´ÕÒµ½ÁËÕâ¸öÍøÕ¾£º
www.drcom-client ......
ubuntu9.10
ĬÈϰ²×°ÁË iBus
ÊäÈë·¨£¬Õâ¸öÊäÈë·¨ºÜºÃÓ㬵«ÊÇĬÈϵ½ÅäÖò»ºÏÀí£¬Òò´ËÓ¦¸ÃÉèÖÃһϡ£
iBus
ÉèÖò½Ö裺
* °²×° ÖÐÎÄÓïÑÔÖ§³Ö£º
ĬÈÏÏ£¬¿ÉÄÜÖÐÎÄÖ§³Ö²¢²»È«£¬Òò´ËÖÐÎÄÊäÈë·¨Ò²²»È«£¬Èç¹ûÖÐÎÄÖ§³ÖÒѾÍêÈ«°²×°ÔòÌø¹ýÕâ²½¡£
Ìí¼ÓÖÐÎÄÖ§³Ö£º
System -> Administrat ......
ÏÖÔںöàµÄÈË¿ªÊ¼½Ó´¥µçÄÔµÄʱºò£¬¼ûµ½µÄÓ¦¸ÃÊÇWindows98˵ʵ»°£¬98 ÒѾÊÇÒ»¸öºÜÈËÐÔ»¯£¬·â×°µÄºÜºÃµÄÒ»¸öϵͳÁËÒ»¸ö¶ÔµçÄÔÒ»Çϲ»Í¨µÄÈ˶¼ÄܺܿìµÄʹÓÃËü¡£ÕâÑùºÜ¶àÈ˶Ô"µçÄÔ"µÄÓ¡ÏóºÍÄÇЩºÍÎÒÒ»ÑùÒ»¿ªÊ¼½Ó´¥µÄÊÇDOSÈËÊǾøÈ»²»Í¬µÄ¡£ÔÚDOSʱ´ú£¬Èç¹ûÄã¶ÔµçÄԵĻù´¡ÖªÊ¶²»¶®µÄ»°ÊÇÍæ²»¶¯ËüµÄ£¬²»ÏñÏÖÔںöàÈËCPUÊÇʲô¶¼²»Ö ......
×÷ΪLinux
ϵijÌÐò¿ª·¢ÈËÔ±£¬´ó¼ÒÒ»¶¨¶¼Óöµ½¹ýMakefile
£¬ÓÃmake
ÃüÁîÀ´±àÒë×Ô¼ºÐ´µÄ³ÌÐòȷʵÊǺܷ½±ã¡£Ò»°ãÇé¿öÏ£¬´ó¼Ò¶¼ÊÇÊÖ¹¤Ð´Ò»¸ö¼òµ¥Makefile
£¬Èç¹ûÒªÏëд³öÒ»¸ö·ûºÏ×ÔÓÉÈí¼þ¹ßÀýµÄMakefile
¾Í²»ÄÇôÈÝÒ×ÁË¡£
¡¡¡¡ÔÚ±¾ÎÄÖУ¬½«¸ø´ó¼Ò½éÉÜÈçºÎʹÓà autoconf
ºÍautomake
Á½¸ö¹¤¾ßÀ´°ïÖúÎÒÃÇ×Ô¶¯µØÉú³É· ......