cat.c revision 4bc0a2ef2b7ba50a7a717e7ddbf31472ad28e358
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <locale.h>
#include <unistd.h>
#include <widec.h>
#include <wctype.h>
#include <limits.h>
#include <libintl.h>
static long ibsize;
static long obsize;
extern int optind;
int errflg = 0;
int stdinflg = 0;
int status = 0;
int estatus = 0;
#ifdef STANDALONE
#ifndef STANDALONE
silent++;
visi_mode++;
visi_tab++;
visi_newline++;
bflg++;
nflg++;
nflg++;
errflg++;
if (errflg) {
if (!silent)
if (!silent)
argc++;
stdinflg++;
if (stdinflg ||
if (!silent)
if (!silent)
if (!silent)
if (estatus)
if (!silent)
if (!silent)
return (status);
int nitems;
int nwritten;
int offset;
int fi_desc;
long buffsize;
char *bufferp;
if (mapsize != 0) {
int read_error = 0;
mapoffset = 0;
offset = 0;
if (!silent) {
(void) fprintf(
(void) fprintf(
SEEK_SET);
if (filesize == 0)
if (!silent)
SEEK_SET);
if (obsize)
else if (ibsize)
} else if ((bufferp =
offset = 0;
if (nwritten < 0) {
if (!silent) {
nwritten = 0l;
if (nitems < 0) {
int lno;
int len, n;
c = *p1++;
(void) putchar(c);
boln = 0;
if (isascii(c)) {
(void) putchar(c);
if (iscntrl(c)) {
(void) putchar(c);
p1--;
for (n = 0; n < len; n++)
if (isprint(c)) {
(void) putchar(c);
if (iscntrl(c)) {
(void) putchar(c);
p1++;