summaryrefslogtreecommitdiff
path: root/dist/aclocal/mmap.m4
diff options
context:
space:
mode:
Diffstat (limited to 'dist/aclocal/mmap.m4')
-rw-r--r--dist/aclocal/mmap.m417
1 files changed, 13 insertions, 4 deletions
diff --git a/dist/aclocal/mmap.m4 b/dist/aclocal/mmap.m4
index 727c6c35..cb20228c 100644
--- a/dist/aclocal/mmap.m4
+++ b/dist/aclocal/mmap.m4
@@ -1,4 +1,4 @@
-# Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015 Oracle and/or its affiliates. All rights reserved.
# Detect mmap capability: If the file underlying an mmap is extended,
# does the addressable memory grow too?
@@ -28,8 +28,10 @@ if test "$mmap_ok" = "yes" ; then
/* Not all these includes are needed, but the minimal set varies from
* system to system.
*/
+ #include <stdlib.h>
#include <stdio.h>
#include <string.h>
+ #include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -41,18 +43,25 @@ if test "$mmap_ok" = "yes" ; then
#ifndef MAP_FAILED
#define MAP_FAILED (-1)
#endif
+ /* Prevent unused variabl warnings by setting and using it. */
+ #define COMPQUIET(n, v) do { \
+ (n) = (v); \
+ (n) = (n); \
+ } while (0)
- int catch_sig(sig)
+
+ void catch_sig(sig)
int sig;
{
+ COMPQUIET(sig,0);
exit(1);
}
- main() {
+ int main() {
const char *underlying;
unsigned gapsize;
char *base;
- int count, fd, i, mode, open_flags, ret, total_size;
+ int count, fd, i, mode, open_flags, total_size;
char buf[TEST_MMAP_BUFSIZE];
gapsize = 1024;