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

Linux¶¨Ê±Æ÷——setitimer()

setitimer()ÊDZȽϾ«×¼µÄ¶¨Ê±Æ÷£¬ÊÇLinuxµÄAPI
ÒÔÏ´úÂëÊǸöµ¹¼ÆÊ±Àý×Ó£º
#include <signal.h>
#include <sys/time.h>
static int time_count=30;
static void sigalrm_handler(int sig)
{
time_count--;
printf("timer signal.. %d\n", time_count);
}
struct itimerval v; //¶¨Ê±Æ÷½á¹¹Ìå
time_count=10; //Ôٴγõʼ»¯
signal(SIGALRM, sigalrm_handler);//°ó¶¨Ðźź¯Êý
v.it_value.tv_sec=1;
v.it_value.tv_usec=0;
v.it_interval.tv_sec=1;//¼ä¸ô1s
v.it_interval.tv_usec=0;
setitimer(ITIMER_REAL,&v,NULL); //½á¹¹Ì幨Áª£¬start
...
...
//=========½áÊø´Ë¶¨Ê±Æ÷=====================
v.it_value.tv_sec=0;
v.it_value.tv_usec=0;
v.it_interval.tv_sec=0;
v.it_interval.tv_usec=0;
setitimer(ITIMER_REAL,&v,NULL);

Ô­Àí¼ÈÊÇ 1s·¢ËÍSIGALRMÐźÅÒ»´Î£¬½«ÆäÖµÖÃÁ㼴Ϊ¹Ø±Õ£¬²»ÔÚ·¢ËÍÐźÅ


Ïà¹ØÎĵµ£º

linux ¹ÜÀíÃüÁî Ö® ¼àÊÓϵͳ

1.¼àÊÓÄÚ´æ
free -mt
             total       used       free     shared    buffers     cached
Mem:     ......

LinuxϵͳÉϼÜÉèVSFTP·þÎñÆ÷ʵÀý½âÎö

     
ʵÑé»·¾³£ºAS4×îС»¯°²×°
ʵÑéÄ¿±ê£º¼ÜÉèVSFTP·þÎñÆ÷
Õâ´ÎÎÒÃÇÀ´Ñ§Ï°LinuxϵͳÖÐµÄ vsftp·þÎñÆ÷µÄÅäÖá£
ÏÂÃæÎÒÃÇ¿ªÊ¼ÁË£¡Ê×ÏÈÎÒÃǰ²×°vsftp·þÎñÆ÷¶ËµÄÈí¼þ¡£
vsftpd·þÎñÆ÷µÄ°²×°ÎļþλÓÚµÚ1ÕŰ²×°¹âÅÌÖС£
ʹÓÃrpmÃüÃû¿É˳Àû°²×°¸ÃÈí¼þ°ü¡£
# rpm -ivh vsftpd-2.0.1-5.i386.r ......

Ó²Å̰²×°linux rhel 5 ³¬¼¶¼òµ¥

Ê×ÏÈÏÂÔØÒ»¸ögrubfordos£¬´ÓÕâÀïϾÍÊÇÁË£¬http://download.csdn.net/source/1326121
ºÜСµÄ£¬²Å190k×óÓÒ£¬Ö±½Ó·ÅÖÃÔÚcÅÌ£¬È»ºó£¬´ò¿ªcÅÌ£¬ÔÚÎļþ¼ÐÑ¡ÏîÀïÃæ£¬°ÑϵͳÒþ²ØÑ¡Ïî´ò¿ª£¬ÏµÍ³±£»¤ÎļþÒ²´ò¿ª£¬¾Í¿ÉÒÔ¿´µ½Ò»¸öboot.iniÎļþ£¬ÔÚboot.iniÀïÃæÌí¼ÓÒ»C£º\grldr="grub for dos"
OK ¡£
Æô¶¯Ã»ÓÐÎÊÌâÁË¡£
°ÑlinuxµÄ°²× ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ