Linux下的定時器有兩種,以下分別介紹:1、alarm如果不要求很精確的話,用alarm()和signal()就夠了unsigned int alarm(unsigned int seconds)函數說明: alarm()用來設定訊號SIGALRM在經過參數seconds指定的秒數後傳送給目前的進程。如果參數seconds為0,則之前設定的鬧鐘會被取消,並將剩下的時間返回。傳回值: 返回之前鬧鐘的剩餘秒數,如果之前未設鬧鐘則返回0。alarm()執行後,進程將繼續執行,在後期(alarm以後)
/* file:string.h #ifndef _LINUX_STRING_H_ #define _LINUX_STRING_H_ /* We don't want strings.h stuff being user by user stuff by accident */ #ifdef __KERNEL__ #include <linux/types.h> /* for size_t */ #include <linux/stddef.h> /* for NULL
by Bjorn Chambless IntroductionThe following is designed familiarize the reader with programming in x86 (AT&Tstyle, that produced by gcc) assembly under Linux and how to interface assemblyand higher-level language code (i.e. C). The tutorial
用‘grep’搜尋文字檔 如果您要在幾個文字檔中尋找一字串,可以使用‘grep’命令。‘grep’在文本中搜尋指定的字串。 假設您正在‘/usr/src/linux/Documentation’目錄下搜尋帶字串‘magic’的檔案: $ grep magic /usr/src/linux/Documentation/* sysrq.txt:* How do I enable the magic SysRQ key?sysrq.txt:* How do I use the magic SysRQ
1) 建立NFS共用操作方法: 0, 已root身份登入系統 1,在預設情況下系統是沒有啟動nfs服務的,需要啟動 service nfs status service nfs start 2,修改NFS的設定檔/etc/exports, 樣本# more /etc/exports/nfs 192.168.XX.XXX(rw,sync,no_root_squash) 192.168.XX.XXX(rw,sync,no_root_squash)