提交 c05c7a73 编写于 作者: R Riku Voipio 提交者: Aurelien Jarno

linux-user: add inotify_init1 syscall support

New syscall which gets actively used when you have a
fresh kernel.
Signed-off-by: NRiku Voipio <riku.voipio@nokia.com>
Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
上级 bedd2912
...@@ -1629,6 +1629,21 @@ if compile_prog "" "" ; then ...@@ -1629,6 +1629,21 @@ if compile_prog "" "" ; then
inotify=yes inotify=yes
fi fi
inotify1=no
cat > $TMPC << EOF
#include <sys/inotify.h>
int
main(void)
{
/* try to start inotify */
return inotify_init1(0);
}
EOF
if compile_prog "" "" ; then
inotify1=yes
fi
# check if utimensat and futimens are supported # check if utimensat and futimens are supported
utimens=no utimens=no
cat > $TMPC << EOF cat > $TMPC << EOF
...@@ -2136,6 +2151,9 @@ fi ...@@ -2136,6 +2151,9 @@ fi
if test "$inotify" = "yes" ; then if test "$inotify" = "yes" ; then
echo "CONFIG_INOTIFY=y" >> $config_host_mak echo "CONFIG_INOTIFY=y" >> $config_host_mak
fi fi
if test "$inotify1" = "yes" ; then
echo "CONFIG_INOTIFY1=y" >> $config_host_mak
fi
if test "$byteswap_h" = "yes" ; then if test "$byteswap_h" = "yes" ; then
echo "CONFIG_BYTESWAP_H=y" >> $config_host_mak echo "CONFIG_BYTESWAP_H=y" >> $config_host_mak
fi fi
......
...@@ -506,9 +506,18 @@ static int sys_inotify_rm_watch(int fd, int32_t wd) ...@@ -506,9 +506,18 @@ static int sys_inotify_rm_watch(int fd, int32_t wd)
return (inotify_rm_watch(fd, wd)); return (inotify_rm_watch(fd, wd));
} }
#endif #endif
#ifdef CONFIG_INOTIFY1
#if defined(TARGET_NR_inotify_init1) && defined(__NR_inotify_init1)
static int sys_inotify_init1(int flags)
{
return (inotify_init1(flags));
}
#endif
#endif
#else #else
/* Userspace can usually survive runtime without inotify */ /* Userspace can usually survive runtime without inotify */
#undef TARGET_NR_inotify_init #undef TARGET_NR_inotify_init
#undef TARGET_NR_inotify_init1
#undef TARGET_NR_inotify_add_watch #undef TARGET_NR_inotify_add_watch
#undef TARGET_NR_inotify_rm_watch #undef TARGET_NR_inotify_rm_watch
#endif /* CONFIG_INOTIFY */ #endif /* CONFIG_INOTIFY */
...@@ -7055,6 +7064,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, ...@@ -7055,6 +7064,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
ret = get_errno(sys_inotify_init()); ret = get_errno(sys_inotify_init());
break; break;
#endif #endif
#if defined(TARGET_NR_inotify_init1) && defined(__NR_inotify_init1)
case TARGET_NR_inotify_init1:
ret = get_errno(sys_inotify_init1(arg1));
break;
#endif
#if defined(TARGET_NR_inotify_add_watch) && defined(__NR_inotify_add_watch) #if defined(TARGET_NR_inotify_add_watch) && defined(__NR_inotify_add_watch)
case TARGET_NR_inotify_add_watch: case TARGET_NR_inotify_add_watch:
p = lock_user_string(arg2); p = lock_user_string(arg2);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册