.\" Copyright (c) 1990 The Regents of the University of California. .\" All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" Chris Torek. .\" .\" %sccs.include.redist.man% .\" .\" @(#)fread.3 6.3 (Berkeley) 01/20/91 .\" .TH FREAD 3 "" .UC 7 .SH NAME fread, fwrite \- stream binary input/output .SH SYNOPSIS .nf .ft B #include int fread(void *ptr, size_t size, size_t count, FILE *stream); int fwrite(void *ptr, size_t size, size_t count, FILE *stream); .ft R .fi .SH DESCRIPTION .I Fread reads .I count items of data, each .I size bytes long, from the given input .IR stream , storing them at the location given by .IR ptr . It returns the actual count of items read (which will be less than .I count in the event of an .B EOF or error). .PP .I Fwrite writes .I count items of data, each .I size bytes long, to the given output .I stream , obtaining them from the location given by .IR ptr . It returns the actual count of items written. .SH "RETURN VALUE" These functions return 0 (or a short count) upon end of file or error. .SH "SEE ALSO" read(2), write(2), fopen(3), getc(3), putc(3), stdio(3)