implement fputc_fs and fgetc_fs