Compiling librrd under Cygwin

Eliot Moss moss@cs.umass.edu
Sat Feb 20 13:17:36 GMT 2021


On 2/20/2021 5:11 AM, Andrey Repin wrote:
> Greetings, All!
> 
> I'm trying to match my Cygwin PHP install with native one, and one of the
> steps is to build rrd extension. There's no librrd shipped with Cygwin, so I
> have to build that first.
> 
> I've successfully configured it after installing of some -devel packages with
> `./configure --prefix=`, but compiling fails with
> 
> rrd_open.c: In function ‘rrd_open’:
> rrd_open.c:166:22: error: ‘MAP_FAILED’ undeclared (first use in this function)
>    166 |     char     *data = MAP_FAILED;
>        |                      ^~~~~~~~~~
> rrd_open.c:166:22: note: each undeclared identifier is reported only once for each function it appears in
> rrd_open.c:239:32: error: ‘PROT_READ’ undeclared (first use in this function)
>    239 |     rrd_simple_file->mm_prot = PROT_READ;
>        |                                ^~~~~~~~~
> rrd_open.c:251:37: error: ‘MAP_PRIVATE’ undeclared (first use in this function)
>    251 |         rrd_simple_file->mm_flags = MAP_PRIVATE;
>        |                                     ^~~~~~~~~~~
> rrd_open.c:265:41: error: ‘MAP_SHARED’ undeclared (first use in this function)
>    265 |             rrd_simple_file->mm_flags = MAP_SHARED;
>        |                                         ^~~~~~~~~~
> rrd_open.c:266:41: error: ‘PROT_WRITE’ undeclared (first use in this function)
>    266 |             rrd_simple_file->mm_prot |= PROT_WRITE;
>        |                                         ^~~~~~~~~~
> rrd_open.c:424:12: warning: implicit declaration of function ‘mmap’ [-Wimplicit-function-declaration]
>    424 |     data = mmap(0, rrd_file->file_len,
>        |            ^~~~
> rrd_open.c:424:12: warning: nested extern declaration of ‘mmap’ [-Wnested-externs]
> rrd_open.c:424:10: warning: assignment to ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
>    424 |     data = mmap(0, rrd_file->file_len,
>        |          ^
> rrd_open.c:576:9: warning: implicit declaration of function ‘munmap’ [-Wimplicit-function-declaration]
>    576 |         munmap(data, rrd_file->file_len);
>        |         ^~~~~~
> rrd_open.c:576:9: warning: nested extern declaration of ‘munmap’ [-Wnested-externs]
> make[1]: *** [Makefile:1060: librrdupd_la-rrd_open.lo] Error 1
> make[1]: Leaving directory '/c/arc/cygwin/software/librrd/rrdtool-1.7.2/src'
> make: *** [Makefile:503: install-recursive] Error 1

I didn't check every one of them, but these seem to live in /usr/include/sys/mman.h
in my installation.

Regards - Eliot Moss


More information about the Cygwin mailing list