作者shane123 (家產有八十七億  ﰩ
看板FreeBSD
標題[問題] system call 怎麼加入才是正確的?
時間Tue Oct 11 00:02:07 2005
我最近加入了一個 system call: syshello()
這是我在 syscalls.master 加入的
445 MSTD { int syshello(char *buf); }
之後執行 sh makesyscall.sh syscalls.master
然後新增了 sys_hello.c
內容如下
int syshello(struct thread *td, struct syshello_args *uap)
{
...
...
}
然後修改了 /usr/src/sys/i386/compile/shane/Makefile
^^^^^我核心的名字
把 sys_hello.c 按照其他system call的做法加入到 Makefile
之後執行make
可是他卻說
../../../kern/sys_hello.c:1: warning: "struct syshello_args" declared inside
parameter list
../../../kern/sys_hello.c:1: warning: its scope is only this definition or
declaration, which is probably not what you want
../../../kern/sys_hello.c:1: warning: "struct thread" declared inside
parameter list
../../../kern/sys_hello.c:2: warning: no previous prototype for 'syshello'
然後我想說乾脆把 syshello加到現有的檔案 kern_prot.c
結果 make 就過了
請問為什麼我加到新增的 sys_hello.c (有修改過 Makefile) 不行
用現存的 .c (kern_prot.c) 就可以呢?
thanks~
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.62.97.25