sca_mk_idx.c

来自「Solaris操作系统下的过滤驱动程序, C源码程序.」· C语言 代码 · 共 75 行

C
75
字号
/* * Copyright (c) 1997-2003 Erez Zadok * Copyright (c) 2001-2003 Stony Brook University * Copyright (c) 1997-2000 Columbia University * * For specific licensing information, see the COPYING file distributed with * this package, or get one from ftp://ftp.filesystems.org/pub/fist/COPYING. * * This Copyright notice must be kept intact and distributed with all * fistgen sources INCLUDING sources generated by fistgen. *//* *  $Id: sca_mk_idx.c,v 1.5 2002/12/27 20:19:06 ezk Exp $ */#include <stdio.h>#include <limits.h>#include <fcntl.h>#include <sys/stat.h>#include <sys/mman.h>#include <string.h>#include <errno.h>#include "sca_aux.h"#include "sca_code.h"extern int chunksize;	/* Must be the same as used to create the			   file (put in header?) */extern int do_fast_tails;voidusage(const char *progname){  fprintf(stderr,	  "Usage: %s [-c chunksize] [-f] file1 [file2 file3 ...]\n",	  progname);}intmain(int argc, char **argv){  int i, rc = 0;  if (argc < 2) {    usage(argv[0]);    exit(1);  }  while((i = getopt(argc, argv, "c:f")) != EOF) {    switch(i) {    case 'c':      chunksize = atoi(optarg);      if (chunksize < 0) {	fprintf(stderr, "Please use a positive chunk size\n");	exit(1);      }      break;    case 'f':      do_fast_tails = 1;      break;    default:      usage(argv[0]);      exit(1);    }  }  for(i=optind; i<argc; i++) {    if ((rc = sca_fix_idx(argv[i]))) {      fprintf(stderr, "Error fixing %s\n", argv[i]);    }  }  exit(0);}

⌨️ 快捷键说明

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