Commit 39b59763560dc48f225814c41c3b211119d11ace
1 parent
04bb9ace
Add inotify syscall family
Signed-off-by: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5388 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
29 additions
and
0 deletions
linux-user/syscall.c
... | ... | @@ -177,6 +177,9 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, \ |
177 | 177 | #define __NR_sys_unlinkat __NR_unlinkat |
178 | 178 | #define __NR_sys_utimensat __NR_utimensat |
179 | 179 | #define __NR_sys_futex __NR_futex |
180 | +#define __NR_sys_inotify_init __NR_inotify_init | |
181 | +#define __NR_sys_inotify_add_watch __NR_inotify_add_watch | |
182 | +#define __NR_sys_inotify_rm_watch __NR_inotify_rm_watch | |
180 | 183 | |
181 | 184 | #if defined(__alpha__) || defined (__ia64__) || defined(__x86_64__) |
182 | 185 | #define __NR__llseek __NR_lseek |
... | ... | @@ -270,6 +273,15 @@ _syscall3(int,sys_unlinkat,int,dirfd,const char *,pathname,int,flags) |
270 | 273 | _syscall4(int,sys_utimensat,int,dirfd,const char *,pathname, |
271 | 274 | const struct timespec *,tsp,int,flags) |
272 | 275 | #endif |
276 | +#if defined(TARGET_NR_inotify_init) && defined(__NR_inotify_init) | |
277 | +_syscall0(int,sys_inotify_init) | |
278 | +#endif | |
279 | +#if defined(TARGET_NR_inotify_add_watch) && defined(__NR_inotify_add_watch) | |
280 | +_syscall3(int,sys_inotify_add_watch,int,fd,const char *,pathname,uint32_t,mask) | |
281 | +#endif | |
282 | +#if defined(TARGET_NR_inotify_rm_watch) && defined(__NR_inotify_rm_watch) | |
283 | +_syscall2(int,sys_inotify_rm_watch,int,fd,uint32_t,wd) | |
284 | +#endif | |
273 | 285 | #if defined(USE_NPTL) |
274 | 286 | #if defined(TARGET_NR_futex) && defined(__NR_futex) |
275 | 287 | _syscall6(int,sys_futex,int *,uaddr,int,op,int,val, |
... | ... | @@ -5874,6 +5886,23 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, |
5874 | 5886 | ret = do_futex(arg1, arg2, arg3, arg4, arg5, arg6); |
5875 | 5887 | break; |
5876 | 5888 | #endif |
5889 | +#ifdef TARGET_NR_inotify_init | |
5890 | + case TARGET_NR_inotify_init: | |
5891 | + ret = get_errno(sys_inotify_init()); | |
5892 | + break; | |
5893 | +#endif | |
5894 | +#ifdef TARGET_NR_inotify_add_watch | |
5895 | + case TARGET_NR_inotify_add_watch: | |
5896 | + p = lock_user_string(arg2); | |
5897 | + ret = get_errno(sys_inotify_add_watch(arg1, path(p), arg3)); | |
5898 | + unlock_user(p, arg2, 0); | |
5899 | + break; | |
5900 | +#endif | |
5901 | +#ifdef TARGET_NR_inotify_rm_watch | |
5902 | + case TARGET_NR_inotify_rm_watch: | |
5903 | + ret = get_errno(sys_inotify_rm_watch(arg1, arg2)); | |
5904 | + break; | |
5905 | +#endif | |
5877 | 5906 | |
5878 | 5907 | default: |
5879 | 5908 | unimplemented: | ... | ... |