LINUXÆÚÄ©¸´Ï° ½ø³ÌÓë½ø³Ì¹ÜÀí
Ò»¡¢LINUXµÄ½ø³Ì״̬ ½©ËÀ̬£ºµ±¸¸½ø³Ì»¹Ã»ÓнáÊøÇ°£¬×Ó½ø³Ì¾ÍÒѾÏȽáÊøÁË£¬Õâʱ×Ó½ø³ÌµÄ×ÊԴûÓÐÈËÀ´»ØÊÕ¡£Í¨³£¸¸½ø³ÌÐèÒªÓÃwaitÀ´µÈ´ý×Ó½ø³ÌµÄ½áÊø¡£
½ø³ÌµÄģʽ£ºÓû§Ä£Ê½(Ö´ÐÐÓû§³ÌÐò)£¬ÄÚºËģʽ(Ö´ÐвÙ×÷ϵͳ´úÂë)
½ø³ÌµÄÀàÐÍ£ºÏµÍ³½ø³Ì£¬Óû§½ø³Ì ¶þ¡¢½ø³Ì¹ÜÀí ¢Ùforkº¯Êý
¹¦ÄÜ£º´´½¨Ò»¸öȫеĽø³Ì¡£
Í·Îļþ£º
#include
#include
º¯ÊýÔÐÍ£ºpid_t wait (int * status);
˵Ã÷£ºÕâ¸öϵͳµ÷ÓöԵ±Ç°½ø³Ì½øÐи´ÖÆ£¬ÔÚ½ø³Ì±íÀï´´½¨³öÒ»¸öÏîÄ¿£¬Ð½ø³ÌÓëÔ½ø³Ì¼¸ºõÒ»Ñù£¬Ö´ÐеÄÊÇÏàͬµÄ´úÂ룬ֻÊÇнø³ÌÓÐ×Ô¼ºµÄÊý¾Ý¿Õ¼ä¡¢»·¾³ºÍÎļþÃèÊö·û¡£
·µ»ØÖµ£º¸¸½ø³Ìµ÷Ó÷µ»ØÐÂ×Ó½ø³ÌID£¬Ð½ø³Ì¼ÌÐøÖ´ÐУ»ÔÚ×Ó½ø³Ì·µ»Ø0¡£
¾ÙÀý£º
pid_t new_pid;
new_pid = fork();
switch(new_pid)
{
case -1:break;
case 0:break
default:break;
} ¢Úwaitº¯Êý
º¯Êý´¦ÀíµÄ»ù±¾¹ý³Ì£º
—Èç¹û¸¸½ø³ÌûÓÐ×Ó½ø³Ì£¬Ôò³ö´í·µ»Ø¡£
—Èç¹û·¢ÏÖÓÐÒ»¸öÖÕÖ¹µÄ×Ó½ø³Ì£¬ÔòÈ¡³ö×Ó½ø³ÌµÄ½ø³ÌºÅ£¬°Ñ×Ó½ø³ÌµÄCPUʹÓÃʱ¼äµÈ¼Óµ½¸¸½ø³ÌÉÏ£¬ÊÍ·Å×Ó½ø³ÌÕ¼ÓõÄtask_structºÍϵͳ¿Õ¼ä¶ÑÕ»£¬ÒÔ¹©Ð½ø³ÌʹÓá£
—Èç¹û·¢ÏÖÓÐ×Ó½ø³Ì£¬µ«¶¼²»´¦ÓÚÖÕֹ̬£¬Ôò¸¸½ø³Ì˯Ãߣ¬µÈ´ýÓÉÏàÓ¦µÄÐźŻ½ÐÑ¡£
¹¦ÄÜ£ºµÈ´ý×Ó½ø³ÌÖжϻò½áÊø
Í·Îļþ:
#include
#include
º¯ÊýÔÐÍ:pid_t wait (int * status);
˵Ã÷£ºº¯Êý»áÔÝʱֹͣĿǰ½ø³ÌµÄÖ´ÐУ¬Ö±µ½ÓÐÐźÅÀ´µ½»ò×Ó½ø³Ì½áÊø¡£Èç¹ûÔÚµ÷ÓÃwait()ʱ×Ó½ø³ÌÒѾ½áÊø£¬Ôòwait()»áÁ¢¼´·µ»Ø×Ó½ø³Ì½áÊø״ֵ̬¡£×Ó½ø³ÌµÄ½áÊø״ֵ̬»áÓɲÎÊýstatus ·µ»Ø£¬¶ø×Ó½ø³ÌµÄ½ø³Ìʶ±ðÂëÒ²»áͬʱ·µ»Ø¡£Èç¹û²»ÔÚÒâ½áÊø״ֵ̬£¬Ôò²ÎÊýstatus¿ÉÒÔÉè³ÉNULL¡£×Ó½ø³ÌµÄ½áÊø״ֵ̬Çë²Î¿¼waitpid()¡£
·µ»ØÖµ£ºÈç¹ûÖ´Ðгɹ¦Ôò·µ»Ø×Ó½ø³Ìʶ±ðÂë(PID)£¬Èç¹ûÓдíÎó·¢ÉúÔò·µ»Ø-1¡£Ê§°ÜÔÒò´æÓÚerrnoÖС£
¾ÙÀý£º
¢Ûexeclº¯Êý
Í·Îļþ£º#include
º¯ÊýÔÐÍ£º
int execl(const char * path,const char * arg,....);
·µ»ØÖµ£º³É¹¦Ôòº¯Êý²»»á·µ»Ø£¬Ö´ÐÐʧ°ÜÔòÖ±½Ó·µ»Ø-1£¬Ê§°ÜÔÒò´æÓÚerrnoÖС£
˵Ã÷£º
execl()ÓÃÀ´Ö´ÐвÎÊýpath×Ö·û´®Ëù´ú±íµÄÎļþ·¾¶£¬²ÎÊý´ú±íÖ´ÐиÃÎļþʱ´«µÝ¹ýÈ¥µÄargv(0)¡¢argv[1]¡¡£¬×îºóÒ»¸ö²ÎÊý±ØÐëÓÿÕ
Ïà¹ØÎĵµ£º
Ò»£ºÇ°ÑÔ
×î½üÔÚÑо¿androidµÄsensor driver£¬Ö÷ÒªÊÇE-compass£¬ÆäÖÐÓõ½ÁËLinux input×Óϵͳ.ÔÚÍøÉÏÒ²¿´Á˺ܶàÕâ·½ÃæµÄ×ÊÁÏ£¬¸Ð¾õ»¹ÊÇÕâƪ·ÖÎöµÄ±È½ÏϸÖÂ͸³¹£¬Òò´ËתÔØÒ»ÏÂÒÔ±ã×Ô¼ºÑ§Ï°£¬Í¬Ê±ºÍ´ó¼Ò·ÖÏí£¡
£¨Õâƪ²©¿ÍÖ÷ÒªÊÇÒÔ¼üÅÌÇý¶¯ÎªÀýµÄ£¬²»¹ý½²½âµÄÊÇLinux Input Subsystem£¬¿ÉÒÔ×ÐϸµÄÑо¿Ò»Ï£¡£©
¼üÅÌÇý¶¯½«¼ì ......
1£ºlinuxÏÂÅúÁ¿½«´óдĿ¼»òÎļþÃû¸ÄΪСдÃüÁî
ZIP ÏÈ´ò³É°ü£¬ZIP -r A A/*£¬ÔÙUNZIP -LL A B (A/*±íʾAĿ¼ÏµÄËùÓÐÎļþ)£¨AºÍB¶¼Îª.zipÎļþ,-LL ±ä´óдΪСдµÄ²ÎÊý£©
Ôò£¬A°üÀïµÄ´óдĿ¼ºÍÎļþ ......
±ÈÈç˵Ҫ¿´
http://broadcast.hzcnc.com/player.asp?code=345&pname=%u65e0%u95f4%u9053
$ curl 'http://broadcast.hzcnc.com/Play.aspx?code=345'
<ASX VERSION = "3.0">
<ENTRY>
<REF HREF = &quo ......
yum-protectbaseÔÚCentOS 5°ü²Ö¿âÀïÃæÓÐÌṩ:
#yum install yum-protectbase
ÔÚCentOS 5ÀïÃæÕâ¸ö²å¼þĬÈÏÆô¶¯ .
±à¼/etc/yum.repos.d/CentOS-Base.repo ,
ÔÚ [base]
¡¢[update]
¡¢[centosplus]
¶ÎÄ©¼ÓÉÏÒ»ÐÐ:
protect=1
Èà [centosplus] ¶ÎʧЧÈçÏÂ:
enabled=0
±à¼/etc/yum.repos.d/CentOS-Base.repo £¬
Ô ......
Ò»¡¢LINUXÎļþ½á¹¹ ¢ÙÎļþ
Ϊ²Ù×÷ϵͳ·þÎñ¡¢É豸·ÃÎÊÌṩÁ˼òµ¥¶øͳһµÄ½Ó¿Ú¡£ÎļþÊý¾Ý½á¹¹°üÀ¨ÎļþÃû×Ö¡¢´´½¨ÈÕÆÚ¡¢·ÃÎÊȨ¡¢Îļþ³¤¶ÈµÈ£¬ÕâЩÊý¾Ý¶¼±£´æÔÚÎÒÃdzÆ֮Ϊ ½Úµã ÖС£
¢ÚÉ豸
Ó²¼þÔÚLINUX/UNIXÖÐͨ³£ÊDZ»Ó³Éä³ÉÎļþµÄ£¬ÕâÔÚǶÈëʽµ±ÖÐÊÇÊ®·ÖÖØÒªµÄ¡£
¼¸¸öÖØÒªµÄÉè± ......