/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2002-2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* "buffered" i/o functions for the standalone environment. (ugh).
*/
#pragma ident "%Z%%M% %I% %E% SMI"
enum {
};
{ F_OPEN, 0, 0, 0, "stdin" },
};
static boolean_t
{
errno = 0;
return (B_FALSE);
}
return (B_TRUE);
}
int
{
return (EOF);
return (0);
}
int
{
return (0);
}
int
{
return (0);
}
void
{
}
int
{
return (EOF);
/* Currently, a nop */
return (0);
}
char *
{
int bytes;
return (NULL);
if (cnt < 0) {
if (bytes != 0) {
s[bytes] = '\0';
return (s);
} else {
return (NULL);
}
} else if (cnt == 0) {
/* EOF */
if (bytes != 0) {
s[bytes] = '\0';
return (s);
} else
return (NULL);
} else {
if (s[bytes] == '\n') {
return (s);
}
}
}
s[bytes] = '\0';
return (s);
}
/*
* We currently only support read-only ("r" mode) opens and unbuffered I/O.
*/
FILE *
{
const char *t;
int fd, i;
errno = 0;
/*
* Make sure we have a filesystem underneath us before even trying.
*/
if (get_default_fs() == NULL)
return (NULL);
switch (*t) {
case 'b':
/* We ignore this a'la ISO C standard conformance */
break;
case 'r':
/* We ignore this because we always open for reading */
break;
case 'a':
case 'w':
case '+':
return (NULL);
default:
return (NULL);
}
}
for (i = 0; i < _NFILE; i++) {
if (fd < 0)
return (NULL);
return (stream);
}
}
return (NULL);
}
/* PRINTFLIKE1 */
void
{
}
/*
* Only writing to stderr or stdout is permitted.
*/
/* PRINTFLIKE2 */
int
{
int nwritten;
return (-1);
/*
* Since fopen() doesn't return writable streams, the only valid
* writable streams are stdout and stderr.
*/
return (-1);
}
return (nwritten);
}
{
return (0);
if (bytes < 0) {
return (0);
} else if (bytes == 0) {
/* EOF */
} else {
}
}
}
/*
* We don't grow files.
*/
int
{
return (-1);
switch (whence) {
case SEEK_SET:
break;
case SEEK_CUR:
break;
case SEEK_END:
break;
default:
return (-1);
}
} else if (new_offset < 0L) {
} else {
errno = 0;
}
if (result >= 0)
else
return (result);
}
long
{
return (0);
}
{
return (0);
/*
* Since fopen() doesn't return writable streams, the only valid
* writable streams are stdout and stderr.
*/
return (0);
}
return (nitems);
}
/*ARGSUSED*/
int
{
return (-1);
/* Currently a nop, probably always will be. */
return (0);
}