repo.or.cz
/
minix3.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
. service tells you which device it couldn't stat
[minix3.git]
/
lib
/
other
/
getw.c
blob
324a9f180335caf705f42e44376766533acdb965
1
/*
2
* getw - read a word from a stream
3
*/
4
/* $Header$ */
5
6
#include <stdio.h>
7
8
_PROTOTYPE
(
int
getw
, (
FILE
*
stream
));
9
10
int
getw
(
stream
)
11
register
FILE
*
stream
;
12
{
13
register
int
cnt
=
sizeof
(
int
);
14
int
w
;
15
register
char
*
p
= (
char
*) &
w
;
16
17
while
(
cnt
--) {
18
*
p
++ =
getc
(
stream
);
19
}
20
if
(
feof
(
stream
) ||
ferror
(
stream
))
return
EOF
;
21
return
w
;
22
}