/* Copyright (c) 1979 Regents of the University of California */
register struct _iobuf
*iop
;
static char smallbuf
[_NFILE
];
if ((iop
->_flag
&_IOREAD
) == 0)
_error("Reading bad file\n");
iop
->_base
= &smallbuf
[fileno(iop
)];
if ((iop
->_base
= malloc(BUFSIZ
)) == NULL
) {
if((iop
->_flag
& _IODIRT
) && !(iop
->_flag
& _IONBF
) && (iop
->_flag
& _IOWRT
)) {
if (lseek(iop
->_file
,(long) -iop
->_delta
, 1) < 0) {
_error("Seek error in filbuf\n");
if( 0 < (n
= iop
->_ptr
- iop
->_base
))
if( n
!= write(iop
->_file
, iop
->_base
, n
) )
iop
->_cnt
= read(fileno(iop
), iop
->_ptr
, iop
->_flag
&_IONBF
?1:BUFSIZ
);
return(*iop
->_ptr
++&0377);