diff options
Diffstat (limited to 'contrib/libio/stdio/getw.c')
-rw-r--r-- | contrib/libio/stdio/getw.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/contrib/libio/stdio/getw.c b/contrib/libio/stdio/getw.c new file mode 100644 index 0000000..1dfafbc --- /dev/null +++ b/contrib/libio/stdio/getw.c @@ -0,0 +1,13 @@ +#include "libioP.h" +#include "stdio.h" + +int +getw(fp) + FILE *fp; +{ + int w; + _IO_size_t bytes_read; + CHECK_FILE(fp, EOF); + bytes_read = _IO_sgetn (fp, (char*)&w, sizeof(w)); + return sizeof(w) == bytes_read ? w : EOF; +} |