]> Savannah Git Hosting - gnulib.git/commitdiff
vma-iter: Fix conflict with module 'largefile' on 32-bit Solaris 9.
authorBruno Haible <bruno@clisp.org>
Tue, 18 Apr 2017 23:03:34 +0000 (01:03 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 18 Apr 2017 23:03:34 +0000 (01:03 +0200)
* modules/vma-iter (configure.ac): Test whether <sys/procfs.h> can be
included.
* lib/vma-iter.c: On Solaris, test HAVE_SYS_PROCFS_H before including
<sys/procfs.h>.
* lib/vma-iter.h (VMA_ITERATE_SUPPORTED): Don't define on Solaris when
<sys/procfs.h> cannot be included.
Reported by Tom G. Christensen <tgc@jupiterrise.com>.

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

index f056a84f831af2981cf7c6fc7579634b4b124cfd..4c7113662a1332555097cb51f5f5668a045d82ae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2017-04-18  Bruno Haible  <bruno@clisp.org>
+
+       vma-iter: Fix conflict with module 'largefile' on 32-bit Solaris 9.
+       * modules/vma-iter (configure.ac): Test whether <sys/procfs.h> can be
+       included.
+       * lib/vma-iter.c: On Solaris, test HAVE_SYS_PROCFS_H before including
+       <sys/procfs.h>.
+       * lib/vma-iter.h (VMA_ITERATE_SUPPORTED): Don't define on Solaris when
+       <sys/procfs.h> cannot be included.
+       Reported by Tom G. Christensen <tgc@jupiterrise.com>.
+
 2017-04-18  Bruno Haible  <bruno@clisp.org>
 
        getopt-gnu: Add comments.
index 7356188f15a398481bb817f170ba03c5fe4a6b48..d4bae13183e5dc73c3bf162e639868cd43a74607 100644 (file)
@@ -32,7 +32,7 @@
 # include <sys/procfs.h> /* PIOC*, prmap_t */
 #endif
 
-#if defined __sun /* Solaris */
+#if defined __sun && HAVE_SYS_PROCFS_H /* Solaris */
 # include <string.h> /* memcpy */
 # include <sys/types.h>
 # include <sys/mman.h> /* mmap, munmap */
@@ -378,7 +378,7 @@ vma_iterate (vma_iterate_callback_fn callback, void *data)
   close (fd);
   return -1;
 
-#elif defined __sun /* Solaris */
+#elif defined __sun && HAVE_SYS_PROCFS_H /* 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 bb1f3c1e76b4f72d7fc288ee8684a71066419d07..95374efb65bed59bbcb073f35b19ed4f0e540629 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__ || 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
+#if defined __linux__ || defined __FreeBSD__ || 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
 # define VMA_ITERATE_SUPPORTED 1
 #endif
 
index df9e7b854884b9fab1f7437b5075c7d503502e92..40e560532cc26b3befd734ca135097ba4aed1628 100644 (file)
@@ -15,6 +15,8 @@ getpagesize
 configure.ac:
 gl_FUNC_MMAP_ANON
 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