LinuxÍøÂç±à³Ì ¿Í»§¶ËÓë·þÎñÆ÷¶ËÒ첽ͨÐÅ
#include <sys/select.h>
#include <sys/time.h>
#include
<sys/types.h>
#include <unistd.h>
int select(int
nfds,fd_set *readfds,fd_set *writefds, fd_set *except fds,struct timeval
*timeout)
void FD_SET(int fd,fd_set *fdset)
void FD_CLR(int fd,fd_set
*fdset)
void FD_ZERO(fd_set *fdset)
int FD_ISSET(int fd,fd_set
*fdset)
¼ÌÐøÇ°ÃæµÄ
LinuxÍøÂç±à³Ì-¿Í»§¶ËÓë·þÎñÆ÷¶ËͨÐÅ(Echo)
£¬½Ó׎²¹ØÓÚ¿Í»§¶ËÓë·þÎñÆ÷¶ËµÄÒ첽ͨѶ
Ò»°ãµÄÀ´Ëµµ±ÎÒÃÇÔÚÏòÎļþ¶Áдʱ,½ø³ÌÓпÉÄÜÔÚ¶Áд³ö×èÈû,Ö±µ½Ò»¶¨µÄÌõ¼þÂú×ã.
±ÈÈçÎÒÃÇ´ÓÒ»¸öÌ×½Ó×Ö¶ÁÊý¾Ýʱ,
¿ÉÄÜ»º³åÇøÀïÃæûÓÐÊý¾Ý¿É¶Á (ͨÐŵĶԷ½»¹Ã»ÓÐ
·¢ËÍÊý¾Ý¹ýÀ´),Õâ¸öʱºòÎÒÃǵĶÁµ÷ÓþͻáµÈ´ý(×èÈû)Ö±µ½ÓÐÊý¾Ý¿É¶Á.
Èç¹ûÎÒÃDz» Ï£Íû×èÈû,ÎÒÃǵÄÒ»¸öÑ¡ÔñÊÇÓÃselectϵͳµ÷ÓÃ.
Ö»ÒªÎÒÃÇÉèÖúÃselectµÄ¸÷¸ö²ÎÊý,
ÄÇôµ±Îļþ¿ÉÒÔ¶ÁдµÄʱºòselect»Ø"֪ͨ"ÎÒÃÇ Ëµ¿ÉÒÔ¶ÁдÁË.
readfdsËùÓÐÒª¶ÁµÄÎļþÎļþÃèÊö·ûµÄ¼¯ºÏ
writefdsËùÓÐÒªµÄдÎļþÎļþÃèÊö·ûµÄ¼¯ºÏ
exceptfdsÆäËûµÄ·þÒªÏòÎÒÃÇ֪ͨµÄÎļþÃèÊö·û
timeout³¬Ê±ÉèÖÃ.
nfdsËùÓÐÎÒÃǼà¿ØµÄÎļþÃèÊö·ûÖÐ×î´óµÄÄÇÒ»¸ö¼Ó1
ÔÚÎÒÃǵ÷ÓÃselectʱ½ø³Ì»áÒ»Ö±×èÈûÖ±µ½ÒÔϵÄÒ»ÖÖÇé¿ö·¢Éú.
1)ÓÐÎļþ¿ÉÒÔ¶Á.
2)ÓÐÎļþ¿ÉÒÔд.
3)³¬Ê±ËùÉèÖõÄʱ¼äµ½.
ΪÁËÉèÖÃÎļþÃèÊö·ûÎÒÃÇҪʹÓü¸¸öºê.
FD_SET½«fd¼ÓÈëµ½fdset
FD_CLR½«fd´ÓfdsetÀïÃæÇå³ý
FD_ZERO´ÓfdsetÖÐÇå³ýËùÓеÄÎļþÃèÊö·û
FD_ISSETÅжÏfdÊÇ·ñÔÚfdset¼¯ºÏÖÐ
ʹÓÃselectµÄÒ»¸öÀý×Ó
#
include
<
stdio.
h>
#
include
<
sys/
time
.
h>
#
include
<
sys/
types.
h>
#
include
<
unistd.
h>
int
main(
void
)
{
 
Ïà¹ØÎĵµ£º
linuxѹËõºÍ½âѹËõÃüÁî´óÈ«
.tar
¡¡¡¡½â°ü£ºtar zxvf FileName.tar
¡¡¡¡´ò°ü£ºtar czvf FileName.tar DirName
¡¡¡¡---------------------------------------------
¡¡¡¡.gz
¡¡¡¡½âѹ1£ºgunzip FileName.gz
¡¡¡¡½âѹ2£ºgzip -d FileName.gz
¡¡¡¡Ñ¹Ëõ£ºgzip File ......
µ±´ÅÅÌ´óС³¬¹ý±ê׼ʱ»áÓб¨¾¯Ìáʾ£¬ÕâʱÈç¹ûÕÆÎÕdfºÍduÃüÁîÊǷdz£Ã÷ÖǵÄÑ¡Ôñ¡£
df¿ÉÒԲ鿴һ¼¶Îļþ¼Ð´óС¡¢Ê¹ÓñÈÀý¡¢µµ°¸ÏµÍ³¼°Æä¹ÒÈëµã£¬µ«¶ÔÎļþÈ´ÎÞÄÜΪÁ¦¡£
du¿ÉÒԲ鿴Îļþ¼°Îļþ¼ÐµÄ´óС¡£
Á½ÕßÅäºÏʹÓ㬷dz£ÓÐЧ¡£±ÈÈçÓÃdf²é¿´ÄĸöÒ»¼¶Ä¿Â¼¹ý´ó£¬È»º ......
linuxµÄÇý¶¯¾ÍÊǸö×Ö·ûÉ豸£¬¿ÉÒÔÓÃread write ioctl mmap²Ù×÷£¬Í¨¹ý/dev/fbx¿ÉÒÔÏñÎļþÒ»ÑùÖ±½Ó¶Áд
½ØÆÁdd if=/dev/fb0 of=snapshot
»Ö¸´cat snapshot > /dev/fb0
¿ªÔ´µÄÓÐfbgrab¹¤¾ß£¬²»¹ýÊÇÉú³ÉpngÎļþ£¬ÎÒ×Ô¼ºÐ´ÁËÒ»¸öÉú³ÉbmpÎļþµÄ¹¤¾ß½Ðfbcap£¬Â¼ÖƳÉavi¸ñʽ£¬Í¨¹ýsocket»òserial°ÑÉ豸µÄ²Ù×÷·¢Ë͵½hostÉÏ£º£ ......
×î½ü¶ÔLinuxµÄÏ߳̽ӿڽøÐÐÁËЩ×ܽᣬҲ²Î¿¼ÁËÍøÂçÉÏÐÖµÜÃǵÄһЩ×ÊÁÏ£¬×Ô¼ºÍ¬Ê±Ò²Ð´ÁËЩ³ÌÐò½øÐвâÊÔ£¬ÏȰѲο¼µÄ
×ÊÁÏÁгöÀ´°É
http://blog.mcuol.com/User/liuzhilii521/Article/12738_1.htm
ÏÂÃæÊÇÎÒµÄһЩÀí½â£º
pthread_key_create(pthread_key_t *key,void (*destructor)(void*))
destructorÕâ¸ö»Øµ÷º¯ÊýÔÚÏß³Ì ......
·ÖÀࣺ²Ù×÷ϵͳ¼¼ÇÉ
windows
ϵͳͨ¹ý
GRUB
for dos Ó²ÅÌ°²×°
FC6
Fedora
Core 6
ÕâÀï¸ø¸ögrub for
dos µÄÏÂÔصØÖ·£º
http://nchc.dl.sourceforge.net/sourceforge/grub4dos/grub_for_dos-0.4.1.zip
½âѹ·ÅÈëC:ÅÌ
ÆäÖÐÁ½¸öÎļþ×îÖØÒª,°ÑËûÃǶ¼·ÅÔÚC:¸ùĿ¼Ï£º
1.C:\boot\grub
2.°Ñ grldr ·ÅÈë C: ......