[rrd-users] v1.3 on FreeBSD
Steven Hartland
killing at multiplay.co.uk
Sun Nov 18 06:55:08 CET 2007
Anyone had any luck getting v1.3 to compile cleanly on FreeBSD?
The first error was the one described here about
read-only variable 'ordering':
http://www.mail-archive.com/rrd-developers@lists.oetiker.ch/msg02057.html
Quite a simple fix.
The next one however is:
rrd_open.c: In function `rrd_open':
rrd_open.c:178: warning: implicit declaration of function `madvise'
rrd_open.c:178: warning: nested extern declaration of `madvise'
rrd_open.c:178: error: `MADV_WILLNEED' undeclared (first use in this function)
rrd_open.c:178: error: (Each undeclared identifier is reported only once
rrd_open.c:178: error: for each function it appears in.)
rrd_open.c:178: error: `MADV_SEQUENTIAL' undeclared (first use in this function)
rrd_open.c:181: warning: nested extern declaration of `madvise'
rrd_open.c:181: error: `MADV_RANDOM' undeclared (first use in this function)
rrd_open.c:210: warning: nested extern declaration of `madvise'
rrd_open.c: In function `mincore_print':
rrd_open.c:290: warning: implicit declaration of function `mincore'
rrd_open.c:290: warning: nested extern declaration of `mincore'
rrd_open.c:300: warning: long int format, different type arg (arg 6)
rrd_open.c:307: warning: long int format, different type arg (arg 6)
rrd_open.c: In function `rrd_dontneed':
rrd_open.c:342: warning: nested extern declaration of `madvise'
rrd_open.c:343: error: `MADV_DONTNEED' undeclared (first use in this function)
rrd_open.c:365: warning: nested extern declaration of `madvise'
rrd_open.c: In function `rrd_flush':
rrd_open.c:504: warning: implicit declaration of function `fdatasync'
rrd_open.c:504: warning: nested extern declaration of `fdatasync'
rrd_open.c: At top level:
rrd_open.c:278: warning: 'mincore_print' defined but not used
Which doesnt seem to be simple :(
>From what I can tell these are defined in sys/mman.h but are guarded
by __BSD_VISIBLE which is automatically set in sys/cdefs.h depending
on the values of _ANSI_SOURCE and _C99_SOURCE and as the Makefile
is defining -std=c99 I assume this is why the are unavailable.
Using the dirty hack of adding them in manually I then hit:
./.libs/librrd.so: undefined reference to `fdatasync'
It seems fdatasync doesnt exist on FreeBSD only fsync. My fix
here was to change fdatasync to fsync under #ifdef __FreeBSD__
in both rrd_open and rrd_create
Any advice on these issues appreciated.
Regards
Steve
================================================
This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it.
In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337
or return the E.mail to postmaster at multiplay.co.uk.
More information about the rrd-users
mailing list