mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-04 02:18:37 +00:00
check_preadv2_pwritev2.c: In function ‘main’:
check_preadv2_pwritev2.c:12:12: error: ‘__NR_preadv2’ undeclared (first use in this function)
syscall(__NR_preadv2, 0, NULL, 0, 0, 0);
^
check_preadv2_pwritev2.c:12:12: note: each undeclared identifier is reported only once for each function it appears in
check_preadv2_pwritev2.c:15:12: error: ‘__NR_pwritev2’ undeclared (first use in this function)
syscall(__NR_pwritev2, 0, NULL, 0, 0, 0);
28 lines
520 B
C
28 lines
520 B
C
#include <sys/syscall.h>
|
|
#include <errno.h>
|
|
#include <unistd.h>
|
|
#include <stddef.h>
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
int has_preadv2 = 0;
|
|
int has_pwritev2 = 0;
|
|
#if defined(__NR_preadv2)
|
|
errno = 0;
|
|
syscall(__NR_preadv2, 0, NULL, 0, 0, 0);
|
|
has_preadv2 = errno != ENOSYS;
|
|
#else
|
|
has_preadv2 = 0;
|
|
#endif
|
|
|
|
#if defined(__NR_pwritev2)
|
|
errno = 0;
|
|
syscall(__NR_pwritev2, 0, NULL, 0, 0, 0);
|
|
has_pwritev2 = errno != ENOSYS;
|
|
#else
|
|
has_pwritev2 = 0;
|
|
#endif
|
|
|
|
return !(has_preadv2 && has_pwritev2);
|
|
}
|