From 1e3ccf4b6a5ffee1f57dd50c23ae20499ed74910 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sat, 20 Jan 2007 17:08:37 +0100 Subject: inotify-syscalls.h: Check whether the syscall numbers are already defined glibc already defines the inotify syscall numbers on some architectures. This should fix the following warning on arm and hppa: In file included from inotail.c:37: inotify-syscalls.h:50:1: warning: "__NR_inotify_init" redefined In file included from /usr/include/sys/syscall.h:25, from inotify-syscalls.h:13, from inotail.c:37: /usr/include/asm/unistd.h:344:1: warning: this is the location of the previous definition In file included from inotail.c:37: inotify-syscalls.h:51:1: warning: "__NR_inotify_add_watch" redefined In file included from /usr/include/sys/syscall.h:25, from inotify-syscalls.h:13, from inotail.c:37: /usr/include/asm/unistd.h:345:1: warning: this is the location of the previous definition In file included from inotail.c:37: inotify-syscalls.h:52:1: warning: "__NR_inotify_rm_watch" redefined In file included from /usr/include/sys/syscall.h:25, from inotify-syscalls.h:13, from inotail.c:37: /usr/include/asm/unistd.h:346:1: warning: this is the location of the previous definition --- inotify-syscalls.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'inotify-syscalls.h') diff --git a/inotify-syscalls.h b/inotify-syscalls.h index a1d5408..7a1627e 100644 --- a/inotify-syscalls.h +++ b/inotify-syscalls.h @@ -4,14 +4,15 @@ * * Licensed under the terms of the GNU General Public License Version 2. * - * Copyright (c) 2006 Tobias Klauser + * Copyright (c) 2006-2007 Tobias Klauser */ #ifndef _LINUX_INOTIFY_SYSCALLS_H #define _LINUX_INOTIFY_SYSCALLS_H #include - +/* glibc already defines them for some architectures */ +#ifndef __NR_inotify_init #if defined(__i386__) # define __NR_inotify_init 291 # define __NR_inotify_add_watch 292 @@ -79,6 +80,7 @@ #else # error "inotify not supported on this architecture!" #endif +#endif /* __NR_inotify_init */ static inline int inotify_init (void) { -- cgit v1.2.3-54-g00ecf