mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-12 06:11:37 +00:00
Add regression tests for fadvise64. Change by A Rikalo. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16175
22 lines
464 B
C
22 lines
464 B
C
#include <errno.h>
|
|
#include <fcntl.h>
|
|
#include <stdio.h>
|
|
|
|
#define BAD_FD 42
|
|
|
|
int main() {
|
|
int x;
|
|
|
|
(void)posix_fadvise(x, 1, 2, POSIX_FADV_NORMAL);
|
|
(void)posix_fadvise(BAD_FD, x, 2, POSIX_FADV_NORMAL);
|
|
(void)posix_fadvise(BAD_FD, 1, x, POSIX_FADV_NORMAL);
|
|
(void)posix_fadvise(BAD_FD, 1, 2, x);
|
|
|
|
x = posix_fadvise(BAD_FD, 1, 2, POSIX_FADV_NORMAL);
|
|
|
|
if (x != EBADF)
|
|
fprintf(stderr, "Unexpected return value: %d\n", x);
|
|
|
|
return 0;
|
|
}
|