LinuxÏ»ñµÃϵͳʱ¼äµÄCÓïÑÔµÄʵÏÖ·½·¨
LinuxÏ»ñµÃϵͳʱ¼äµÄCÓïÑÔµÄʵÏÖ·½·¨
#include<time.h> //CÓïÑÔµÄÍ·Îļþ
#include<stdio.h> //C﵀I/O
void main()
{
time_t now; //ʵÀý»¯time_t½á¹¹
struct tm *timenow; //ʵÀý»¯tm½á¹¹Ö¸Õë
time(&now);
//timeº¯Êý¶ÁÈ¡ÏÖÔÚµÄʱ¼ä(¹ú¼Ê±ê׼ʱ¼ä·Ç±±¾©Ê±¼ä)£¬È»ºó´«Öµ¸ønow
timenow = localtime(&now);
//localtimeº¯Êý°Ñ´ÓtimeÈ¡µÃµÄʱ¼änow»»Ëã³ÉÄãµçÄÔÖеÄʱ¼ä(¾ÍÊÇÄãÉèÖõĵØÇø)
printf("Local time is %s\n",asctime(timenow));
//ÉϾäÖÐasctimeº¯Êý°Ñʱ¼äת»»³É×Ö·û£¬Í¨¹ýprintf()º¯ÊýÊä³ö
}
×¢ÊÍ£ºtime_tÊÇÒ»¸öÔÚtime.hÖж¨ÒåºÃµÄ½á¹¹Ìå¡£¶øtm½á¹¹ÌåµÄÔÐÎÈçÏ£º
struct tm
{
int tm_sec;//seconds 0-61
int tm_min;//minutes 1-59
int tm_hour;//hours 0-23
int tm_mday;//day of the month 1-31
int tm_mon;//months since jan 0-11
int tm_year;//years from 1900
int tm_wday;//days since Sunday, 0-6
int tm_yday;//days since Jan 1, 0-365
int tm_isdst;//Daylight Saving time indicator
};
Ïà¹ØÎĵµ£º
windowsÏÂʹÓÃfoxmailºÜÈÝÒ×ÉèÖÃhotmailºÍgmail£¬×ªµ½linuxºó£¬·¢ÏÖevolution²»Ì«ºÃʹ£¬ÓʼþÐÅÏ¢µÄ±àÂëû·¨ÉèÖã¬gbk±àÂëµÄÓʼþÖ÷ÌâÏÔʾÂÒÂ룬ֻºÃ»»³Éthunderbird¡£
thunderbird±¾Éí²»Ö§³ÖhotmailÕâÀàwebmailµÄÊÕ·¢£¬ÐèÒªÏÂÔزå¼þwebmailºÍhotmail£¬ÐèÒª½ÓÊÕyahooµÄ ......
×èÈû²Ù×÷ÊÇÖ¸£¬ÔÚÖ´ÐÐÉ豸²Ù×÷ʱ£¬Èô²»ÄÜ»ñµÃ×ÊÔ´£¬Ôò½ø³Ì¹ÒÆðÖ±µ½Âú×ã¿É²Ù×÷µÄÌõ¼þÔÙ½øÐвÙ×÷¡£·Ç×èÈû²Ù×÷µÄ½ø³ÌÔÚ²»ÄܽøÐÐÉ豸²Ù×÷ʱ£¬²¢²»¹ÒÆð¡£±»¹ÒÆðµÄ½ø³Ì½øÈësleep״̬£¬±»´Óµ÷¶ÈÆ÷µÄÔËÐжÓÁÐÒÆ×ߣ¬Ö±µ½µÈ´ýµÄÌõ¼þ±»Âú×ã¡£
ÔÚLinuxÇý¶¯³ÌÐòÖУ¬ÎÒÃÇ¿ÉÒÔʹÓõȴý¶ÓÁУ¨wait queue£©À´ÊµÏÖ×èÈû²Ù×÷¡£wait queueºÜÔ ......
2)Linux³ÌÐòÉè¼ÆÈëÃÅ--½ø³Ì½éÉÜ
LinuxϽø³ÌµÄ´´½¨
Ç°ÑÔ:
ÕâƪÎÄÕÂÊÇÓÃÀ´½éÉÜÔÚLinuxϺͽø³ÌÏà¹ØµÄ¸÷¸ö¸ÅÄî.ÎÒÃǽ«»áѧµ½:
½ø³ÌµÄ¸ÅÄî
½ø³ÌµÄÉí·Ý
½ø³ÌµÄ´´½¨
ÊØ»¤½ø³ÌµÄ´´½¨
----------------------------------------------------------------------------
----
1¡£½ø³ÌµÄ¸ÅÄî
Linux²Ù×÷ϵͳÊÇÃæÏ ......
linux´®¿ÚÓ¦Óÿª·¢
2009Äê10ÔÂ20ÈÕ ÐÇÆÚ¶þ 14:16
1¡¢´®¿Ú¸ÅÊö
Óû§³£¼ûµÄÊý¾ÝͨÐŵĻù±¾·½Ê½ÓÐÁ½ÖÖ£º²¢ÐÐͨÐźʹ®ÐÐͨÐÅ¡£
´®ÐÐͨÐÅÊǼÆËã»ú³£ÓõĽӿڣ¬È磺RS-232-C½Ó¿Ú¡£¸Ã±ê×¼¹æ¶¨²ÉÓÃÒ»¸öDB25оÒý½ÅÁ¬½ÓÆ÷»òDB9оÒý½ÅÁ¬½ÓÆ÷¡£Ð¾Æ¬ÄÚ²¿³£¾ßÓÐUART¿ØÖÆÆ÷£¬Æä¿É¹¤×÷ÓÚInterrup ......