xref: /netbsd-src/sys/stand/cat.c (revision df7f595ecd6efe54ea7c11083e2dbf711cad4b31)
1*df7f595eScegger /*	$NetBSD: cat.c,v 1.11 2009/03/18 10:22:45 cegger Exp $	*/
21564ce55Sperry 
31564ce55Sperry /*-
41564ce55Sperry  * Copyright (c) 1993
51564ce55Sperry  *	The Regents of the University of California.  All rights reserved.
61564ce55Sperry  *
71564ce55Sperry  * Redistribution and use in source and binary forms, with or without
81564ce55Sperry  * modification, are permitted provided that the following conditions
91564ce55Sperry  * are met:
101564ce55Sperry  * 1. Redistributions of source code must retain the above copyright
111564ce55Sperry  *    notice, this list of conditions and the following disclaimer.
121564ce55Sperry  * 2. Redistributions in binary form must reproduce the above copyright
131564ce55Sperry  *    notice, this list of conditions and the following disclaimer in the
141564ce55Sperry  *    documentation and/or other materials provided with the distribution.
15aad01611Sagc  * 3. Neither the name of the University nor the names of its contributors
161564ce55Sperry  *    may be used to endorse or promote products derived from this software
171564ce55Sperry  *    without specific prior written permission.
181564ce55Sperry  *
191564ce55Sperry  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
201564ce55Sperry  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
211564ce55Sperry  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
221564ce55Sperry  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
231564ce55Sperry  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
241564ce55Sperry  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
251564ce55Sperry  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
261564ce55Sperry  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
271564ce55Sperry  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
281564ce55Sperry  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
291564ce55Sperry  * SUCH DAMAGE.
301564ce55Sperry  */
311564ce55Sperry 
321564ce55Sperry #include <sys/cdefs.h>
331564ce55Sperry #ifndef lint
341564ce55Sperry __COPYRIGHT("@(#) Copyright (c) 1993\n\
351564ce55Sperry 	The Regents of the University of California.  All rights reserved.\n");
361564ce55Sperry #endif /* not lint */
371564ce55Sperry 
381564ce55Sperry #ifndef lint
391564ce55Sperry #if 0
401564ce55Sperry static char sccsid[] = "@(#)cat.c	8.1 (Berkeley) 6/11/93";
411564ce55Sperry #else
42*df7f595eScegger __RCSID("$NetBSD: cat.c,v 1.11 2009/03/18 10:22:45 cegger Exp $");
431564ce55Sperry #endif
441564ce55Sperry #endif /* not lint */
451564ce55Sperry 
main(void)46*df7f595eScegger main(void)
471564ce55Sperry {
481564ce55Sperry 	register int fd;
491564ce55Sperry 	char c;
501564ce55Sperry 
511564ce55Sperry 	fd = getfile("File", 0);
521564ce55Sperry 	while (read(fd, &c, 1) == 1)
531564ce55Sperry 		putchar(c);
541564ce55Sperry 	exit(0);
551564ce55Sperry }
56