system call 怎麼加入才是正確的? - BBS
By Irma
at 2005-10-11T00:02
at 2005-10-11T00:02
Table of Contents
我最近加入了一個 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~
--
這是我在 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~
--
Tags:
BBS
All Comments
Related Posts
網路卡
By Dorothy
at 2005-10-09T20:34
at 2005-10-09T20:34
請問有人在FreeBSD架設過wiki嗎?
By Sarah
at 2005-10-09T02:58
at 2005-10-09T02:58
adduser格式更改
By Callum
at 2005-10-08T10:59
at 2005-10-08T10:59
Re: www.freebsd.org 的首頁換新裝了
By George
at 2005-10-07T13:42
at 2005-10-07T13:42
pure-ftpd
By Regina
at 2005-10-07T13:41
at 2005-10-07T13:41