Move the mmap wrapper to 'common/compat/'
authorMichael Jeanson <mjeanson@efficios.com>
Fri, 2 Apr 2021 22:45:31 +0000 (18:45 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 13 Apr 2021 18:20:22 +0000 (14:20 -0400)
This is part of an effort to standardize our autotools setup across
projects to simplify maintenance.

Change-Id: I6fd5517793459c89fe22249ae08e844874a3a7fe
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/common/Makefile.am
src/common/compat/mmap.h [new file with mode: 0644]
src/common/counter/shm.c
src/common/ringbuffer/mmap.h [deleted file]
src/common/ringbuffer/shm.c

index fdbbc05c7bd4cf7188cfd6701eee7d6473dc9aff..1c6fcbf0704a4e63161cd48580a4c41274da2d2d 100644 (file)
@@ -19,6 +19,7 @@ noinst_HEADERS = \
 
 noinst_HEADERS += \
        compat/dlfcn.h \
+       compat/mmap.h \
        compat/tid.h
 
 # These headers should be moved to the public headers when tested and
@@ -85,7 +86,6 @@ libringbuffer_la_SOURCES = \
        ringbuffer/frontend_internal.h \
        ringbuffer/frontend_types.h \
        ringbuffer/getcpu.h \
-       ringbuffer/mmap.h \
        ringbuffer/nohz.h \
        ringbuffer/rb-init.h \
        ringbuffer/ring_buffer_backend.c \
diff --git a/src/common/compat/mmap.h b/src/common/compat/mmap.h
new file mode 100644 (file)
index 0000000..331f6c9
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ * Copyright (C) 2019 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
+ */
+
+#ifndef _UST_COMMON_COMPAT_MMAP_H
+#define _UST_COMMON_COMPAT_MMAP_H
+
+#include <sys/mman.h>
+
+#if defined(__linux__) && defined(MAP_POPULATE)
+# define LTTNG_MAP_POPULATE MAP_POPULATE
+#else
+# define LTTNG_MAP_POPULATE 0
+#endif /* __linux__ && MAP_POPULATE */
+
+#endif /* _UST_COMMON_COMPAT_MMAP_H */
index 596d5e5978578b4a9e81ac9605be5c19c92779a1..e421d045c991a02be48e655a044c42d30d0c2491 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "common/macros.h"
 #include "common/ust-fd.h"
-#include "common/ringbuffer/mmap.h"
+#include "common/compat/mmap.h"
 
 /*
  * Ensure we have the required amount of space available by writing 0
diff --git a/src/common/ringbuffer/mmap.h b/src/common/ringbuffer/mmap.h
deleted file mode 100644 (file)
index 39c0624..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * SPDX-License-Identifier: LGPL-2.1-only
- *
- * Copyright (C) 2019 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
- */
-
-#ifndef _LTTNG_MMAP_H
-#define _LTTNG_MMAP_H
-
-#include <sys/mman.h>
-
-#if defined(__linux__) && defined(MAP_POPULATE)
-# define LTTNG_MAP_POPULATE MAP_POPULATE
-#else
-# define LTTNG_MAP_POPULATE 0
-#endif /* __linux__ && MAP_POPULATE */
-
-#endif /* _LTTNG_MMAP_H */
index a5de019cd8dac4e91fb8fdbbab3101e4788c04da..8be7e359ea30ab4c7dec5b642ccc5b122e5745c6 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "common/macros.h"
 #include "common/ust-fd.h"
-#include "mmap.h"
+#include "common/compat/mmap.h"
 
 /*
  * Ensure we have the required amount of space available by writing 0
This page took 0.026952 seconds and 4 git commands to generate.