* 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
[] = "@(#)fread.c 5.2 (Berkeley) %G%";
#endif LIBC_SCCS and not lint
fread(ptr
, size
, count
, iop
)
bcopy(iop
->_ptr
, ptr
, iop
->_cnt
);
* filbuf clobbers _cnt & _ptr,
* so don't waste time setting them.
if ((c
= _filbuf(iop
)) == EOF
)
bcopy(iop
->_ptr
, ptr
, s
);
return (size
!= 0 ? count
- ((s
+ size
- 1) / size
) : 0);