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

LinuxÖеÄÑÓʱº¯Êý¼°»ñȡϵͳʱ¼äº¯Êý

Ó¦Óò㣺
   #include <unistd.h>
 
   1¡¢unsigned int sleep(unsigned int seconds); Ãë¼¶
   2¡¢int usleep(useconds_t usec);              ΢Ãë¼¶£º1/10^-6 
 
   #define _POSIX_C_SOURCE 199309
   #include <a(const struct timespec *req, struct timespec *rem);
       struct timespec {
                  time_t tv_sec;        /* seconds */
                  long   tv_nsec;       /* nanoseconds */
              };
       // The value of the nanoseconds field must be in the range 0 to 999999999.
 
 Äں˲㣺
   include <linux/delay.h>
   1¡¢void ndelay(unsigned long nsecs);         ÄÉÃë¼¶£º1/10^-10
   2¡¢void udelay(unsigned long usecs);         ΢Ãë¼¶: 1/10^-6
   3¡¢void mdelay(unsigned long msecs);         ºÁÃë¼¶£º1/10^-3
 
 
linuxÏ»ñȡʱ¼äµÄÈô¸Éº¯Êý(z)
 
 
asctime£¨½«Ê±¼äºÍÈÕÆÚÒÔ×Ö·û´®¸ñʽ±íʾ£©
 
Ïà¹Øº¯Êý
time£¬ctime£¬gmtime£¬localtime
±íÍ·Îļþ
#include<time.h>
¶¨Ò庯Êý
char * asctime(const struct tm * timeptr);
º¯Êý˵Ã÷
asctime()½«²ÎÊýtimeptrËùÖ¸µÄtm½á¹¹ÖеÄÐÅϢת»»³ÉÕæÊµÊÀ½çËùʹÓõÄʱ¼äÈÕÆÚ±íʾ·½·¨£¬È»ºó½«½á¹ûÒÔ×Ö·û´®ÐÎ̬·µ»Ø¡£´Ëº¯ÊýÒѾ­ÓÉÊ±Çø×ª»»³Éµ±µØÊ±¼ä£¬×Ö·û´®¸ñʽΪ:“Wed Jun 30 21:49:08 1993\n”
·µ»ØÖµ
ÈôÔÙµ÷ÓÃÏà¹ØµÄʱ¼äÈÕÆÚº¯Êý£¬´Ë×Ö·û´®¿ÉÄÜ»á±»ÆÆ»µ¡£´Ëº¯ÊýÓëctime²»Í¬´¦ÔÚÓÚ´«ÈëµÄ²ÎÊýÊDz»Í¬µÄ½á¹¹¡£
¸½¼Ó˵Ã÷
·µ»ØÒ»×Ö


Ïà¹ØÎĵµ£º

LinuxÉ豸ģÐÍÖ®input×ÓϵͳÏê½â

Ò»£ºÇ°ÑÔ
×î½üÔÚÑо¿androidµÄsensor driver£¬Ö÷ÒªÊÇE-compass£¬ÆäÖÐÓõ½ÁËLinux input×Óϵͳ.ÔÚÍøÉÏÒ²¿´Á˺ܶàÕâ·½ÃæµÄ×ÊÁÏ£¬¸Ð¾õ»¹ÊÇÕâÆª·ÖÎöµÄ±È½ÏϸÖÂ͸³¹£¬Òò´Ë×ªÔØÒ»ÏÂÒÔ±ã×Ô¼ºÑ§Ï°£¬Í¬Ê±ºÍ´ó¼Ò·ÖÏí£¡
£¨ÕâÆª²©¿ÍÖ÷ÒªÊÇÒÔ¼üÅÌÇý¶¯ÎªÀýµÄ£¬²»¹ý½²½âµÄÊÇLinux Input Subsystem£¬¿ÉÒÔ×ÐϸµÄÑо¿Ò»Ï£¡£©
¼üÅÌÇý¶¯½«¼ì ......

linux ³ÌÐòÄÚ²¿ ²é¿´¿ÉÖ´ÐгÌÐò·¾¶

linux shell pwd ÏÔʾµ±Ç°Â·¾¶
¼ÙÈôÓÐtest.cpp
g++ test.cpp -o test
./test
ÏëÔÚtestÖÐÕÒµ½µ±Ç°Ö´ÐгÌÐòËùÔڵķ¾¶
¿ÉÒÔÔÙtest.cppÖÐʹÓÃreadlinkº¯Êý
¾ßÌå¼ûÈçÏÂʵÀý£º
#include<iostream>
#include<unistd.h>
#include<dirent.h>
#include<string.h>
#include<string>
using ......

linuxÄÚºËѧϰ֮likely£¨£©ºÍunlikely£¨£©

²Î¿¼×ÊÁÏ £º linuxÄÚºËÉè¼ÆºÍʵÏÖ P13
likely£¨£©ºÍunlikely£¨£©ÊÇÄں˱àÒëʱÓÃÓÚÓÅ»¯ if ÅжÏÓï¾äµÄºê
likely£¨£©´ú±íÓÅ»¯
unlikely£¨£©´ú±í²»ÓÅ»¯
Ò»°ãΪÁËЧÂÊ ÓɳÌÐòÔ±×Ô¼ºÅжÏifÓï¾äÀïÃæµÄÄÚÈÝÊÇ·ñÒªÓÅ»¯£¬ÏÔÈ»Èç¹ûifÓï¾äÀïÃæµÄÄÚÈÝÓкܴóµÄ¸ÅÂÊ»áÖ´Ðе½¾Í¸ÃÓÅ»¯£¬²»È»¾Í²»±ØÓÅ»¯
if£¨likely£¨A != 0£©£©
£û
.. ......

LinuxÏÂÓÃPYTHON²éÕÒͬÃû½ø³Ì

1.¿ÉÖ´ÐгÌÐò
os.system('pgrep %s > %s' % (process, output))
   pidfile = open("output", 'r')
   totalpid = len(pidfile.readlines())
   pidfile.close()
   if totalpid == 0 :
         &nbs ......

linux½âѹ .gz Îļþ

xxxx.tar.gzÎļþʹÓÃtar´øzxvf²ÎÊý£¬¿ÉÒÔÒ»´Î½âѹ¿ª¡£XXXXΪÎļþÃû¡£ ÀýÈ磺
$tar zxvf xxxx.tar.gz
gzip -d
Óï ·¨£ºgzip [-acdfhlLnNqrtvV][-S <ѹËõ×Öβ×Ö·û´®>][-<ѹËõЧÂÊ>][--best/fast][Îļþ...] »ò gzip [-acdfhlLnNqrtvV][-S <ѹËõ×Öβ×Ö·û´®>][-<ѹËõЧÂÊ>][--best/fast][Ŀ¼]
²¹³äË ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ