⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fwrite.c

📁 在x86平台上运行不可信任代码的sandbox。
💻 C
字号:
#include <string.h>#include "ioprivate.h"size_t fwrite(const void *restrict buf, size_t eltsize, size_t nelts,		FILE *restrict f){	size_t totsize = eltsize * nelts;	// Check for space in the output buffer.	if (f->opos + totsize > f->omax) {		// Create/flush the output buffer.		if (__getospace(f) < 0)			return EOF;		if (totsize >= f->omax) {			// Bigger than the buffer - just write it directly.			if (__writebuf(f, buf, totsize) < 0)				return 0;			return nelts;		}	}	// Copy the data to the output buffer.	memcpy(&f->obuf[f->opos], buf, totsize);	f->opos += totsize;	// Flush the buffer if appropriate.	if ((f->bufmode == _IOLBF && memchr(buf, '\n', totsize)) ||			(f->bufmode == _IONBF)) {		if (fflush(f) < 0)			return 0;	}	return nelts;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -