Add missing zstd.h to coregrind Makefile.am noinst_HEADERS
[valgrind.git] / memcheck / tests / amd64-freebsd / posix_fadvise.c
blob2ba2005ae6228cb674d07dfc1937d0f2774a41c7
1 #include <fcntl.h>
2 #include <stdio.h>
3 #include <errno.h>
5 int main(void)
7 int fd = open("foo", O_RDWR|O_CREAT, 0666);
8 if (fd < 0) return 1;
9 posix_fadvise( fd, 0, 4096, POSIX_FADV_WILLNEED );
10 posix_fadvise( fd, 0, 0, POSIX_FADV_NOREUSE );
12 int badfd = 42;
13 posix_fadvise( badfd, 0, 4096, POSIX_FADV_WILLNEED );
15 int x;
16 posix_fadvise(x, 1, 2, POSIX_FADV_NORMAL);
17 posix_fadvise(badfd, x, 2, POSIX_FADV_NORMAL);
18 posix_fadvise(badfd, 1, x, POSIX_FADV_NORMAL);
19 posix_fadvise(badfd, 1, 2, x);
21 x = posix_fadvise(badfd
22 , 1, 2, POSIX_FADV_NORMAL);
24 if (x != EBADF)
25 fprintf(stderr, "Unexpected return value: %d\n", x);