Skip site navigation (1)Skip section navigation (2)
Date:      15 Aug 2003 17:29:40 +0100
From:      Rui Lopes <rui@ruilopes.com>
To:        Soeren Straarup <xride@x12.dk>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: about the arch-handbook
Message-ID:  <1060964980.1425.18.camel@localhost>
In-Reply-To: <20030815132308.K71513-200000@x12.dk>
References:  <20030815132308.K71513-200000@x12.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
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@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1060964980.1425.18.camel>