about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/tst-fanotify.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2013-12-31 03:12:54 -0500
committerMike Frysinger <vapier@gentoo.org>2013-12-31 03:16:42 -0500
commitc8590f9d9edc8d2b8540586648fc9a0130da469e (patch)
tree4c7c1cc4004fb98455b8c956ab21797cd08da97b /sysdeps/unix/sysv/linux/tst-fanotify.c
parentdd1d85e5ddd6baaf99f53964a718fab85b160149 (diff)
downloadglibc-c8590f9d9edc8d2b8540586648fc9a0130da469e.tar.gz
glibc-c8590f9d9edc8d2b8540586648fc9a0130da469e.tar.xz
glibc-c8590f9d9edc8d2b8540586648fc9a0130da469e.zip
tst-fanotify: check for linux/fanotify.h existence
We support older kernels that lack this header, so check for it
before we try to use it.

Reported-by: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'sysdeps/unix/sysv/linux/tst-fanotify.c')
-rw-r--r--sysdeps/unix/sysv/linux/tst-fanotify.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/tst-fanotify.c b/sysdeps/unix/sysv/linux/tst-fanotify.c
index ad9836b582..7b27545978 100644
--- a/sysdeps/unix/sysv/linux/tst-fanotify.c
+++ b/sysdeps/unix/sysv/linux/tst-fanotify.c
@@ -19,6 +19,18 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
+
+#ifndef HAVE_LINUX_FANOTIFY_H
+
+static int
+do_test (void)
+{
+  puts ("SKIP: missing support for fanotify due to old kernel headers");
+  return 0;
+}
+
+#else
+
 #include <sys/fanotify.h>
 
 static int
@@ -56,5 +68,7 @@ do_test (void)
   return 0;
 }
 
+#endif
+
 #define TEST_FUNCTION do_test ()
 #include "../test-skeleton.c"