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

📄 getospace.c

📁 在x86平台上运行不可信任代码的sandbox。
💻 C
字号:
#include <unistd.h>#include <errno.h>#include "libvxc/private.h"#include "ioprivate.h"static char stdoutbuf[BUFSIZ];static char stderrbuf[BUFSIZ];FILE __stdout = {STDOUT_FILENO, _IOLBF};FILE __stderr = {STDERR_FILENO, _IOLBF};static void flushstdout(){	fflush(stdout);	fflush(stderr);}// Get some output buffer space,// allocating a new output buffer or flushing the existing one if necessary.int __getospace(FILE *f){	if (f->obuf == NULL) {		// No output buffer at all (yet).		// Give stdout and stderr static buffers,		// so that we can get printf without pulling in malloc.		if (f == stdout || f == stderr) {			stdout->obuf = stdoutbuf;			stdout->omax = BUFSIZ;			stderr->obuf = stderrbuf;			stderr->omax = BUFSIZ;			__exit_flush = flushstdout;		} else {			// File must not be open for writing.			errno = EBADF;			f->errflag = 1;			return EOF;		}	} else {		// We have an output buffer but it may be full - flush it.		if (fflush(f) < 0)			return EOF;	}	return 0;}

⌨️ 快捷键说明

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