1 /* vi: set sw=4 ts=4: */
3 * readahead implementation for busybox
5 * Preloads the given files in RAM, to reduce access time.
6 * Does this by calling the readahead(2) system call.
8 * Copyright (C) 2006 Michael Opdenacker <michael@free-electrons.com>
10 * Licensed under GPLv2 or later, see file License in this tarball for details.
15 int readahead_main(int argc, char **argv);
16 int readahead_main(int argc, char **argv)
19 int retval = EXIT_SUCCESS;
21 if (argc == 1) bb_show_usage();
24 if ((f = fopen_or_warn(*argv, "r")) != NULL) {
27 r = readahead(fd, 0, fdlength(fd));
31 retval = EXIT_FAILURE;