uClibc-0.9.31.1-add-inotify-init1.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. From a2e5630af426f85fdd8721b2820786d9bd2aa695 Mon Sep 17 00:00:00 2001
  2. From: Vladimir Zapolskiy <vzapolskiy@gmail.com>
  3. Date: Tue, 1 Jun 2010 20:02:54 +0400
  4. Subject: [PATCH] inotify: add inotify_init1 system call support
  5. This patch introduces support for inotify_init1 system call, found
  6. since Linux 2.6.27.
  7. Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
  8. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  9. ---
  10. libc/sysdeps/linux/common/inotify.c | 4 ++++
  11. libc/sysdeps/linux/common/sys/inotify.h | 13 +++++++++++++
  12. 2 files changed, 17 insertions(+), 0 deletions(-)
  13. diff --git a/libc/sysdeps/linux/common/inotify.c b/libc/sysdeps/linux/common/inotify.c
  14. index e5a6120..e35f043 100644
  15. --- a/libc/sysdeps/linux/common/inotify.c
  16. +++ b/libc/sysdeps/linux/common/inotify.c
  17. @@ -15,6 +15,10 @@
  18. _syscall0(int, inotify_init)
  19. #endif
  20. +#ifdef __NR_inotify_init1
  21. +_syscall1(int, inotify_init1, int, flags)
  22. +#endif
  23. +
  24. #ifdef __NR_inotify_add_watch
  25. _syscall3(int, inotify_add_watch, int, fd, const char *, path, uint32_t, mask)
  26. #endif
  27. diff --git a/libc/sysdeps/linux/common/sys/inotify.h b/libc/sysdeps/linux/common/sys/inotify.h
  28. index 0131db9..dc4e19d 100644
  29. --- a/libc/sysdeps/linux/common/sys/inotify.h
  30. +++ b/libc/sysdeps/linux/common/sys/inotify.h
  31. @@ -22,6 +22,16 @@
  32. #include <stdint.h>
  33. +/* Flags for the parameter of inotify_init1. */
  34. +enum
  35. + {
  36. + IN_CLOEXEC = 02000000,
  37. +#define IN_CLOEXEC IN_CLOEXEC
  38. + IN_NONBLOCK = 04000
  39. +#define IN_NONBLOCK IN_NONBLOCK
  40. + };
  41. +
  42. +
  43. /* Structure describing an inotify event. */
  44. struct inotify_event
  45. {
  46. @@ -79,6 +89,9 @@ __BEGIN_DECLS
  47. /* Create and initialize inotify instance. */
  48. extern int inotify_init (void) __THROW;
  49. +/* Create and initialize inotify instance. */
  50. +extern int inotify_init1 (int __flags) __THROW;
  51. +
  52. /* Add watch of object NAME to inotify instance FD. Notify about
  53. events specified by MASK. */
  54. extern int inotify_add_watch (int __fd, const char *__name, uint32_t __mask)
  55. --
  56. 1.7.3.4