Magellan Linux

Contents of /trunk/mkinitrd-magellan/klibc/usr/klibc/fgetc.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1297 - (show annotations) (download)
Fri May 27 15:12:11 2011 UTC (12 years, 11 months ago) by niro
File MIME type: text/plain
File size: 351 byte(s)
-updated to klibc-1.5.22 with mntproc definitions patch included
1 /*
2 * fgetc.c
3 *
4 * Extremely slow fgetc implementation, using _fread(). If people
5 * actually need character-oriented input to be fast, we may actually
6 * have to implement buffering. Sigh.
7 */
8
9 #include <stdio.h>
10 #include <unistd.h>
11 #include <stdlib.h>
12
13 int fgetc(FILE *f)
14 {
15 unsigned char ch;
16
17 return (_fread(&ch, 1, f) == 1) ? (int)ch : EOF;
18 }