. service tells you which device it couldn't stat
[minix3.git] / lib / other / getw.c
blob324a9f180335caf705f42e44376766533acdb965
1 /*
2 * getw - read a word from a stream
3 */
4 /* $Header$ */
6 #include <stdio.h>
8 _PROTOTYPE(int getw, (FILE *stream ));
10 int getw(stream)
11 register FILE *stream;
13 register int cnt = sizeof(int);
14 int w;
15 register char *p = (char *) &w;
17 while (cnt--) {
18 *p++ = getc(stream);
20 if (feof(stream) || ferror(stream)) return EOF;
21 return w;