* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid
[] = "@(#)filbuf.c 5.3 (Berkeley) %G%";
#endif LIBC_SCCS and not lint
if ((iop
->_flag
&_IOREAD
) == 0)
if (iop
->_flag
&(_IOSTRG
|_IOEOF
))
iop
->_base
= _smallbuf
? &_smallbuf
[fileno(iop
)] : &c
;
if (fstat(fileno(iop
), &stbuf
) < 0 || stbuf
.st_blksize
<= NULL
)
if ((iop
->_base
= malloc(size
)) == NULL
) {
if (stdout
->_flag
&_IOLBF
)
if (stderr
->_flag
&_IOLBF
)
iop
->_cnt
= read(fileno(iop
), iop
->_base
,
iop
->_flag
& _IONBF
? 1 : iop
->_bufsiz
);
if (iop
->_flag
& _IONBF
&& iop
->_base
== &c
)
return(*iop
->_ptr
++&0377);