Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fanotify: fanotify_init syscall declaration

This patch defines a new syscall fanotify_init() of the form:

int sys_fanotify_init(unsigned int flags, unsigned int event_f_flags,
unsigned int priority)

This syscall is used to create and fanotify group. This is very similar to
the inotify_init() syscall.

Signed-off-by: Eric Paris <eparis@redhat.com>

+25 -2
+1
arch/x86/ia32/ia32entry.S
··· 842 842 .quad compat_sys_rt_tgsigqueueinfo /* 335 */ 843 843 .quad sys_perf_event_open 844 844 .quad compat_sys_recvmmsg 845 + .quad sys_fanotify_init 845 846 ia32_syscall_end:
+2 -1
arch/x86/include/asm/unistd_32.h
··· 343 343 #define __NR_rt_tgsigqueueinfo 335 344 344 #define __NR_perf_event_open 336 345 345 #define __NR_recvmmsg 337 346 + #define __NR_fanotify_init 338 346 347 347 348 #ifdef __KERNEL__ 348 349 349 - #define NR_syscalls 338 350 + #define NR_syscalls 339 350 351 351 352 #define __ARCH_WANT_IPC_PARSE_VERSION 352 353 #define __ARCH_WANT_OLD_READDIR
+2
arch/x86/include/asm/unistd_64.h
··· 663 663 __SYSCALL(__NR_perf_event_open, sys_perf_event_open) 664 664 #define __NR_recvmmsg 299 665 665 __SYSCALL(__NR_recvmmsg, sys_recvmmsg) 666 + #define __NR_fanotify_init 300 667 + __SYSCALL(__NR_fanotify_init, sys_fanotify_init) 666 668 667 669 #ifndef __NO_STUBS 668 670 #define __ARCH_WANT_OLD_READDIR
+1
arch/x86/kernel/syscall_table_32.S
··· 337 337 .long sys_rt_tgsigqueueinfo /* 335 */ 338 338 .long sys_perf_event_open 339 339 .long sys_recvmmsg 340 + .long sys_fanotify_init
+1 -1
fs/notify/fanotify/Makefile
··· 1 - obj-$(CONFIG_FANOTIFY) += fanotify.o 1 + obj-$(CONFIG_FANOTIFY) += fanotify.o fanotify_user.o
+13
fs/notify/fanotify/fanotify_user.c
··· 1 + #include <linux/fcntl.h> 2 + #include <linux/fs.h> 3 + #include <linux/fsnotify_backend.h> 4 + #include <linux/security.h> 5 + #include <linux/syscalls.h> 6 + 7 + #include "fanotify.h" 8 + 9 + SYSCALL_DEFINE3(fanotify_init, unsigned int, flags, unsigned int, event_f_flags, 10 + unsigned int, priority) 11 + { 12 + return -ENOSYS; 13 + }
+2
include/linux/syscalls.h
··· 813 813 asmlinkage long sys_ppoll(struct pollfd __user *, unsigned int, 814 814 struct timespec __user *, const sigset_t __user *, 815 815 size_t); 816 + asmlinkage long sys_fanotify_init(unsigned int flags, unsigned int event_f_flags, 817 + unsigned int priority); 816 818 817 819 int kernel_execve(const char *filename, char *const argv[], char *const envp[]); 818 820
+3
kernel/sys_ni.c
··· 181 181 182 182 /* performance counters: */ 183 183 cond_syscall(sys_perf_event_open); 184 + 185 + /* fanotify! */ 186 + cond_syscall(sys_fanotify_init);