INN commit: trunk (contrib/reset-cnfs.c include/portable/mmap.h)

INN Commit rra at isc.org
Mon Sep 22 19:18:45 UTC 2014


    Date: Monday, September 22, 2014 @ 12:18:44
  Author: iulius
Revision: 9718

Fix build issues on AIX 7.1

mmap is redefined to mmap64 when large file support is enabled.

Modified:
  trunk/contrib/reset-cnfs.c
  trunk/include/portable/mmap.h

-------------------------+
 contrib/reset-cnfs.c    |    3 ++-
 include/portable/mmap.h |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

Modified: contrib/reset-cnfs.c
===================================================================
--- contrib/reset-cnfs.c	2014-09-21 19:54:27 UTC (rev 9717)
+++ contrib/reset-cnfs.c	2014-09-22 19:18:44 UTC (rev 9718)
@@ -46,7 +46,8 @@
                  * fuzz.  buf has 512 bytes in it, therefore containing data
                  * for (512 * 8) * 512 bytes of data. */
                 numwr = (st.st_size / (512*8) / sizeof(buf)) + 50;
-                printf("File %s: %lu %u\n", argv[i], st.st_size, numwr);
+                printf("File %s: %lu %u\n", argv[i],
+                       (long unsigned) st.st_size, numwr);
                 for (j = 0; j < numwr; j++) {
                     if (!(j % 100)) {
                         printf("\t%d/%d\n", j, numwr);

Modified: include/portable/mmap.h
===================================================================
--- include/portable/mmap.h	2014-09-21 19:54:27 UTC (rev 9717)
+++ include/portable/mmap.h	2014-09-22 19:18:44 UTC (rev 9718)
@@ -23,8 +23,8 @@
    (actually a caddr_t, which is a typedef for a char *) instead of void * as
    is required by the standard.  These macros add casts that silences compiler
    warnings on Solaris 8 without adversely affecting other platforms.  (ISO C
-   allows macro definitions of this sort; this macro is not recursive.) */
-#define mmap(s, l, p, f, d, o)	(void *) mmap((s), (l), (p), (f), (d), (o))
+   allows macro definitions of this sort; this macro is not recursive.)
+   Do not redefine mmap because at least AIX 7.1 redefines it to mmap64. */
 #define munmap(p, l)            munmap((void *)(p), (l))
 
 /* On some platforms, msync only takes two arguments.  (ANSI C allows macro



More information about the inn-committers mailing list