bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch for the getpagesize module


From: Martin Lambers
Subject: Re: Patch for the getpagesize module
Date: Tue, 4 Dec 2007 21:04:04 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

On Tue, 04. Dec 2007, 09:45:02 +0100, Bruno Haible wrote:
> > > The implementation that you gave in your previous patch
> > > 
> > >  #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
> > >    SYSTEM_INFO system_info;
> > >    GetSystemInfo (&system_info);
> > >    return system_info.dwPageSize;
> > > 
> > > is the same as the one used in GNU clisp for 10 years, so you can assume
> > > that it works. (And its value on 32-bit x86 platforms is 0x1000.)
> > > 
> > > I would therefore find it reasonable to create a lib/getpagesize.c file
> > > just for this case of native Windows. What do you think?
> > 
> > Yes, but I'm not sure how the conditional compilation of this file
> > should be handled.
> > Should getpagesize.m4 call AC_LIBOBJ([getpagesize]) only on W32?
> 
> Yes. There is normally no point in compiling an empty object file.
> But you can put a prominent notice in the getpagesize.c file that it
> provides the function only for native Win32 platforms, and not for all
> platforms that lack the function.
> 
> Can you provide the patch, please? (My working environment is a bit disturbed
> these days, sorry.) Let me only document the issue about mprotect.

I'd like to, but I'm afraid I'm not sure what you would like to have.

Do you want to replace the getpagesize function from libgcc.a on MinGW
with the implementation above? Or do you want the implementation above
only for native Windows variants that don't have getpagesize? 

How can I test for these platforms in getpagesize.m4? 
I'd test for MinGW with something like this:

AC_REQUIRE([AC_CANONICAL_HOST])
case "$host_os" in
  mingw*)
    AC_LIBOBJ([getpagesize])
    ;;
esac

I could not find the host_os names of other W32 variants.

Martin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]