From c50982c442b724cb571b53499847511027bbbdd5 Mon Sep 17 00:00:00 2001 From: David Raynor Date: Wed, 5 Feb 2014 16:37:24 -0500 Subject: [PATCH] bb#9156/10335: switch fanotify support to use sys/fanotify.h instead of coded syscalls --- ChangeLog | 4 ++++ clamd/fan-syscalllib.h | 28 ---------------------------- clamd/fan.c | 3 +-- configure | 4 ++-- configure.ac | 2 +- 5 files changed, 8 insertions(+), 33 deletions(-) delete mode 100644 clamd/fan-syscalllib.h diff --git a/ChangeLog b/ChangeLog index a19c3c015..62286952f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Wed Feb 5 14:30:24 2013 EDT 2013 (dar) +------------------------------------ + * bb#9156/10335: switch fanotify support to use sys/fanotify.h instead of coded syscalls + Mon Dec 5 18:10:24 2013 EDT 2013 (morgan) ------------------------------------ * bb#9595 fix for sigs targeted for ascii files containing offsets of the form EOF-n. diff --git a/clamd/fan-syscalllib.h b/clamd/fan-syscalllib.h deleted file mode 100644 index 288cd9926..000000000 --- a/clamd/fan-syscalllib.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef __FANOTIFY_SYSCALL_LIB -#define __FANOTIFY_SYSCALL_LIB - -#include -#include - -#if defined(__x86_64__) -# define __NR_fanotify_init 300 -# define __NR_fanotify_mark 301 -#elif defined(__i386__) -# define __NR_fanotify_init 338 -# define __NR_fanotify_mark 339 -#else -# error "System call numbers not defined for this architecture" -#endif - -static inline int fanotify_init(unsigned int flags, unsigned int event_f_flags) -{ - return syscall(__NR_fanotify_init, flags, event_f_flags); -} - -static inline int fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask, - int dfd, const char *pathname) -{ - return syscall(__NR_fanotify_mark, fanotify_fd, flags, mask, - dfd, pathname); -} -#endif diff --git a/clamd/fan.c b/clamd/fan.c index e4ec5a367..70da61d62 100644 --- a/clamd/fan.c +++ b/clamd/fan.c @@ -34,8 +34,7 @@ #include #include -#include -#include "fan-syscalllib.h" +#include #include "fan.h" #include "libclamav/clamav.h" diff --git a/configure b/configure index 717c216e6..941b43c9e 100755 --- a/configure +++ b/configure @@ -17890,8 +17890,8 @@ $as_echo "#define C_LINUX 1" >>confdefs.h THREAD_LIBS="-lpthread" TH_SAFE="-thread-safe" if test "$want_fanotify" = "yes"; then - ac_fn_c_check_header_mongrel "$LINENO" "linux/fanotify.h" "ac_cv_header_linux_fanotify_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_fanotify_h" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "sys/fanotify.h" "ac_cv_header_sys_fanotify_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_fanotify_h" = xyes; then : $as_echo "#define FANOTIFY 1" >>confdefs.h diff --git a/configure.ac b/configure.ac index 4c0b8ed36..bd8c39f8e 100644 --- a/configure.ac +++ b/configure.ac @@ -1072,7 +1072,7 @@ linux*) THREAD_LIBS="-lpthread" TH_SAFE="-thread-safe" if test "$want_fanotify" = "yes"; then - AC_CHECK_HEADER([linux/fanotify.h],AC_DEFINE([FANOTIFY],1,[use fanotify]),) + AC_CHECK_HEADER([sys/fanotify.h],AC_DEFINE([FANOTIFY],1,[use fanotify]),) fi fi ;;