Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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µ¥Óû§Ä£Ê½£ºÐÞ¸ÄROOTÃÜÂëºÍgrub¼ÓÃÜ

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

eAccelerator for linux Ïê½â

eaccelerator.shm_size
    The amount of shared memory (in megabytes) that eAccelerator will use.
    "0" means OS default. Default value is "0".
eaccelerator.cache_dir
    The directory that is used for disk cache. eAccelerator stores precompiled code ......

LinuxÏÂÎļþ¼Ð²Ù×÷³£ÓÃÃüÁî

1.ɾ³ýÎļþ¼ÐÓãºrmdir Îļþ¼ÐÃû
  µ«ÊÇrmdir²»ÄÜɾ³ý·Ç¿ÕµÄÎļþ¼Ð£¬ÄÇÈçºÎɾ³ý·Ç¿ÕÎļþ¼ÐÄØ£º
2.ͨ³£Çé¿öÏ£¬É¾³ýÎļþÓãºrm ÎļþÃû
   -d»ò--directory ¡¡Ö±½Ó°ÑÓûɾ³ýµÄĿ¼µÄÓ²Á¬½ÓÊý¾Ýɾ³É0£¬É¾³ý¸ÃĿ¼¡£ 
¡¡-f»ò--force ¡¡Ç¿ÖÆɾ³ýÎļþ»òĿ¼¡£ 
¡¡-i»ò--interactive  ......

LinuxÍøÂç±à³ÌÒ»²½Ò»²½Ñ§ Ò첽ͨѶÁÄÌì³ÌÐòselect

ʲôÊÇÒ첽ͨѶ£¿
¾ÍÊÇͨѶÈÎÒâÒ»·½¿ÉÒÔÈÎÒâ·¢ËÍÏûÏ¢£¬ÓÐÏûÏ¢À´µ½Ê±»áÊÕµ½ÏµÍ³Ìáʾȥ½ÓÊÕÏûÏ¢¡£
ÕâÀïÒªÓõ½selectº¯Êý¡£Ê¹Óò½ÖèÈçÏ£º
1¡¢ÉèÖÃÒ»¸ö¼¯ºÏ±äÁ¿£¬ÓÃÀ´´æ·ÅËùÓÐÒªÅжϵľä±ú£¨file descriptors£º¼´ÎÒÃǽ¨Á¢µÄÿ¸ösocket¡¢ÓÃopen´ò¿ªµÄÿ¸öÎļþµÈ£©
2¡¢°ÑÐèÒªÅжϵľä±ú¼ÓÈëµ½¼¯ºÏÀï
3¡¢ÉèÖÃÅжÏʱ¼ä ......

[Linux]GNU×Ô¶¯»¯¹¤¾ß£¨automake¹¤¾ßÁ´£©


 
Filename
£º
[Linux]GNU
×Ô¶¯»¯¹¤¾ß£¨
automake
¹¤¾ßÁ´£©
Version
£º
V1.0
Date
£º
12/01/2009
Author
£º
S.C.Leon <leonsc@126.com>
=====================================================================
GNU
×Ô¶¯»¯¹¤¾ß£¨
automake
¹¤¾ßÁ´£©
Ò»¡¢
Makefile
½éÉÜ
Makefile
ÊÇ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ