Mousepad and posix_madvise

Enrico Tröger enrico.troeger at
Sun Apr 15 14:05:21 CEST 2007


since I upgraded to GTK 2.10 I want to test Nick's new mousepad and ran
into a strange error:

mousepad-file.c: In function ‘mousepad_file_read_to_buffer’:
mousepad-file.c:298: warning: implicit declaration of function
‘posix_madvise’ mousepad-file.c:298: error: ‘POSIX_MADV_SEQUENTIAL’
undeclared (first use in this function) mousepad-file.c:298: error:
(Each undeclared identifier is reported only once mousepad-file.c:298:
error: for each function it appears in.) make[3]: ***
[mousepad-mousepad-file.o] Fehler 1

So, after asking our friend google, I found that
#define __USE_XOPEN2K 1
in mousepad-file.c before the inclusion of sys/mman.h would solve the
problem. But then I found a similar problem discussed[1] on the
thunar-ML and Benny added the following to thunar's

dnl ******************************************
dnl *** Linux/glibc specified work-arounds ***
dnl ******************************************
AC_TRY_LINK([#include <features.h>],
  if (__GLIBC_PREREQ (2, 0));
  AC_DEFINE([_XOPEN_SOURCE], [600], [Required to unbreak glibc])
  AC_DEFINE([_BSD_SOURCE], [1], [Required to unbreak glibc])

Probably, this is also useful for mousepad?
Nick, what do you think?

I ran into this on my Debian Testing with manually upgraded GTK 2.10
packages but the problem itself should be related to using glibc.

Furthermore, while compiling I get some warnings about usage of
uninitialised variables which stops compiling when using -Werror.
Should be easy to fix.



Get my GPG key from
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <>

More information about the Xfce4-dev mailing list