use a larger buffer on larger machines

This commit is contained in:
ceriel
1989-02-21 10:01:55 +00:00
parent 30959cd73f
commit d5b2601b8f
7 changed files with 43 additions and 33 deletions

View File

@@ -17,13 +17,21 @@ register FILE *iop;
return (EOF);
if (! io_testflag(iop, IO_UNBUFF) && ! iop->_buf) {
iop->_buf = (unsigned char *) malloc(BUFSIZ);
if (! iop->_buf) iop->_flags |= IO_UNBUFF;
else iop->_flags |= IO_MYBUF;
iop->_buf = (unsigned char *) malloc(_BUFSIZ);
if (! iop->_buf) {
iop->_flags |= IO_UNBUFF;
}
else {
iop->_flags |= IO_MYBUF;
iop->_bufsiz = _BUFSIZ;
}
}
if (! iop->_buf) {
iop->_buf = &ch[fileno(iop)];
iop->_bufsiz = 1;
}
if (! iop->_buf) iop->_buf = &ch[fileno(iop)];
iop->_ptr = iop->_buf;
iop->_count = read(iop->_fd, iop->_buf, io_testflag(iop, IO_UNBUFF)? 1 : BUFSIZ);
iop->_count = read(iop->_fd, iop->_buf, iop->_bufsiz);
if (iop->_count <= 0){
if (iop->_count == 0) {