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

linux ¶¨Ê±Æ÷ʹÓöþ

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <ctype.h>
#include <time.h>
#include <unistd.h>
#include <signal.h>
static char *runStatusFile   = "/syscfg/etc/runStatusFile";
FILE *pFile = NULL;
char runCountStr[6]={0};
unsigned runCountInt = 0;
char runTimeStr[6]={0};
unsigned runTimeInt = 0;
void doTask()
{
 
 pFile = fopen(runStatusFile, "r+");
 fseek (pFile, 6L, SEEK_SET);
 fread (runTimeStr, sizeof(char), 5, pFile);
 runTimeInt = atoi(runTimeStr);
 runTimeInt += 10;
 fseek (pFile, 6L, SEEK_SET);
 sprintf(runTimeStr,"%d",runTimeInt);
 fwrite(runTimeStr, sizeof(char),5, pFile);
 
 //fseek (pFile, 6L, SEEK_SET);
 //fread (runTimeStr, sizeof(char), 5, pFile);
 //printf("runTimeStr = %s\n",runTimeStr);
 fclose(pFile); 
}
int main()
{
 pFile = fopen(runStatusFile, "r+");
 if(pFile == NULL)
 {
  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, 0L, SEEK_SET);
 fread (runCountStr, sizeof(char), 5, pFile);
 runCountInt = atoi(runCountStr);
 runCountInt++;  
 sprintf(runCountStr,"%d",runCountInt);
 fseek (pFile, 0L, SEEK_SET);
 fwrite(runCountStr, sizeof(char), 5, pFile); 
 fclose(pFile);
 
 
 struct sigaction act;
 union sigval tsval;
 act.sa_handler = doTask;
 act.sa_flags = 0;
 sigemptyset(&act.sa_mask);
 sigaction(50, &act, NULL);
 
 while(1)
 {
  sleep(10); //˯Ãß10Ãë
  sigqueue(getpid(), 50, tsval);//ÏòÖ÷½ø³Ì·¢ËÍÐźţ¬Êµ¼ÊÉÏÊÇ×Ô¼º¸ø×Ô¼º·¢ÐźÅ
 }
 
 return 0;


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì(Áù) L2CAP±à³ÌʵÀý

ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
 Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......

[תÌû]LinuxÇý¶¯¿ª·¢Ñ§Ï°µÄһЩ±ØÒª²½Öè

 1. ѧ»áд¼òµ¥µÄmakefile
2. ±àһЩӦÓÃ
³ÌÐò
£¬¿ÉÒÔÓÃmakefileÅÜÆðÀ´
3. ѧ»áдÇý¶¯
µÄmakefile
4. дһ¼òµ¥charÇý¶¯£¬makefile±àÒëͨ¹ý£¬¿ÉÒÔinsmod£¬ lsmod£¬ rmmod. ÔÚÇý¶¯µÄinitº¯ÊýÀï´òÓ¡hello world£¬insmodºóÓ¦¸ÃÄܹ»Í¨¹ýdmesg¿´µ½Êä³ö
¡£
5. дһÍêÕûÇý¶¯£¬ ¼ÓÉÏread£¬ write£¬ ioctl£¬ pollingµÈ¸ ......

Ubuntu LinuxÈëÃŵ½¾«Í¨

 
 
¡¡¡¡
¡¡¡¡
¡¡¡¡±¾ÊéÈ«Ãæ½éÉÜÁËUbuntu LinuxµÄÏà¹ØÖªÊ¶£¬ÄÚÈÝÏêʵ£¬ÂÛÊöÇåÎú¡£Ö÷ÒªÄÚÈݰüÀ¨Ubuntu½éÉÜ¡¢Îļþϵͳ¹ÜÀí¡¢½ø³Ì¹ÜÀí¡¢Ñ¹ËõÓë²éѯϵͳ¡¢ShellÓ¦Óá¢TCP/IP»ù´¡¡¢ÍøÂç¹ÜÀí¡¢ÍøÂçÓ²ÅÌÒÔ¼°¼ÓÃܰ²È«Í¨ÐŵÈÄÚÈÝ¡£
¡¡¡¡±¾ÊéÊÇÒ»±¾ÀíÂÛÓëʵ¼ù²¢ÖصÄÊé¼®£¬¿É×÷ΪרҵÈËÔ±µÄ²Î¿¼Êé¼®£¬Ò²ÊʺÏÓÚ¶ÔUbuntu ......

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

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