From 90f770523f54b2e63a6ad46cba0149c9dc01ddd4 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 8 Sep 2012 00:40:37 -0400 Subject: [PATCH] add linux readahead syscall --- include/fcntl.h | 1 + src/linux/readahead.c | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 src/linux/readahead.c diff --git a/include/fcntl.h b/include/fcntl.h index 68baf7a2..b8d8702e 100644 --- a/include/fcntl.h +++ b/include/fcntl.h @@ -123,6 +123,7 @@ struct f_owner_ex { #define SPLICE_F_MORE 4 #define SPLICE_F_GIFT 8 int fallocate(int, int, off_t, off_t); +ssize_t readahead(int, off_t, size_t); ssize_t vmsplice(int, const struct iovec *, size_t, unsigned); ssize_t splice(int, off_t *, int, off_t *, size_t, unsigned); #define loff_t off_t diff --git a/src/linux/readahead.c b/src/linux/readahead.c new file mode 100644 index 00000000..5c70bfd6 --- /dev/null +++ b/src/linux/readahead.c @@ -0,0 +1,8 @@ +#define _GNU_SOURCE +#include +#include "syscall.h" + +ssize_t readahead(int fd, off_t pos, size_t len) +{ + return syscall(SYS_readahead, fd, __SYSCALL_LL_O(pos), len); +} -- 2.20.1