Fix compilation with missing inotify_init1
PATCH 1/1 Fix compilation with missing inotify_init1
Commit c05c7a7306a23a4b01d1606172b142c45caffc92
breaks cross compilation for mips (and other
compilations without CONFIG_INOTIFY1):
make[1]: Entering directory `/qemu/bin/mips'
CC i386-linux-user/syscall.o
cc1: warnings being treated as errors
/qemu/linux-user/syscall.c: In function ‘do_syscall’:
/qemu/linux-user/syscall.c:7067: error: implicit declaration of function ‘sys_inotify_init1’
--- linux-user/syscall.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
linux-user/syscall.c +2 -0
@@ -7062,11 +7062,13 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, ret =get_errno (sys_inotify_init ());break ;#endif +#ifdef CONFIG_INOTIFY1 #if defined(TARGET_NR_inotify_init1) && defined(__NR_inotify_init1)case TARGET_NR_inotify_init1: ret =get_errno (sys_inotify_init1 (arg1));break ;#endif +#endif #if defined(TARGET_NR_inotify_add_watch) && defined(__NR_inotify_add_watch)case TARGET_NR_inotify_add_watch: p =lock_user_string (arg2);
Signature · 1 line
1.7.0
Quoted 30 lines · Stefan Weil
Commit
c05c7a7306a23a4b01d1606172b142c45caffc92breaks cross compilation for mips (and other compilations withoutCONFIG_INOTIFY1):make[1]: Entering directory `/qemu/bin/mips'
CCi386-linux-user/syscall.o
cc1: warnings being treated as errors /qemu/linux-user/syscall.c: In function ‘do_syscall’:
/qemu/linux-user/syscall.c:7067: error: implicit declaration of function ‘sys_inotify_init1’Cc Riku Voipio <[email protected]>Cc Aurelien Jarno <[email protected]>Signed-off-by Stefan Weil <[email protected]>---
linux-user/syscall.c| 2 ++1 files changed, 2 insertions(+), 0 deletions(-)linux-user/syscall.c +1
-0@@ -7062,11 +7062,13 @@ abi_long do_syscall(void *cpu_env, int num,abi_long arg1, ret =get_errno (sys_inotify_init ());break ;#endif +#ifdef CONFIG_INOTIFY1 #if defined(TARGET_NR_inotify_init1) && defined(__NR_inotify_init1)case
TARGET_NR_inotify_init1:
Quoted 8 lines
ret = get_errno(sys_inotify_init1(arg1)); break;
#endif
+#endif
#ifdefined(TARGET_NR_inotify_add_watch)&&defined(__NR_inotify_add_watch)
caseTARGET_NR_inotify_add_watch:
p =lock_user_string(arg2);
Hi,
to reproduce this error, you can proceed like this:
Debian with
* linux-libc-dev-2.6.32-10 (/usr/include/asm/unistd_32.h defines __NR_inotify_init1)
* libc6-dev-2.7-18lenny2 (/usr/include/sys/inotify.h does not declare inotify_init1)
Run configure --target-list=i386-linux-user && make.
Regards,
Stefan
Aurelien Jarno
AppliedQuoted 10 lines · Stefan Weil
Commit
c05c7a7306a23a4b01d1606172b142c45caffc92
breaks cross compilation for mips (and other
compilations withoutCONFIG_INOTIFY1):make[1]: Entering directory `/qemu/bin/mips'
CCi386-linux-user/syscall.o
cc1: warnings being treated as errors
/qemu/linux-user/syscall.c: In function ‘do_syscall’:
/qemu/linux-user/syscall.c:7067: error: implicit declaration of function ‘sys_inotify_init1’
Quoted 3 lines
Cc Riku Voipio <[email protected]>Cc Aurelien Jarno <[email protected]>Signed-off-by Stefan Weil <[email protected]>
Thanks, applied.
Quoted 28 lines
--- linux-user/syscall.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)linux-user/syscall.c +2
-0@@ -7062,11 +7062,13 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, ret =get_errno (sys_inotify_init ());break ;#endif +#ifdef CONFIG_INOTIFY1 #if defined(TARGET_NR_inotify_init1) && defined(__NR_inotify_init1)case TARGET_NR_inotify_init1: ret =get_errno (sys_inotify_init1 (arg1));break ;#endif +#endif #if defined(TARGET_NR_inotify_add_watch) && defined(__NR_inotify_add_watch)case TARGET_NR_inotify_add_watch: p =lock_user_string (arg2);Signature · 1 line
1.7.0
Signature · 2 lines
Aurelien Jarno GPG: 1024D/F1BCDB73 [email protected] http://www.aurel32.net