linuxϰ´Ï¼üÍ˳öwhileÑ»·(ÀàËÆÓÚ_kbhit)
#include <stdio.h>
#include <sys/select.h>
#include <termios.h>
#include <unistd.h>
#include <ctype.h>
#define STDIN 0
int main()
{
struct timeval tv = {0,0};
struct termios term , termbak;
char ch;
fd_set fd;
FD_ZERO(&fd);
FD_SET( STDIN ,&fd);
tcgetattr(STDIN, &term);
termbak = term;
term.c_lflag &= ~(ICANON|ECHO);
tcsetattr(STDIN, TCSANOW, &term);
while(1)
{
FD_ZERO(&fd);
FD_SET( STDIN ,&fd);
if( 1 == select( STDIN+1,&fd,NULL,NULL,&tv)
&& 1 == read( STDIN , &ch , 1 )
&& 'q' == tolower(ch) )
break;
putchar('.');fflush(stdout);
usleep(100000);
}
tcsetattr(STDIN,TCSANOW,&termbak);
return 0;
}
×ªÔØ×Ô£ºhttp://topic.csdn.net/u/20100115/10/7ec685ee-27ef-4b03-b184-ce0a1e728cde.html
Ïà¹ØÎĵµ£º
×ÜÀÀ
ÓÃiptables -ADC À´Ö¸¶¨Á´µÄ¹æ
Ôò
£¬-AÌí¼Ó -Dɾ³ý -C ÐÞ¸Ä
iptables - [RI] chain rule num rule-specification[option]
ÓÃiptables - RI ͨ¹ý¹æÔòµÄ˳ÐòÖ¸¶¨
iptables -D chain rule num[option]
ɾ³ýÖ¸¶¨¹æÔò
iptables -[LFZ] [chain][option]
ÓÃiptables -LFZ Á´Ãû [Ñ¡Ïî]
iptables -[NX] chain
ÓÃ -NX ......
List_Head
²Ù×÷ϵͳÄں˾³£ÐèҪά»¤Êý¾Ý½á¹¹¡£ÄÚºËÓбê×¼µÄÑ»·Á´±í¡¢Ë«Ïò
Á´±íµÄʵÏÖ¡£ÔÚ
<Linux/list.h>
ÎļþÖж¨ÒåÁËÒ»¸ö
list_head
ÀàÐͼòµ¥½á¹¹£º
struct
list_head {
struct list_head *next, *prev;
};
ͨÓÃÁ´±íµÄ³£ÓÃÓÃ;Êǽ«Ä³Ò»¸öÊý¾Ý½á¹¹±¾Éí´®³ÉÁ´±í£¬»ò½«Ä³Ð©Á ......
Ò». ÊØ»¤½ø³Ì¼°ÆäÌØÐÔ
(1)×îÖØÒªµÄÌØÕ÷ÊǺǫ́ÔËÐÐ
(2)±ØÐëÓëÔËÐÐǰµÄ»·¾³¸ôÀ뿪À´¡£ÕâЩ»·¾³Í¨³£ÊÇÊØ»¤½ø³Ì´ÓÖ´ÐÐËüµÄ¸¸½ø³ÌÖм̳ÐÏÂÀ´µÄ¡£»·¾³°ü À¨»¹Î´¹Ø±ÕµÄÎļþÃèÊö·û£¬¿ØÖÆÖÕ¶Ë£¬»á»°ºÍ½ø³Ì×飬¹¤×÷Ŀ¼ÒÔ¼°Îļþ´´½¨ÑÍÄ£µÈ¡£
(3)Æô¶¯·½Ê½¡£¿ÉÒÔÓÉÓû§ÖÕ¶ËÖ´ÐУ¬Ò²¿ÉÒÔ´ÓÆô¶¯½Å±¾/etc/rc.dÖÐÆô¶¯¡£
×ÜÖ®£¬± ......
GNU glibcÌṩһ¸ö¶ÔprintfµÄÀ©Õ¹£¬Ö±½Óprintf("%m"),¿ÉÒÔÊä³ö±ê×¼µÄ´íÎóÐÅÏ¢£¬ÀýÈçÏÂÃæ£º
#include <stdio.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
int main()
{
......
Linux ͬ²½·½·¨ÆÊÎö
ÄÚºËÔ×Ó£¬×ÔÐýËøºÍ»¥³âËø
ÎĵµÑ¡Ïî
½«´ËÒ³×÷Ϊµç×ÓÓʼþ·¢ËÍ
¼¶±ð£º Öм¶
M. Tim Jones, ¹ËÎʹ¤³Ìʦ, Emulex
2007 Äê 11 ÔÂ 19 ÈÕ
ÔÚѧϰ Linux® µÄ¹ý³ÌÖУ¬ÄúÒ²Ðí½Ó´¥¹ý²¢·¢£¨concurrency£©¡¢ÁÙ½ç¶Î£¨critical section£©ºÍËø¶¨£¬µ«ÊÇÈçºÎÔÚÄÚºËÖÐʹÓÃÕâЩ¸ÅÄîÄØ£¿±¾ÎÄÌÖ ......