看板 LinuxDev 關於我們 聯絡資訊
給個簡單的範例程式 參考看看吧~~ -------------------------- #include <stdio.h> #include <asm/unistd.h> #include <unistd.h> #include <stdlib.h> #include <string.h> int errno; #define __NR_occupy 289 //自己定義的數字 _syscall1(long,occupy,int,cpu_id); int main(int argc,char *argv[]) { int cpu_id=0; occupy(cpu_id); return 0; } ※ 引述《pinkisme ()》之銘言: : 我是在Fedora上增加一個新的system call, : 下面是呼叫的程式 : include <linux/unistd.h> : #include <sys/syscall.h> : #include <errno.h> : #include <stdio.h> : int main() : { : int rc; : rc = syscall(318,15); : printf("RC=%d\n",rc); : if(rc==-1) : printf("ERROR\n"); : return 0; : } : 可是跑出來卻還是沒有呼叫自訂的system call : 想請問一下可能是哪個環節出問題嗎? : 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.228.156.247