about the arch-handbook

Rui Lopes rui at ruilopes.com
Fri Aug 15 09:27:00 PDT 2003


On Sex, 2003-08-15 at 12:28, Soeren Straarup wrote:
> Hi
> 
> I have tried to compile the echo psuedo-driver written by Murray Stokeley
> under 5.X, first i compared it with the dev/null src in the src tree and
> found that the cdevsw where defined in a little different way.
> But i cannot find where in the there is some thign wrong this is the
> make output
> <insert>
> xride at ip8:/root/c/echo# make
> Warning: Object directory not changed from original /root/c/echo
> cc -O -pipe -mcpu=pentiumpro  -D_KERNEL -Wall -Wredundant-decls
> - -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith
> - -Winline -Wcast-qual  -fformat-extensions -std=c99 -DKLD_MODULE -nostdinc
> - -I-   -I. -I@ -I@/dev -I@/../include -fno-common  -mno-align-long-strings
> - -mpreferred-stack-boundary=2 -ffreestanding -Wall -Wredundant-decls
> - -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith
> - -Winline -Wcast-qual  -fformat-extensions -std=c99 -c echobuffer.c
> echobuffer.c:91: conflicting types for `echo_open'
> echobuffer.c:24: previous declaration of `echo_open'
> echobuffer.c:100: conflicting types for `echo_close'
> echobuffer.c:25: previous declaration of `echo_close'
> echobuffer.c:48: warning: `len' defined but not used
> *** Error code 1


You should use `thread' (and not `proc') type in the last argument of echo_open and echo_close.


from sys/conf.h:
typedef int d_open_t(dev_t dev, int oflags, int devtype, struct thread *td);
typedef int d_close_t(dev_t dev, int fflag, int devtype, struct thread *td);
                                                                ^^^^^^


btw, there is a little bug in that example code, check:
http://www.freebsd.org/cgi/query-pr.cgi?pr=docs/55445


Regards,
Rui Lopes



More information about the freebsd-hackers mailing list