xref: /csrg-svn/lib/libc/stdio/getw.c (revision 61180)
146093Sbostic /*-
2*61180Sbostic  * Copyright (c) 1990, 1993
3*61180Sbostic  *	The Regents of the University of California.  All rights reserved.
446093Sbostic  *
546093Sbostic  * This code is derived from software contributed to Berkeley by
646093Sbostic  * Chris Torek.
746093Sbostic  *
846093Sbostic  * %sccs.include.redist.c%
946093Sbostic  */
1046093Sbostic 
1126657Sdonn #if defined(LIBC_SCCS) && !defined(lint)
12*61180Sbostic static char sccsid[] = "@(#)getw.c	8.1 (Berkeley) 06/04/93";
1346093Sbostic #endif /* LIBC_SCCS and not lint */
1422138Smckusick 
152023Swnj #include <stdio.h>
162023Swnj 
getw(fp)1746093Sbostic getw(fp)
1846093Sbostic 	FILE *fp;
192023Swnj {
2046093Sbostic 	int x;
212023Swnj 
2246093Sbostic 	return (fread((void *)&x, sizeof(x), 1, fp) == 1 ? x : EOF);
232023Swnj }
24