one too many levels of indirection (from ks@purdue)
[unix-history] / usr / src / lib / libc / stdio / fread.3
CommitLineData
74188ac6
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
0c0fbab6 5.\" @(#)fread.3 6.1 (Berkeley) %G%
74188ac6 6.\"
0c0fbab6 7.TH FREAD 3S ""
74188ac6
KM
8.UC 4
9.SH NAME
10fread, fwrite \- buffered binary input/output
11.SH SYNOPSIS
12.B #include <stdio.h>
13.PP
14.B fread(ptr, sizeof(*ptr), nitems, stream)
15.br
16.SM
17.B FILE
18.B *stream;
19.PP
20.B fwrite(ptr, sizeof(*ptr), nitems, stream)
21.br
22.SM
23.B FILE
24.B *stream;
25.SH DESCRIPTION
26.I Fread
27reads, into a block beginning at
5264ba00 28.IR ptr ,
74188ac6
KM
29.I nitems
30of data of the type of
31.I *ptr
32from the named input
33.IR stream .
34It returns the number of items actually read.
35.PP
36If
37.I stream
38is
39.B stdin
40and the standard output is line buffered, then any partial output line
41will be flushed before any call to
42.IR read (2)
43to satisfy the
5264ba00 44.IR fread .
74188ac6
KM
45.PP
46.I Fwrite
47appends at most
48.I nitems
49of data of the type of
50.I *ptr
51beginning at
52.I ptr
53to the named output
54.IR stream .
55It returns the number of items actually written.
56.SH "SEE ALSO"
5264ba00
KM
57read(2),
58write(2),
59fopen(3S),
60getc(3S),
61putc(3S),
62gets(3S),
63puts(3S),
64printf(3S),
65scanf(3S)
74188ac6
KM
66.SH DIAGNOSTICS
67.I Fread
68and
69.I fwrite
70return
710
72upon end of file or error.