1
From fa5fdd205e4958c304f3dfd10173eb4e0c35596f Mon Sep 17 00:00:00 2001
2
From: Scott Kitterman <scott@kitterman.com>
3
Date: Mon, 10 Mar 2014 19:57:02 -0400
4
Subject: Stop using a cargo-culted syscall table and trust the glibc headers
7
clamd/fan-syscalllib.h | 17 ++++-------------
8
1 file changed, 4 insertions(+), 13 deletions(-)
10
diff --git a/clamd/fan-syscalllib.h b/clamd/fan-syscalllib.h
11
index 288cd99..b130635 100644
12
--- a/clamd/fan-syscalllib.h
13
+++ b/clamd/fan-syscalllib.h
15
#define __FANOTIFY_SYSCALL_LIB
18
-#include <linux/types.h>
20
-#if defined(__x86_64__)
21
-# define __NR_fanotify_init 300
22
-# define __NR_fanotify_mark 301
23
-#elif defined(__i386__)
24
-# define __NR_fanotify_init 338
25
-# define __NR_fanotify_mark 339
27
-# error "System call numbers not defined for this architecture"
29
+#include <sys/types.h>
30
+#include <sys/syscall.h>
32
static inline int fanotify_init(unsigned int flags, unsigned int event_f_flags)
34
- return syscall(__NR_fanotify_init, flags, event_f_flags);
35
+ return syscall(SYS_fanotify_init, flags, event_f_flags);
38
static inline int fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask,
39
int dfd, const char *pathname)
41
- return syscall(__NR_fanotify_mark, fanotify_fd, flags, mask,
42
+ return syscall(SYS_fanotify_mark, fanotify_fd, flags, mask,