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

linux ¶¨Ê±Æ÷ʹÓÃÒ»

#include <sys/time.h>
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>
static char *runStatusFile   = "/syscfg/etc/runStatusFile";
//static char *runStatusFile   = "runStatusFile";
FILE *pFile = NULL;
char runCountStr[10]={0};
unsigned runCountInt = 0;
char runTimeStr[15]={0};
unsigned runTimeInt = 0;
void doTask()
{
 
 pFile = fopen(runStatusFile, "r+");
 /*
 if(NULL == pFile)
 {
  pFile = fopen(runStatusFile,"w+");
  fseek (pFile, 0L, SEEK_SET);
  fwrite("0", sizeof(char), 1, pFile);
  fseek (pFile, 6L, SEEK_SET);
  fwrite("0", sizeof(char), 1, pFile);
 }
 */
 fseek (pFile, 11L, SEEK_SET);
 fread (runTimeStr, sizeof(char), 10, pFile);
 runTimeInt = atoi(runTimeStr);
 runTimeInt += 30;
 fseek (pFile, 11L, SEEK_SET);
 sprintf(runTimeStr,"%d",runTimeInt);
 fwrite(runTimeStr, sizeof(char),10, pFile);
 
 
 /*
 fseek (pFile, 11L, SEEK_SET);
 fread (runTimeStr, sizeof(char), 10, pFile);
 printf("runTimeStr = %s\n",runTimeStr);
 */
 fclose(pFile); 
}
// ½¨Á¢ÐźŴ¦Àí»úÖÆ
void init_sigaction(void)
{
 struct sigaction tact;  /*Ðźŵ½ÁËÒªÖ´ÐеÄÈÎÎñ´¦Àíº¯ÊýΪdoTask*/
 tact.sa_handler = doTask;
 tact.sa_flags = 0; /*³õʼ»¯Ðźż¯*/
 sigemptyset(&tact.sa_mask); /*½¨Á¢ÐźŴ¦Àí»úÖÆ*/
 sigaction(SIGALRM, &tact, NULL);
}
void init_time()
{
 struct itimerval value; /*É趨ִÐÐÈÎÎñµÄʱ¼ä¼ä¸ôΪ30Ãë0΢Ãë*/
 value.it_value.tv_sec = 30;
 value.it_value.tv_usec = 0; /*É趨³õʼʱ¼ä¼ÆÊýҲΪ30Ãë0΢Ãë*/
 value.it_interval = value.it_value; /*ÉèÖüÆʱÆ÷ITIMER_REAL*/
 setitimer(ITIMER_REAL, &value, NULL);
}
int main()
{
 
 pFile = fopen(runStatusFile, "r+");
 if(pFile == NULL)
 {


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì (Æß) SDPЭÒé

Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖЭÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀЭÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......

Linuxµ¥Óû§Ä£Ê½£ºÐÞ¸ÄROOTÃÜÂëºÍgrub¼ÓÃÜ

Linux ϵͳ´¦ÓÚÕý³£×´Ì¬Ê±£¬·þÎñÆ÷Ö÷»ú¿ª»ú£¨»òÖØÐÂÆô¶¯£©ºó£¬Äܹ»ÓÉϵͳÒýµ¼Æ÷³ÌÐò×Ô¶¯Òýµ¼ Linux ϵͳÆô¶¯µ½¶àÓû§Ä£Ê½£¬²¢ÌṩÕý³£µÄÍøÂç·þÎñ¡£Èç¹ûϵͳ¹ÜÀíÔ±ÐèÒª½øÐÐϵͳά»¤»òϵͳ³öÏÖÆô¶¯Ò쳣ʱ£¬¾ÍÐèÒª½øÈëµ¥Óû§Ä£Ê½»òÐÞ¸´Ä£Ê½¶Ôϵͳ½øÐйÜÀíÁË¡£Ê¹Óõ¥Óû§Ä£Ê½ÓÐÒ»¸öÇ°Ìᣬ¾ÍÊÇÄúµÄϵͳÒýµ¼Æ÷£¨grub£©ÄÜÕý³£¹¤×÷£ ......

LinuxÄÚºËÉ豸ģÐÍ(4)

ÒëÕߣº¹ùÉÙ±¯
2009/12/02
Ô­ÎÄ£ºlinux/Documentation/driver-model/class.txt
É豸Àà
½éÉÜ
~~~~
Ò»¸öÉ豸ÀàÃèÊöÁËÒ»ÀàµÄÉ豸£¬ÀýÈçÓïÒôÉ豸»òÕßÍøÂçÉ豸¡£ÏÂÃæÊÇÒѶ¨ÒåµÄÉ豸Àà:
<Insert List of Device Classes Here>
ÿ¸öÉ豸ÀඨÒåÁËÒ»Ì×Óï·¨ºÍÉ豸×ñÑ­µÄ±à³Ì½Ó¿Ú¡£É豸Çý¶¯¾ÍÊÇΪÌض¨×ÜÏßÉϵÄ
Ìض¨É豸¶ ......

linuxºÍunixϳ£ÓýâѹºÍѹËõÃüÁî

.tar
½â°ü£º tar xvf FileName.tar
´ò°ü£ºtar cvf FileName.tar DirName
£¨×¢£ºtarÊÇ´ò°ü£¬²»ÊÇѹËõ£¡£©
---------------------------------------------
.gz
½âѹ1£ºgunzip FileName.gz
½âѹ2£ºgzip -d FileName.gz
ѹËõ£ºgzip FileName
.tar.gz
½âѹ£ºtar zxvf FileName.tar.gz
ѹËõ£ºtar zcvf FileName.tar.g ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ