From 55147ada3c93bda85b2d35f72ba4fde1a7745ff6 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 5 Apr 2016 11:06:02 -0700 Subject: [PATCH] Add missing prototype for readahead in . Change-Id: Icfe85e9cf95c657b495c4e9cd10dec50b0b8f6db --- libc/include/fcntl.h | 4 ++++ tests/fcntl_test.cpp | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/libc/include/fcntl.h b/libc/include/fcntl.h index 6e2ad5165..74ea52355 100644 --- a/libc/include/fcntl.h +++ b/libc/include/fcntl.h @@ -86,6 +86,10 @@ extern int fallocate64(int, int, off64_t, off64_t); extern int posix_fadvise64(int, off64_t, off64_t, int); extern int posix_fallocate64(int, off64_t, off64_t); +#if defined(__USE_GNU) +ssize_t readahead(int, off64_t, size_t); +#endif + extern int __open_2(const char*, int); extern int __open_real(const char*, int, ...) __RENAME(open); extern int __openat_2(int, const char*, int); diff --git a/tests/fcntl_test.cpp b/tests/fcntl_test.cpp index 3fd0a8cfb..212cce6da 100644 --- a/tests/fcntl_test.cpp +++ b/tests/fcntl_test.cpp @@ -237,3 +237,10 @@ TEST(fcntl, tee) { ASSERT_STREQ(expected, buf1); ASSERT_STREQ(expected, buf2); } + +TEST(fcntl, readahead) { + // Just check that the function is available. + errno = 0; + ASSERT_EQ(-1, readahead(-1, 0, 123)); + ASSERT_EQ(EBADF, errno); +}