~ubuntu-branches/ubuntu/saucy/clamav/saucy-backports

« back to all changes in this revision

Viewing changes to debian/patches/0004-Stop-using-a-cargo-culted-syscall-table-and-trust-th.patch

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman
  • Date: 2014-07-15 01:08:10 UTC
  • mfrom: (0.35.47 sid)
  • Revision ID: package-import@ubuntu.com-20140715010810-ru66ek4fun2iseba
Tags: 0.98.4+dfsg-2~ubuntu13.10.1
No-change backport to saucy (LP: #1341962)

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
5
 
 
6
 
---
7
 
 clamd/fan-syscalllib.h | 17 ++++-------------
8
 
 1 file changed, 4 insertions(+), 13 deletions(-)
9
 
 
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
14
 
@@ -2,27 +2,18 @@
15
 
 #define __FANOTIFY_SYSCALL_LIB
16
 
 
17
 
 #include <unistd.h>
18
 
-#include <linux/types.h>
19
 
-
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
26
 
-#else
27
 
-# error "System call numbers not defined for this architecture"
28
 
-#endif
29
 
+#include <sys/types.h>
30
 
+#include <sys/syscall.h>
31
 
 
32
 
 static inline int fanotify_init(unsigned int flags, unsigned int event_f_flags)
33
 
 {
34
 
-       return syscall(__NR_fanotify_init, flags, event_f_flags);
35
 
+       return syscall(SYS_fanotify_init, flags, event_f_flags);
36
 
 }
37
 
 
38
 
 static inline int fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask,
39
 
                                int dfd, const char *pathname)
40
 
 {
41
 
-       return syscall(__NR_fanotify_mark, fanotify_fd, flags, mask,
42
 
+       return syscall(SYS_fanotify_mark, fanotify_fd, flags, mask,
43
 
                       dfd, pathname);
44
 
 }
45
 
 #endif