Add missing prototype for readahead in <fcntl.h>.
Change-Id: Icfe85e9cf95c657b495c4e9cd10dec50b0b8f6db
diff --git a/libc/include/fcntl.h b/libc/include/fcntl.h
index 6e2ad51..74ea523 100644
--- a/libc/include/fcntl.h
+++ b/libc/include/fcntl.h
@@ -86,6 +86,10 @@
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 3fd0a8c..212cce6 100644
--- a/tests/fcntl_test.cpp
+++ b/tests/fcntl_test.cpp
@@ -237,3 +237,10 @@
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);
+}