xref: /csrg-svn/lib/libc/stdio/getw.c (revision 46093)
1*46093Sbostic /*-
2*46093Sbostic  * Copyright (c) 1990 The Regents of the University of California.
3*46093Sbostic  * All rights reserved.
4*46093Sbostic  *
5*46093Sbostic  * This code is derived from software contributed to Berkeley by
6*46093Sbostic  * Chris Torek.
7*46093Sbostic  *
8*46093Sbostic  * %sccs.include.redist.c%
9*46093Sbostic  */
10*46093Sbostic 
1126657Sdonn #if defined(LIBC_SCCS) && !defined(lint)
12*46093Sbostic static char sccsid[] = "@(#)getw.c	5.3 (Berkeley) 01/20/91";
13*46093Sbostic #endif /* LIBC_SCCS and not lint */
1422138Smckusick 
152023Swnj #include <stdio.h>
162023Swnj 
17*46093Sbostic getw(fp)
18*46093Sbostic 	FILE *fp;
192023Swnj {
20*46093Sbostic 	int x;
212023Swnj 
22*46093Sbostic 	return (fread((void *)&x, sizeof(x), 1, fp) == 1 ? x : EOF);
232023Swnj }
24