10Sstevel@tonic-gate /*
20Sstevel@tonic-gate * CDDL HEADER START
30Sstevel@tonic-gate *
40Sstevel@tonic-gate * The contents of this file are subject to the terms of the
5*11050SRobert.Johnston@Sun.COM * Common Development and Distribution License (the "License").
6*11050SRobert.Johnston@Sun.COM * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate *
80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate * See the License for the specific language governing permissions
110Sstevel@tonic-gate * and limitations under the License.
120Sstevel@tonic-gate *
130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate *
190Sstevel@tonic-gate * CDDL HEADER END
200Sstevel@tonic-gate */
210Sstevel@tonic-gate /*
22*11050SRobert.Johnston@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
230Sstevel@tonic-gate * Use is subject to license terms.
240Sstevel@tonic-gate *
250Sstevel@tonic-gate * io.c -- io wrapper functions, replacable in more constrained
260Sstevel@tonic-gate * environments, such as within a DE.
270Sstevel@tonic-gate */
280Sstevel@tonic-gate
290Sstevel@tonic-gate #include <stdio.h>
300Sstevel@tonic-gate #include <stdlib.h>
310Sstevel@tonic-gate
320Sstevel@tonic-gate void
io_abort(const char * buf)330Sstevel@tonic-gate io_abort(const char *buf)
340Sstevel@tonic-gate {
35*11050SRobert.Johnston@Sun.COM (void) fprintf(stderr, "%s\n", buf);
360Sstevel@tonic-gate abort();
370Sstevel@tonic-gate }
380Sstevel@tonic-gate
390Sstevel@tonic-gate void
io_die(const char * buf)400Sstevel@tonic-gate io_die(const char *buf)
410Sstevel@tonic-gate {
42*11050SRobert.Johnston@Sun.COM (void) fprintf(stderr, "%s\n", buf);
430Sstevel@tonic-gate exit(1);
440Sstevel@tonic-gate }
450Sstevel@tonic-gate
460Sstevel@tonic-gate void
io_err(const char * buf)470Sstevel@tonic-gate io_err(const char *buf)
480Sstevel@tonic-gate {
49*11050SRobert.Johnston@Sun.COM (void) fprintf(stderr, "%s\n", buf);
500Sstevel@tonic-gate }
510Sstevel@tonic-gate
520Sstevel@tonic-gate void
io_out(const char * buf)530Sstevel@tonic-gate io_out(const char *buf)
540Sstevel@tonic-gate {
55*11050SRobert.Johnston@Sun.COM (void) printf("%s\n", buf);
560Sstevel@tonic-gate }
570Sstevel@tonic-gate
580Sstevel@tonic-gate void
io_exit(int code)590Sstevel@tonic-gate io_exit(int code)
600Sstevel@tonic-gate {
610Sstevel@tonic-gate exit(code);
620Sstevel@tonic-gate }
63