ts-7000
[Top] [All Lists]

[ts-7000] Re: implicit declaration of function 'getpagesize'

To:
Subject: [ts-7000] Re: implicit declaration of function 'getpagesize'
From: "j.chitte" <>
Date: Sun, 31 May 2009 21:52:56 -0000
--- In  Jim Jackson <> wrote:
>
> 
> 
> 
> On Sun, 31 May 2009, naturalwatt wrote:
> 
> > --- In  "j.chitte" <j.chitte@> wrote:
> >>
> >> Hi,
> >>
> >> I'm trying to recompile something based on Jim Jackson's adc_logger with 
> >> an upto date toolchain. I get:
> >>
> >> implicit declaration of function 'getpagesize'
> >>
> >> the offending line being:
> >>
> >> #define IOMMAP(A)  (mmap(0,getpagesize(),PROT_READ|PROT_WRITE, MAP_SHARED, 
> >> iofd,A))
> >> ...
> >>   adc_io_cntl=(unsigned char *)IOMMAP(0x22400000);
> >>   if ( ! (*adc_io_cntl & 1) ) { return(ENXIO); }
> >>
> >>   adc_io_cntl=(unsigned char *)IOMMAP(0x10c00000);
> >>   adc_io_stat=(unsigned short *)IOMMAP(0x10800000);
> >>   adc_io_read=(unsigned short *)IOMMAP(0x10c00000);
> >>
> >>
> >> This function seems to have disappeared and I'm not sure what to replace 
> >> it with since I was not sure why such a large value was used.
> >>
> >> Can someone suggest a fix?
> >>
> > I use code like that, and assume you need #include <sys/mman.h> in there, 
> > although the man page for getpagesize says it is in unistd.h.
> >
> > Martin
> >
> > ps - I'm still using a 2.4 environment.
> 
> Jacques,
> 
> In the man pages for my reasonably uptodate x86 development environment, 
> the manpage for getpagesize does in fact say to include unistd.h
> Unfortunately adc_logger doesn't - so add a suitable #include and it should 
> go. I've not compiled it for anything other than the TS 2.4 setups.
> 
> I've just added
> 
>   #include <unistd.h>
> 
> before the include stdio.h and it still compiles fine in my cross 
> compilation setup for the TS on board 2.4 image.
> 
> cheers
> Jim
>

Thanks Jim, 

in fact I'd already added that line but found it was not needed for 2.4 with 
the cronky old Sarge toolchain, so I commented it out. For some reason I had 
not uncommented it when rebuilding for 2.6 with a recent gcc. Dumb question , 
sorry for noise.





------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU