1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include "libioP.h" #include "stdio.h" #undef putw int putw(w, fp) int w; FILE *fp; { _IO_size_t written; CHECK_FILE(fp, EOF); written = _IO_sputn(fp, (const char *)&w, sizeof(w)); return written == sizeof(w) ? 0 : EOF; }