Browse code

bb#9156/10335: switch fanotify support to use sys/fanotify.h instead of coded syscalls

David Raynor authored on 2014/02/06 06:37:24
Showing 5 changed files
... ...
@@ -1,3 +1,7 @@
1
+Wed Feb 5 14:30:24 2013 EDT 2013 (dar)
2
+------------------------------------
3
+ * bb#9156/10335: switch fanotify support to use sys/fanotify.h instead of coded syscalls
4
+
1 5
 Mon Dec 5 18:10:24 2013 EDT 2013 (morgan)
2 6
 ------------------------------------
3 7
  * bb#9595 fix for sigs targeted for ascii files containing offsets of the form EOF-n.
4 8
deleted file mode 100644
... ...
@@ -1,28 +0,0 @@
1
-#ifndef __FANOTIFY_SYSCALL_LIB
2
-#define __FANOTIFY_SYSCALL_LIB
3
-
4
-#include <unistd.h>
5
-#include <linux/types.h>
6
-
7
-#if defined(__x86_64__)
8
-# define __NR_fanotify_init	300
9
-# define __NR_fanotify_mark	301
10
-#elif defined(__i386__)
11
-# define __NR_fanotify_init	338
12
-# define __NR_fanotify_mark	339
13
-#else
14
-# error "System call numbers not defined for this architecture"
15
-#endif
16
-
17
-static inline int fanotify_init(unsigned int flags, unsigned int event_f_flags)
18
-{
19
-	return syscall(__NR_fanotify_init, flags, event_f_flags);
20
-}
21
-
22
-static inline int fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask,
23
-				int dfd, const char *pathname)
24
-{
25
-	return syscall(__NR_fanotify_mark, fanotify_fd, flags, mask,
26
-		       dfd, pathname);
27
-}
28
-#endif
... ...
@@ -34,8 +34,7 @@
34 34
 #include <string.h>
35 35
 #include <errno.h>
36 36
 
37
-#include <linux/fanotify.h>
38
-#include "fan-syscalllib.h"
37
+#include <sys/fanotify.h>
39 38
 #include "fan.h"
40 39
 
41 40
 #include "libclamav/clamav.h"
... ...
@@ -17890,8 +17890,8 @@ $as_echo "#define C_LINUX 1" >>confdefs.h
17890 17890
 	THREAD_LIBS="-lpthread"
17891 17891
 	TH_SAFE="-thread-safe"
17892 17892
 	if test "$want_fanotify" = "yes"; then
17893
-	    ac_fn_c_check_header_mongrel "$LINENO" "linux/fanotify.h" "ac_cv_header_linux_fanotify_h" "$ac_includes_default"
17894
-if test "x$ac_cv_header_linux_fanotify_h" = xyes; then :
17893
+	    ac_fn_c_check_header_mongrel "$LINENO" "sys/fanotify.h" "ac_cv_header_sys_fanotify_h" "$ac_includes_default"
17894
+if test "x$ac_cv_header_sys_fanotify_h" = xyes; then :
17895 17895
 
17896 17896
 $as_echo "#define FANOTIFY 1" >>confdefs.h
17897 17897
 
... ...
@@ -1072,7 +1072,7 @@ linux*)
1072 1072
 	THREAD_LIBS="-lpthread"
1073 1073
 	TH_SAFE="-thread-safe"
1074 1074
 	if test "$want_fanotify" = "yes"; then
1075
-	    AC_CHECK_HEADER([linux/fanotify.h],AC_DEFINE([FANOTIFY],1,[use fanotify]),)
1075
+	    AC_CHECK_HEADER([sys/fanotify.h],AC_DEFINE([FANOTIFY],1,[use fanotify]),)
1076 1076
 	fi
1077 1077
     fi
1078 1078
     ;;