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

📄 syncindex.c

📁 这是一个同样来自贝尔实验室的和UNIX有着渊源的操作系统, 其简洁的设计和实现易于我们学习和理解
💻 C
字号:
#include "stdinc.h"#include "dat.h"#include "fns.h"static	int	verbose;voidusage(void){	fprint(2, "usage: syncindex [-fv] [-B blockcachesize] config\n");	exits("usage");}intmain(int argc, char *argv[]){	u32int bcmem;	int fix;	fix = 0;	bcmem = 0;	ARGBEGIN{	case 'B':		bcmem = unittoull(ARGF());		break;	case 'f':		fix++;		break;	case 'v':		verbose++;		break;	default:		usage();		break;	}ARGEND	if(!fix)		readonly = 1;	if(argc != 1)		usage();	vtAttach();	if(!initVenti(argv[0], nil))		fatal("can't init venti: %R");	if(bcmem < maxBlockSize * (mainIndex->narenas + mainIndex->nsects * 4 + 16))		bcmem = maxBlockSize * (mainIndex->narenas + mainIndex->nsects * 4 + 16);	fprint(2, "initialize %d bytes of disk block cache\n", bcmem);	initDCache(bcmem);	if(verbose)		printIndex(2, mainIndex);	if(!syncIndex(mainIndex, fix))		fatal("failed to sync index=%s: %R\n", mainIndex->name);	exits(0);	return 0;	/* shut up stupid compiler */}

⌨️ 快捷键说明

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