/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
#include "lint.h"
#include "file64.h"
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include "stdiom.h"
static int
_xpg4_check(void)
{
extern int __xpg4;
return (__xpg4);
}
/* fill buffer, return first character or EOF */
int
{
#ifdef _LP64
unsigned int flag;
#else
unsigned char flag;
#endif
{
/* to read - fseek */
else {
return (EOF);
}
}
/* end_of_buffer */
return (EOF);
}
else
/*
* Flush all line-buffered streams before we
* read no-buffered or line-buffered input.
*/
_flushlbf();
/*
* Changed the get family fns in Solaris 10 to comply with the
* 1990 C Standard and standards based upon it. If the
* end-of-file indicator for the stream is set, or if the stream
* is at end-of-file, the function will return EOF, and the file
* position indicator for the stream will not be advanced.
* Additional bytes appended to the file do not clear the EOF
* indicator.
*/
if (_xpg4_check()) {
/*
* A previous read() has returned 0 (below),
* therefore iop->_cnt was set to 0, and the EOF
* indicator was set before returning EOF. Reset
* iop->_cnt to 0; it has likely been changed by
* a function such as getc().
*/
return (EOF);
}
}
/*
* Fill buffer or read 1 byte for unbuffered, handling any errors.
*/
nbyte = 1;
else
}
if (res == 0)
else if (!cancel_active())
return (EOF);
}