ref: 16ea0054046e540a90a8a44fd81c0f7b4ae8024d
dir: /lib/c/fwrite.c/
#include <stdio.h> #undef fwrite size_t fwrite(const void * restrict ptr, size_t size, size_t nmemb, FILE * restrict fp) { const unsigned char *bp = ptr; size_t n, i; if (size == 0) return 0; for (n = 0; n < nmemb; n++) { i = size; do putc(*bp++, fp); while (--i); if (ferror(fp)) break; } return n; }