strace/tests/fanotify_mark.c
Dmitry V. Levin 1ea64735fc Fix fanotify_mark decoding on 32-bit architectures
The fanotify_mark syscall takes a 64-bit mask, and on 32-bit
architectures it is split up into two syscall arguments.

* configure.ac (AC_CHECK_FUNCS): Add fanotify_mark.
(AC_CHECK_HEADERS): Add sys/fanotify.h.
* defs.h (getllval): New prototype.
* util.c (getllval): New function based on printllval.
(printllval): Use getllval.
* fanotify.c (sys_fanotify_mark): Use getllval to properly decode
64-bit mask and two syscall arguments followed by it.
* tests/fanotify_mark.c: New file.
* tests/fanotify_mark.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add fanotify_mark.
(TESTS): Add fanotify_mark.test.
* tests/.gitignore: Add fanotify_mark.
2015-01-10 00:40:10 +00:00

20 lines
282 B
C

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#if defined HAVE_SYS_FANOTIFY_H && defined HAVE_FANOTIFY_MARK
# include <sys/fanotify.h>
int
main(void)
{
fanotify_mark(-1, FAN_MARK_ADD, FAN_MODIFY | FAN_ONDIR, -100, ".");
return 0;
}
#else
int
main(void)
{
return 77;
}
#endif