summaryrefslogtreecommitdiff
path: root/samples/vfs/mountinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'samples/vfs/mountinfo.c')
-rw-r--r--samples/vfs/mountinfo.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/samples/vfs/mountinfo.c b/samples/vfs/mountinfo.c
index f47c035cc339..bc78275cac69 100644
--- a/samples/vfs/mountinfo.c
+++ b/samples/vfs/mountinfo.c
@@ -8,11 +8,6 @@
#define __SANE_USERSPACE_TYPES__
#include <stdio.h>
#include <stdint.h>
-#include <sys/ioctl.h>
-#include <sys/syscall.h>
-#include <linux/pidfd.h>
-#include <linux/mount.h>
-#include <linux/nsfs.h>
#include <unistd.h>
#include <alloca.h>
#include <getopt.h>
@@ -20,6 +15,8 @@
#include <stdbool.h>
#include <errno.h>
+#include "samples-vfs.h"
+
/* max mounts per listmount call */
#define MAXMOUNTS 1024
@@ -28,6 +25,10 @@
static bool ext_format;
+#ifndef __NR_pidfd_open
+#define __NR_pidfd_open -1
+#endif
+
/*
* There are no bindings in glibc for listmount() and statmount() (yet),
* make our own here.
@@ -232,7 +233,7 @@ int main(int argc, char * const *argv)
}
/* Get a pidfd for pid */
- pidfd = syscall(SYS_pidfd_open, pid, 0);
+ pidfd = syscall(__NR_pidfd_open, pid, 0);
if (pidfd < 0) {
perror("pidfd_open");
return 1;