1 /* vi: set sw=4 ts=4: */
3 * cat implementation for busybox
5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
7 * Licensed under GPLv2, see file License in this tarball for details.
10 /* BB_AUDIT SUSv3 compliant */
11 /* http://www.opengroup.org/onlinepubs/007904975/utilities/cat.html */
15 /* This is a NOFORK applet. Be very careful! */
18 int bb_cat(char **argv)
21 int retval = EXIT_SUCCESS;
24 argv = (char**) &bb_argv_dash;
27 fd = open_or_warn_stdin(*argv);
29 /* This is not a xfunc - never exits */
30 off_t r = bb_copyfd_eof(fd, STDOUT_FILENO);
31 if (fd != STDIN_FILENO)
36 retval = EXIT_FAILURE;
42 int cat_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
43 int cat_main(int argc UNUSED_PARAM, char **argv)