Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 532 - (show annotations) (download)
Sat Sep 1 22:45:15 2007 UTC (16 years, 8 months ago) by niro
File MIME type: text/plain
File size: 370 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd

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 #include <errno.h>
13
14 int fgetc(FILE *f)
15 {
16 unsigned char ch;
17
18 return (_fread(&ch, 1, f) == 1) ? (int)ch : EOF;
19 }