fanotify.c 817 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * fanotify interface for uClibc
  3. *
  4. * Copyright (C) 2015 by Bartosz Golaszewski <bartekgola@gmail.com>
  5. *
  6. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  7. */
  8. #include <sys/syscall.h>
  9. #include <sys/fanotify.h>
  10. #ifdef __NR_fanotify_init
  11. _syscall2(int, fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
  12. #endif
  13. #ifdef __NR_fanotify_mark
  14. # include <bits/wordsize.h>
  15. # include <fcntl.h>
  16. # if __WORDSIZE == 64
  17. _syscall5(int, fanotify_mark, int, fanotify_fd, unsigned int, flags,
  18. uint64_t, mask, int, dirfd, const char *, pathname)
  19. # else
  20. int fanotify_mark(int fanotify_fd, unsigned int flags,
  21. uint64_t mask, int dirfd, const char *pathname)
  22. {
  23. return INLINE_SYSCALL(fanotify_mark, 6, fanotify_fd, flags,
  24. OFF64_HI_LO(mask), dirfd, pathname);
  25. }
  26. # endif
  27. #endif