LinuxÏÂÊØ»¤½ø³ÌµÄ´´½¨Àý×Ó
#include <stdio.h>
#include <signal.h>
#include <ctype.h>
#include <fcntl.h>
int g_count;
void Exit()
{
printf("I will exit, press any key to continue...(g_count = %d)\n", g_count);
exit(0);
}
int main(int argc, char* argv[])
{
struct sigaction almact;
pid_t pid;
// ´´½¨ÊØ»¤½ø³Ì£¬ÈóÌÐòÔÚºǫ́ÔËÐÐ
// fork£¬ÖÕÖ¹¸¸½ø³Ì
if (pid = fork())
exit(0);
// µÚÒ»×Ó½ø³Ì
setsid();
signal(SIGHUP, SIG_IGN);
// fork, ÖÕÖ¹µÚÒ»×Ó½ø³Ì
if (pid = fork())
exit(0);
// Çå³ýÎļþÑÚÂë
umask(0);
signal(SIGTERM, Exit); // killɱµô½ø³Ìʱºò³ÌÐòĬÈÏÖ´Ðк¯ÊýExit
while (1)
{
sleep(1);
g_count ++;
}
}
Ïà¹ØÎĵµ£º
Ò»£ºÇ°ÑÔ
×î½üÔÚÑо¿androidµÄsensor driver£¬Ö÷ÒªÊÇE-compass£¬ÆäÖÐÓõ½ÁËLinux input×Óϵͳ.ÔÚÍøÉÏÒ²¿´Á˺ܶàÕâ·½ÃæµÄ×ÊÁÏ£¬¸Ð¾õ»¹ÊÇÕâƪ·ÖÎöµÄ±È½ÏϸÖÂ͸³¹£¬Òò´ËתÔØÒ»ÏÂÒÔ±ã×Ô¼ºÑ§Ï°£¬Í¬Ê±ºÍ´ó¼Ò·ÖÏí£¡
£¨Õâƪ²©¿ÍÖ÷ÒªÊÇÒÔ¼üÅÌÇý¶¯ÎªÀýµÄ£¬²»¹ý½²½âµÄÊÇLinux Input Subsystem£¬¿ÉÒÔ×ÐϸµÄÑо¿Ò»Ï£¡£©
¼üÅÌÇý¶¯½«¼ì ......
Linuxϲ鿴CPUʹÓÃÂÊ!
2008Äê03ÔÂ20ÈÕ ÐÇÆÚËÄ ÏÂÎç 07:02
¡¡¡¡ÔÚϵͳά»¤µÄ¹ý³ÌÖУ¬Ëæʱ¿ÉÄÜÓÐÐèÒª²é¿´ CPU ʹÓÃÂÊ£¬²¢¸ù¾ÝÏàÓ¦ÐÅÏ¢·ÖÎöϵͳ״¿öµÄÐèÒª¡£ÔÚ CentOS ÖУ¬¿ÉÒÔͨ¹ý top ÃüÁîÀ´²é¿´ CPU ʹÓÃ×´¿ö¡£ÔËÐÐ top ÃüÁîºó£¬CPU ʹÓÃ״̬»áÒÔÈ«ÆÁµÄ·½Ê½ÏÔʾ£¬²¢ÇһᴦÔÚ¶Ô»°µÄģʽ -- ÓûùÓÚ top µÄÃüÁ¿ÉÒÔ¿ØÖÆÏÔ ......
Linux Ϊ´´½¨ CD ÌṩÁ˹¦ÄÜÇ¿´óÇÒÁé»îµÄ¹¤¾ß¡£
Äú¿ÉÒÔ´´½¨ÔÚ¼¸ºõÈκÎƽ̨É϶¼¿É¶ÁµÄÅÌ£¬»¹¿ÉÒÔ´´½¨ .iso ÎļþÒÔ¹©ÏÂÔغͷַ¢¡£
ÔÚÈκÎƽ̨ÉÏ´ÓÃüÁîÐÐÉÕ¼ CD ¶¼ÊÇÒ»¼þÁîÈ˷ѽâÇÒ·³ÔêµÄÊÂÇ飬Linux µ±È»Ò²²»ÀýÍâ¡£²»¹ý£¬ÓÉÓÚÔÚ¸÷ƽ̨ÉÏËùÓõ½µÄÃüÁîºÍÊõÓﶼʮ·ÖÏàËÆ£¬Òò´ËѧϰһÏÂÈçºÎÔÚ Linux ÉϿ̼ CD »¹ÊÇÊ®·ÖÓÐÓõġ ......
LinuxÖг£ÓõĹػúºÍÖØÐÂÆô¶¯ÃüÁîÓÐshutdown¡¢halt¡¢rebootÒÔ¼°init£¬ËüÃǶ¼¿ÉÒÔ´ïµ½¹Ø»úºÍÖØÐÂÆô¶¯µÄÄ¿µÄ£¬µ«ÊÇÿ¸öÃüÁîµÄÄÚ²¿¹¤×÷¹ý³ÌÊDz»Í¬µÄ£¬ÏÂÃ潫ÖðÒ»½øÐнéÉÜ¡£
1. shutdown
shutdownÃüÁîÓÃÓÚ°²È«¹Ø±ÕLinuxϵͳ¡£ÓÐЩÓû§»áʹÓÃÖ±½Ó¶ÏµôµçÔ´µÄ·½Ê½À´¹Ø±ÕLinux£¬ÕâÊÇÊ®·ÖΣÏյġ£ÒòΪLinuxÓëWindows²»Í¬£¬Æäºǫ́ ......
ÎÒÊÇÒ»¸öƽ·²µÄÈí¼þ¹¤³Ìʦ
һֱϣÍû¹ú²úÈí¼þÄܹ»´ó·ÅÒì²Ê
¿ÉÕýËùνϣÍûÔ½´ó£¬Ê§ÍûÒ²Ô½´ó
Ô½À´Ô½¸Ð¾õµ½ÒªÏë°ÑÈí¼þ×ö´ó×öÇ¿
ʵÔÚÊÇÌ«ÄÑÌ«ÄÑÁË
ÓÞÃÁÈçÎÒÔõôҲ¿´²»µ½¹âÃ÷µÄ´óµÀ
¿ÉÊÇÄѾͲ»×öÁË
¶àÉÙÖÇÕߣ¬×ÜÊÇ¿´×¼ÁËÒ»¸ö·½Ïò£¬¼á³ÖÔÚÒ»¸öСµÄÁìÓò×öϸ×öר×öÇ¿.......
linux¸øÁ˺ܶàÈËÒ»¸öÏ£Íû£¬¿ªÔ´µÄÊÀ½çÈúܶàÈËÈç³Õ ......