]> git.proxmox.com Git - mirror_lxcfs.git/commitdiff
tree-wide: set _GNU_SOURCE in meson.build
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 14 Oct 2021 15:04:14 +0000 (17:04 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 14 Oct 2021 15:04:14 +0000 (17:04 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
23 files changed:
meson.build
src/bindings.c
src/cgroup_fuse.c
src/cgroups/cgfsng.c
src/cgroups/cgroup.c
src/cgroups/cgroup.h
src/cgroups/cgroup2_devices.c
src/cgroups/cgroup2_devices.h
src/cgroups/cgroup_utils.c
src/cgroups/cgroup_utils.h
src/cpuset_parse.c
src/cpuset_parse.h
src/lxcfs.c
src/macro.h
src/proc_cpuview.c
src/proc_fuse.c
src/proc_loadavg.c
src/syscall_numbers.h
src/sysfs_fuse.c
src/utils.c
tests/cpusetrange.c
tests/test-read.c
tests/test_syscalls.c

index c873b9b6976226464bab4023c8c8bbdb3a39efc8..513671361699af1a9cea746f9a230d9104105cc3 100644 (file)
@@ -125,6 +125,7 @@ foreach ident : [
         conf.set10('HAVE_' + ident[0].to_upper(), have)
 endforeach
 
+conf.set('_GNU_SOURCE', true)
 conf.set('_FILE_OFFSET_BITS', 64)
 
 libfuse = dependency('fuse3', required : false)
index dc4da14281ec69ef2eda8c03b3a9be093356534f..eb62ddbdbc656686aec33735056a4b131bd45c69 100644 (file)
@@ -1,9 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
 #include "config.h"
 
 #include <dirent.h>
index cfdf77013408dc14b7c8c2e5ecfc9202a21cff5b..5c22fd15d5c7f45cfdee3bc02f7cde8ae0c5e183 100644 (file)
@@ -1,12 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
 #include "config.h"
 
-#define __STDC_FORMAT_MACROS
 #include <dirent.h>
 #include <errno.h>
 #include <fcntl.h>
index eb951b40c6839d08150be0fc95fb70b8982bb751..b0d26569647668e4aeaef1fd1296aeb39043519a 100644 (file)
  * a comma-separated list of controllers.
  */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
 #include "config.h"
 
 #include <ctype.h>
index 7aec7aed6a290179dba4fa89a79bd6bb43047a4a..5bf7f62daced53773203615efb004d154bd1dd88 100644 (file)
@@ -1,9 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
 #include "config.h"
 
 #include <dirent.h>
index c9ea370079c2bf3e9cbe0958ec771471f97b48d6..122e8ebfb80d1df86ca983c38996641bfce87ec6 100644 (file)
@@ -3,22 +3,13 @@
 #ifndef __LXC_CGROUP_H
 #define __LXC_CGROUP_H
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
-#ifndef FUSE_USE_VERSION
-#define FUSE_USE_VERSION 26
-#endif
-
-#define _FILE_OFFSET_BITS 64
+#include "config.h"
 
 #include <errno.h>
 #include <stdbool.h>
 #include <stddef.h>
 #include <sys/types.h>
 
-#include "../config.h"
 #include "../macro.h"
 #include "../memory_utils.h"
 
index 06d258fa15eb32fdae226add2867b11a7f993be7..e2eab796a0465c85267674575683bc42a694d291 100644 (file)
@@ -2,10 +2,6 @@
 
 /* Parts of this taken from systemd's implementation. */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
 #include "config.h"
 
 #include <errno.h>
index 67a2da8c7d09b491837c564e4f2731872d48633d..6de10216ea857d08858c73a0a5a25864f140aecc 100644 (file)
@@ -5,15 +5,7 @@
 #ifndef __LXC_CGROUP2_DEVICES_H
 #define __LXC_CGROUP2_DEVICES_H
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
-#ifndef FUSE_USE_VERSION
-#define FUSE_USE_VERSION 26
-#endif
-
-#define _FILE_OFFSET_BITS 64
+#include "config.h"
 
 #include <errno.h>
 #include <fcntl.h>
index f4ae4ccf93849c5cb2a3f72010be9be682b10aad..83e4cbf7fa4b4f6b56f5a6d85a1e8f6bce447c6e 100644 (file)
@@ -1,9 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
 #include "config.h"
 
 #include <fcntl.h>
index 8576e5e4ec54be506871087a23f8356a6b469007..f4316866fc7e31067213383f7c4e4f49d20ae2af 100644 (file)
@@ -3,15 +3,7 @@
 #ifndef __LXC_CGROUP_UTILS_H
 #define __LXC_CGROUP_UTILS_H
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
-#ifndef FUSE_USE_VERSION
-#define FUSE_USE_VERSION 26
-#endif
-
-#define _FILE_OFFSET_BITS 64
+#include "config.h"
 
 #include <fcntl.h>
 #include <stdarg.h>
@@ -25,7 +17,6 @@
 #include <sys/vfs.h>
 #include <unistd.h>
 
-#include "../config.h"
 #include "../macro.h"
 #include "../memory_utils.h"
 
index c2edbc0457b80aff4a1d433586e7409eb4e1eebc..e511bb021745c78837dfef4eb34646f3571a8a58 100644 (file)
@@ -1,15 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
 #include "config.h"
 
-#define _FILE_OFFSET_BITS 64
-
-#define __STDC_FORMAT_MACROS
-
 #include <stdio.h>
 #include <string.h>
 #include <stdbool.h>
index 5ff8e668bdd414957eb1c1d5bfbd567fa665bdfa..332434577398f8804eceea8d88382c40fb5c3327 100644 (file)
@@ -3,11 +3,7 @@
 #ifndef __LXCFS_CPUSET_PARSE_H
 #define __LXCFS_CPUSET_PARSE_H
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
-#define _FILE_OFFSET_BITS 64
+#include "config.h"
 
 #include <stdbool.h>
 #include <stdio.h>
index 232da6044196a657b58fc5c3a05434f99cfdd7f3..307f5c6b9a4b3d8466463ad58e7aa13b60ab0e9e 100644 (file)
@@ -1,9 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
 #include "config.h"
 
 #include <alloca.h>
index b9abf11a207429d4e31799c12ae7265319ba68c6..caa0126f916ec833b42eaf0f02ced11fded62157 100644 (file)
@@ -3,20 +3,10 @@
 #ifndef __LXCFS_MACRO_H
 #define __LXCFS_MACRO_H
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
-#ifndef FUSE_USE_VERSION
-#define FUSE_USE_VERSION 26
-#endif
-
-#define _FILE_OFFSET_BITS 64
+#include "config.h"
 
 #include <stdio.h>
 
-#include "config.h"
-
 #define BATCH_SIZE 50
 
 /* filesystem magic values */
index b3bed6d01363bb8d9c40c1a8c1a20fe904006cb6..472d69dff40792d477d805626452f26b01e15c67 100644 (file)
@@ -1,12 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
 #include "config.h"
 
-#define __STDC_FORMAT_MACROS
 #include <dirent.h>
 #include <errno.h>
 #include <fcntl.h>
index 80dc9a329b6307925fbc2a22886770a88e4138e1..4ac5d44b0a10c32033044f89627e3b303a8d51b4 100644 (file)
@@ -1,12 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
 #include "config.h"
 
-#define __STDC_FORMAT_MACROS
 #include <dirent.h>
 #include <errno.h>
 #include <fcntl.h>
index b70437a930239739c29a4659b3fa5079ba329005..5f9bec7920548330b6b975f79413b03519179b5f 100644 (file)
@@ -1,12 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
 #include "config.h"
 
-#define __STDC_FORMAT_MACROS
 #include <dirent.h>
 #include <errno.h>
 #include <fcntl.h>
index 41eb5dcc730e99f3c31b1bd0f22dc5fb39405539..c9006af3bd6e77e28a2b3601aabab3d2b0a3b73c 100644 (file)
@@ -2,9 +2,8 @@
 #ifndef __LXCFS_SYSCALL_NUMBERS_H
 #define __LXCFS_SYSCALL_NUMBERS_H
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE 1
-#endif
+#include "config.h"
+
 #include <asm/unistd.h>
 #include <errno.h>
 #include <sched.h>
index 4525b69e92612ecb9e75df66bafc48c73f677bd4..b07464c7383cc1dbc6aaef2f5e448a4d3cbc564c 100644 (file)
@@ -1,17 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
 #include "config.h"
 
-/* Taken over modified from the kernel sources. */
-#define NBITS 32 /* bits in uint32_t */
-#define DIV_ROUND_UP(n, d) (((n) + (d)-1) / (d))
-#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, NBITS)
-
-#define __STDC_FORMAT_MACROS
 #include <ctype.h>
 #include <dirent.h>
 #include <errno.h>
 #include "lxcfs_fuse_compat.h"
 #include "utils.h"
 
+/* Taken over modified from the kernel sources. */
+#define NBITS 32 /* bits in uint32_t */
+#define DIV_ROUND_UP(n, d) (((n) + (d)-1) / (d))
+#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, NBITS)
+
 static ssize_t get_max_cpus(char *cpulist)
 {
        char *c1, *c2;
index 99271854ebb8ee23e1d592b50bfd4f26fe753334..b826b2ef20c172934c1d5cc5a3c0afb2e4f84000 100644 (file)
@@ -1,12 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
 #include "config.h"
 
-#define _FILE_OFFSET_BITS 64
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
index 38eea26b73b846114e8c96881dd69d12f633c6bd..50af4ff506f6ae1b03bdc43427b5cabb280154ed 100644 (file)
@@ -1,9 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
 #include "config.h"
 
 #include <stdio.h>
index 9166dde842077dc374bbea9d408043b0b1d5a86a..2929c35a54a3aff01f9ea50b61c9eed60408a502 100644 (file)
@@ -1,9 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
 #include "config.h"
 
 #include <stdio.h>
index f0dbf455815da747488659b735e73be614955084..56137f210fbbf7a75ebae1d58774efcd8f192c88 100644 (file)
@@ -1,9 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
 #include "config.h"
 
 #include <errno.h>