readahead in /usr/include/bits/fcntl.h

Ken Moffat ken at kenmoffat.uklinux.net
Thu Feb 12 01:52:11 PST 2004


On Thu, 12 Feb 2004 Ryan.Oliver at pha.com.au wrote:

>
> Ken Moffat wrote:
> >After building 5.1-pre1 with the latest glibc and Ryan's patch to
> >revert things, I'm doing my usual build of console tools in chroot

> >Hdparm (both 5.4 and the later 5.5) are falling over with a symbol
> >being redefined - there is a readahead variable in the program, and
> >now
> >at the end of /usr/include/bits/fcntl.h there's 'extern ssize_t
> >readahead' - some sort of hint to the kernel, apparently.
> >

>
> Appeared sometime between the 17th Jan 18:45 UTC and
> 24th Jan 08:40 UTC
>
> >The obvious fix for hdparm is to rename its variable to something
> >else,
> >which I'm sure won't please the maintainer (he has a set of three
> >related variables for handling the readahead setting), so I'd like to
> >be
> >a bit clearer where this is coming from before I contact him.
> >
>
> Looks like its a problem for the hdparm maintainer...
>
> Anyway, a patch which reverts the glibc changes,
> though this probably may not be the way to go...
> (also contains the patch I sent the other day, renamed)
> Should really get these up under my home directory...

 As you say, probably not the way to go.  Now I know when it arrived
I'll tell the maintainer.

>
> Specifically want to see where the original definition came from,
> and in which section of hdparm...
> If you could mail that section I may be able to come up with a patch
> for hdparm instead.
>

Error follows, line folded by hand, the -Os is mine.

gcc -O2 -W -Wall -Wbad-function-cast -Wcast-align -Wpointer-arith
 -Wcast-qual -Wshadow -Wstrict-prototypes -Wmissing-prototypes
 -Wmissing-declarations -fkeep-inline-functions -Wwrite-strings
 -Waggregate-return -Wnested-externs -Wtrigraphs
 -Os   -c -o hdparm.o hdparm.c

hdparm.c:55: error: `readahead' redeclared as different kind of symbol
/usr/include/bits/fcntl.h:185: error: previous declaration of `readahead'
hdparm.c:55: warning: `readahead' was declared `extern' and later `static'
make: *** [hdparm.o] Error 1

 This isn't the world's biggest package (one source file, and a header),
my only objection to my crude fix (rename readahead) was aesthetic.

Ken
-- 
Brighton tops UK Jedi league
http://www.theregister.co.uk/content/28/35186.html




More information about the hlfs-dev mailing list