1*16563Sralph /* @(#)fprintf.c 4.3 (Berkeley) 06/04/84 */ 22005Swnj #include <stdio.h> 32005Swnj 42005Swnj fprintf(iop, fmt, args) 52005Swnj FILE *iop; 62005Swnj char *fmt; 72005Swnj { 816439Sralph char localbuf[BUFSIZ]; 916439Sralph 1016439Sralph if (iop->_flag & _IONBF) { 1116439Sralph iop->_flag &= ~_IONBF; 1216439Sralph iop->_ptr = iop->_base = localbuf; 1316439Sralph iop->_bufsiz = BUFSIZ; 1416439Sralph _doprnt(fmt, &args, iop); 1516439Sralph fflush(iop); 1616439Sralph iop->_flag |= _IONBF; 1716439Sralph iop->_base = NULL; 1816439Sralph iop->_bufsiz = NULL; 19*16563Sralph iop->_cnt = 0; 2016439Sralph } else 2116439Sralph _doprnt(fmt, &args, iop); 222005Swnj return(ferror(iop)? EOF: 0); 232005Swnj } 24