fanotify.c 842 B

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