]> Savannah Git Hosting - gnulib.git/commitdiff
vma-iter: Make it work on 32-bit Solaris with module 'largefile'.
authorBruno Haible <bruno@clisp.org>
Sat, 30 Sep 2017 16:16:03 +0000 (18:16 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 30 Sep 2017 16:16:03 +0000 (18:16 +0200)
* modules/vma-iter: Don't test for sys/procfs.h, as this test would
fail when module 'largefile' is in use.
* lib/vma-iter.h (VMA_ITERATE_SUPPORTED): Don't test HAVE_SYS_PROCFS_H.
* lib/vma-iter.c: Undefine _FILE_OFFSET_BITS early.
Don't test HAVE_SYS_PROCFS_H.

ChangeLog
lib/vma-iter.c
lib/vma-iter.h
modules/vma-iter

index 0d219bd392f395845ca2c6483ee4372ae932bcbf..e02588dd34633000bde001357d956ce24f25c366 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2017-09-30  Bruno Haible  <bruno@clisp.org>
+
+       vma-iter: Make it work on 32-bit Solaris with module 'largefile'.
+       * modules/vma-iter: Don't test for sys/procfs.h, as this test would
+       fail when module 'largefile' is in use.
+       * lib/vma-iter.h (VMA_ITERATE_SUPPORTED): Don't test HAVE_SYS_PROCFS_H.
+       * lib/vma-iter.c: Undefine _FILE_OFFSET_BITS early.
+       Don't test HAVE_SYS_PROCFS_H.
+
 2017-09-30  Bruno Haible  <bruno@clisp.org>
 
        havelib: Make it work for CC="gcc -m32" (regression from 2017-02-19).
index 961e5a210cb0aaf68aa74c8b53dfc039a3cd6f68..3d105e84cf9289280510f53f74fd1e797c4f8d58 100644 (file)
 
 #include <config.h>
 
+/* On Solaris in 32-bit mode, when gnulib module 'largefile' is in use,
+   prevent a compilation error
+     "Cannot use procfs in the large file compilation environment"
+   The files that we access in this compilation unit are less than 2 GB
+   large.  */
+#if defined __sun
+# undef _FILE_OFFSET_BITS
+#endif
+
 /* Specification.  */
 #include "vma-iter.h"
 
@@ -49,7 +58,7 @@
 # include <sys/procfs.h> /* PIOC*, prmap_t */
 #endif
 
-#if defined __sun && HAVE_SYS_PROCFS_H /* Solaris */
+#if defined __sun /* Solaris */
 # include <string.h> /* memcpy */
 # include <sys/types.h>
 # include <sys/mman.h> /* mmap, munmap */
@@ -814,7 +823,7 @@ vma_iterate (vma_iterate_callback_fn callback, void *data)
   close (fd);
   return -1;
 
-#elif defined __sun && HAVE_SYS_PROCFS_H /* Solaris */
+#elif defined __sun /* Solaris */
 
   /* Note: Solaris <sys/procfs.h> defines a different type prmap_t with
      _STRUCTURED_PROC than without! Here's a table of sizeof(prmap_t):
index 2346972c9ef70f6dd0ad6f2f70133defec5fc7b4..13fb538ac03b4f61941d72913e73cf51928a7835 100644 (file)
@@ -52,7 +52,7 @@ extern int vma_iterate (vma_iterate_callback_fn callback, void *data);
    this platform.
    Note that even when this macro is defined, vma_iterate() may still fail to
    find any virtual memory area, for example if /proc is not mounted.  */
-#if defined __linux__ || defined __FreeBSD_kernel__ || defined __FreeBSD__ || defined __DragonFly__ || defined __NetBSD__ || defined __sgi || defined __osf__ || (defined __sun && HAVE_SYS_PROCFS_H) || HAVE_PSTAT_GETPROCVM || (defined __APPLE__ && defined __MACH__) || (defined _WIN32 || defined __WIN32__) || defined __CYGWIN__ || defined __BEOS__ || defined __HAIKU__ || HAVE_MQUERY
+#if defined __linux__ || defined __FreeBSD_kernel__ || defined __FreeBSD__ || defined __DragonFly__ || defined __NetBSD__ || defined __sgi || defined __osf__ || defined __sun || HAVE_PSTAT_GETPROCVM || (defined __APPLE__ && defined __MACH__) || (defined _WIN32 || defined __WIN32__) || defined __CYGWIN__ || defined __BEOS__ || defined __HAIKU__ || HAVE_MQUERY
 # define VMA_ITERATE_SUPPORTED 1
 #endif
 
index b681e2bdceaa507d054d762e0ae9750c43dc28bf..08f3c0f0be085b6a9f8398022692cf89522219ed 100644 (file)
@@ -16,8 +16,6 @@ configure.ac:
 gl_FUNC_MMAP_ANON
 AC_REQUIRE([AC_C_INLINE])
 AC_CHECK_FUNCS_ONCE([mquery pstat_getprocvm])
-dnl On Solaris <= 9, <sys/procfs.h> is unusable when AC_SYS_LARGEFILE is in use.
-AC_CHECK_HEADERS([sys/procfs.h])
 
 Makefile.am:
 lib_SOURCES += vma-iter.c