#include #include #include #include int main(void) { char buf[100]; int fd; fd = open("crapfile", O_RDONLY|O_CREAT, 0600); if (fd == -1) err(1, "open"); if (fcntl(fd, F_READAHEAD, 100) == -1) err(1, "fcntl"); if (read(fd, buf, sizeof(buf)) == -1) err(1, "read"); if (fcntl(fd, F_READAHEAD, -1) == -1) err(1, "fcntl"); if (read(fd, buf, sizeof(buf)) == -1) err(1, "read"); if (fcntl(fd, F_READAHEAD, 100) == -1) err(1, "fcntl"); if (read(fd, buf, sizeof(buf)) == -1) err(1, "read"); close(fd); unlink("crapfile"); return (0); }