# 2.11BSD#431 - /usr/src/lib/libc/stdio/fread.c

##### Functions

    fread             X

       1: /*
       2:  * Copyright (c) 1980 Regents of the University of California.
       3:  * All rights reserved.  The Berkeley software License Agreement
       4:  * specifies the terms and conditions for redistribution.
       5:  */
       6:
       7: #if defined(LIBC_SCCS) && !defined(lint)
       8: static char sccsid[] = "@(#)fread.c	5.2 (Berkeley) 3/9/86";
       9: #endif LIBC_SCCS and not lint
      10:
      11: #include    <stdio.h>
      12:
      13: fread(ptr, size, count, iop)
      14:     register char *ptr;
      15:     unsigned size, count;
      16:     register FILE *iop;
      17: {
      18:     register unsigned s;
      19:     int c;
      20:
      21:     s = size * count;
      22:     while (s > 0) {
      23:         if (iop->_cnt < s) {
      24:             if (iop->_cnt > 0) {
      25:                 bcopy(iop->_ptr, ptr, iop->_cnt);
      26:                 ptr += iop->_cnt;
      27:                 s -= iop->_cnt;
      28:             }
      29:             /*
      30: 			 * filbuf clobbers _cnt & _ptr,
      31: 			 * so don't waste time setting them.
      32: 			 */
      33:             if ((c = _filbuf(iop)) == EOF)
      34:                 break;
      35:             *ptr++ = c;
      36:             s--;
      37:         }
      38:         if (iop->_cnt >= s) {
      39:             bcopy(iop->_ptr, ptr, s);
      40:             iop->_ptr += s;
      41:             iop->_cnt -= s;
      42:             return (count);
      43:         }
      44:     }
      45:     return (size != 0 ? count - ((s + size - 1) / size) : 0);
      46: }

#### Defined functions

fread defined in line 13; used 286 times

- in /usr/ingres/source/dbu/copy.c line 792
- in /usr/ingres/source/dbu/ksort.c line 360
- in /usr/ingres/source/dbu/modify.c line 684, 690, 933
- in /usr/ingres/source/support/subs.c line 219
- in /usr/src/bin/adb/sym.c line 176, 193, 214
- in /usr/src/bin/diff/diffreg.c line 204-205(2), 947
- in /usr/src/bin/ld/ld.c line 1553, 1615
- in /usr/src/bin/make/files.c line 471, 508, 538
- in /usr/src/bin/nm/nm.c line 99, 123, 139, 156, 167-172(2), 320, 350
- in /usr/src/bin/od.c line 322, 863
- in /usr/src/bin/pr.c line 335
- in /usr/src/bin/ps.c line 639, 662, 672, 749-753(5), 760
- in /usr/src/bin/size.c line 41, 59
- in /usr/src/bin/tar.c line 1110
- in /usr/src/bin/who.c line 59
- in /usr/src/bin/write.c line 82
- in /usr/src/games/banner.c line 1032
- in /usr/src/games/battlestar/save.c line 29-63(32)
- in /usr/src/games/fortune/fortune.c line 59, 230
- in /usr/src/games/fortune/unstr.c line 50, 113
- in /usr/src/games/monop/cards.c line 28, 43
- in /usr/src/games/phantasia/func0.c line 55
- in /usr/src/games/phantasia/func1.c line 14, 34, 67, 249, 307, 318, 326, 343, 487, 505, 529, 565
- in /usr/src/games/phantasia/func2.c line 60, 98, 145, 183, 225, 245, 367, 464, 517, 816
- in /usr/src/games/phantasia/main.c line 574
- in /usr/src/games/rogue/save.c line 189, 338
- in /usr/src/games/rogue/score.c line 180-184(2)
- in /usr/src/games/sail/lo_main.c line 38, 48
- in /usr/src/games/sail/misc.c line 176
- in /usr/src/games/snake/snscore.c line 42-45(3)
- in /usr/src/games/warp/intrp.c line 432
- in /usr/src/lib/libc/gen/nlist.c line 50, 84, 90
- in /usr/src/lib/libc/net/ruserpass.c line 725
- in /usr/src/lib/mip/fort.c line 51, 67, 86, 97
- in /usr/src/libexec/talkd/process.c line 166
- in /usr/src/local/mkovmake/mkovmake.c line 508, 519, 554, 566, 578
- in /usr/src/local/mtools/file_write.c line 112
- in /usr/src/local/zmodem/sz.c line 1073, 1087, 1138, 1168
- in /usr/src/new/OLD/apl/src/aplcvt.c line 184, 194, 213, 233, 245, 273, 281-286(2), 329, 349, 373, 386, 414-423(3)
- in /usr/src/new/OLD/buildcore.c line 62, 68, 101
- in /usr/src/new/PORT/apl/src/aplcvt.c line 184, 194, 213, 233, 245, 273, 281-286(2), 329, 349, 373, 386, 414-423(3)
- in /usr/src/new/PORT/hexdump/display.c line 230
- in /usr/src/new/bm/GetPatFile.c line 34
- in /usr/src/new/jove/recover.c line 446, 542
- in /usr/src/new/kermit5.188/ckufio.c line 808
- in /usr/src/new/notes/src/access.c line 71
- in /usr/src/new/notes/src/acssort.c line 80
- in /usr/src/new/notes/src/dump.c line 191
- in /usr/src/new/notes/src/perms.c line 94
- in /usr/src/new/notes/src/times.c line 111
- in /usr/src/new/rcs/src/curdir.c line 80-85(2)
- in /usr/src/new/rcs/src/rcsfnms.c line 679-684(2)
- in /usr/src/new/rn/intrp.c line 468
- in /usr/src/old/512dumpdir.c line 419
- in /usr/src/old/dump/dumpdir.c line 331
- in /usr/src/old/dump/dumpitime.c line 177
- in /usr/src/old/dump/dumpoptr.c line 148
- in /usr/src/sbin/dump/dumpdir.c line 181, 358
- in /usr/src/sbin/dump/dumpoptr.c line 152
- in /usr/src/sbin/quotacheck/quotacheck.c line 306
- in /usr/src/sbin/savecore/savecore.c line 193
- in /usr/src/share/zoneinfo/zdump.c line 131, 145
- in /usr/src/sys/conf/netbind.c line 109-113(2), 128-132(2), 173
- in /usr/src/ucb/Mail/send.c line 212, 544
- in /usr/src/ucb/PORT/pascal/pdx/defs.h line 75
- in /usr/src/ucb/PORT/pascal/pdx/library.c line 59
- in /usr/src/ucb/PORT/pascal/pdx/object/readobj.c line 67, 90
- in /usr/src/ucb/PORT/pascal/px/int.c line 104-107(2), 134
- in /usr/src/ucb/PORT/pascal/px/utilities.c line 43
- in /usr/src/ucb/PORT/pascal/src/yyput.c line 158
- in /usr/src/ucb/PORT/pascal/utilities/pc3.c line 141, 192, 212, 220, 231, 772
- in /usr/src/ucb/compress/compress.c line 1130
- in /usr/src/ucb/error/errortouch.c line 561, 621
- in /usr/src/ucb/finger/finger.c line 129, 220
- in /usr/src/ucb/msgs/msgs.c line 733
- in /usr/src/ucb/pascal/pi/yyput.c line 162
- in /usr/src/ucb/strcompact.c line 74
- in /usr/src/ucb/strings.c line 77
- in /usr/src/ucb/symcompact.c line 82, 107, 125, 139, 164
- in /usr/src/ucb/symdump.c line 67, 80-85(2), 105
- in /usr/src/ucb/symorder.c line 71, 96, 114, 174, 200, 213
- in /usr/src/ucb/users.c line 40
- in /usr/src/ucb/w.c line 161, 194
- in /usr/src/usr.bin/diff3/diff3.c line 447
- in /usr/src/usr.bin/lint/lpass2.c line 141, 155
- in /usr/src/usr.bin/prof/prof.c line 200, 214, 224, 244, 266, 311, 336, 397
- in /usr/src/usr.bin/ranlib/build.c line 160
- in /usr/src/usr.bin/refer/deliv1.c line 44
- in /usr/src/usr.bin/refer/glue1.c line 142-143(2), 164-169(2)
- in /usr/src/usr.bin/refer/hunt1.c line 146-151(3), 158
- in /usr/src/usr.bin/refer/hunt7.c line 104
- in /usr/src/usr.bin/refer/inv5.c line 23-33(4)
- in /usr/src/usr.bin/refer/sortbib.c line 153
- in /usr/src/usr.bin/shar/shar.c line 195
- in /usr/src/usr.bin/shar/traverse.c line 29
- in /usr/src/usr.bin/spell/spell.h line 87
- in /usr/src/usr.bin/uucp/uux.c line 195
- in /usr/src/usr.lib/libI77/backspace.c line 53
- in /usr/src/usr.lib/libI77/douio.c line 30, 57
- in /usr/src/usr.lib/libI77/sue.c line 27
- in /usr/src/usr.sbin/ac/ac.c line 74
- in /usr/src/usr.sbin/htable/htable.c line 335
- in /usr/src/usr.sbin/lpr/rmjob.c line 128
- in /usr/src/usr.sbin/repquota/repquota.c line 176
- in /usr/src/usr.sbin/sa/sa.c line 597, 814, 834
- in /usr/src/usr.sbin/syslogd/syslogd.c line 662

#### Defined variables

sccsid defined in line 8; never used

Last modified: 1987-03-15 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 661 |