亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? partition.c

?? minix軟件源代碼
?? C
字號:
/*	partition 1.10 - Make a partition table		Author: Kees J. Bot *								27 Apr 1992 */#define nil 0#include <stdio.h>#include <sys/types.h>#include <stdlib.h>#include <unistd.h>#include <fcntl.h>#include <minix/config.h>#include <minix/const.h>#include <minix/partition.h>#include <ibm/partition.h>#include <sys/stat.h>#include <string.h>#include <errno.h>#include <sys/ioctl.h>#include <limits.h>#if !__minix_vmd#define div64u(i, j)	((i) / (j))#endif#define SECTOR_SIZE	512#define arraysize(a)	(sizeof(a)/sizeof((a)[0]))#define arraylimit(a)	((a) + arraysize(a))char *arg0;void report(const char *label){	fprintf(stderr, "%s: %s: %s\n", arg0, label, strerror(errno));}void fatal(const char *label){	report(label);	exit(1);}#ifndef makedev#define minor(dev)	(((dev) >> MINOR) & BYTE)#define major(dev)	(((dev) >> MAJOR) & BYTE)#define makedev(major, minor)	\			((dev_t) (((major) << MAJOR) | ((minor) << MINOR)))#endifint aflag;			/* Add a new partition to the current table. */int mflag;			/* Minix rules, no need for alignment. */int rflag;			/* Report current partitions. */int fflag;			/* Force making a table even if too small. */int cylinders, heads, sectors;	/* Device's geometry */int pad;			/* Partitions must be padded. *//* Descriptions of the device to divide and the partitions to make, including * gaps between partitions. */struct part_entry primary, table[2 * NR_PARTITIONS + 1];int npart;/* Extra flag at construction time. */#define EXPAND_FLAG	0x01	/* Add the remaining sectors to this one */#define MINOR_hd1a	128void sec2dos(unsigned long sec, unsigned char *dos)/* Translate a sector number into the three bytes DOS uses. */{	unsigned secspcyl= heads * sectors;	unsigned cyl;	cyl= sec / secspcyl;	dos[2]= cyl;	dos[1]= ((sec % sectors) + 1) | ((cyl >> 2) & 0xC0);	dos[0]= (sec % secspcyl) / sectors;}void show_chs(unsigned long pos){	int cyl, head, sec;	if (pos == -1) {		cyl= head= 0;		sec= -1;	} else {		cyl= pos / (heads * sectors);		head= (pos / sectors) - (cyl * heads);		sec= pos % sectors;	}	printf("  %4d/%02d/%02d", cyl, head, sec);}void show_part(struct part_entry *p){	static int banner= 0;	int n;	n= p - table;	if ((n % 2) == 0) return;	if (!banner) {		printf(		"Part     First        Last        Base      Size       Kb\n");		banner= 1;	}	printf("%3d ", (n-1) / 2);	show_chs(p->lowsec);	show_chs(p->lowsec + p->size - 1);	printf("  %8lu  %8lu  %7lu\n", p->lowsec, p->size, p->size / 2);}void usage(void){	fprintf(stderr,		"Usage: partition [-mf] device [type:]length[+*] ...\n");	exit(1);}#define between(a, c, z)	((unsigned) ((c) - (a)) <= ((z) - (a)))void parse(char *descr){	int seen= 0, sysind, flags, c;	unsigned long size;	if (strchr(descr, ':') == nil) {		/* A hole. */		if ((npart % 2) != 0) {			fprintf(stderr, "%s: Two holes can't be adjacent.\n",				arg0);			exit(1);		}		sysind= NO_PART;		seen|= 1;	} else {		/* A partition. */		if ((npart % 2) == 0) {			/* Need a hole before this partition. */			if (npart == 0) {				/* First hole contains the partition table. */				table[0].size= 1;			}			npart++;		}		sysind= 0;		for (;;) {			c= *descr++;			if (between('0', c, '9'))				c= (c - '0') + 0x0;			else			if (between('a', c, 'z'))				c= (c - 'a') + 0xa;			else			if (between('A', c, 'Z'))				c= (c - 'A') + 0xA;			else				break;			sysind= 0x10 * sysind + c;			seen|= 1;		}		if (c != ':') usage();	}	size= 0;	while (between('0', (c= *descr++), '9')) {		size= 10 * size + (c - '0');		seen|= 2;	}	flags= 0;	for (;;) {		if (c == '*')			flags|= ACTIVE_FLAG;		else		if (c == '+')			flags|= EXPAND_FLAG;		else			break;		c= *descr++;	}	if (seen != 3 || c != 0) usage();	if (npart == arraysize(table)) {		fprintf(stderr, "%s: too many partitions, only %d possible.\n",			arg0, NR_PARTITIONS);		exit(1);	}	table[npart].bootind= flags;	table[npart].sysind= sysind;	table[npart].size= size;	npart++;}void geometry(char *device)/* Get the geometry of the drive the device lives on, and the base and size * of the device. */{	int fd;	struct partition geometry;	if ((fd= open(device, O_RDONLY)) < 0) fatal(device);	/* Get the geometry of the drive, and the device's base and size. */	if (ioctl(fd, DIOCGETP, &geometry) < 0) fatal(device);	close(fd);	primary.lowsec= div64u(geometry.base, SECTOR_SIZE);	primary.size= div64u(geometry.size, SECTOR_SIZE);	cylinders= geometry.cylinders;	heads= geometry.heads;	sectors= geometry.sectors;	/* Is this a primary partition table?  If so then pad partitions. */	pad= (!mflag && primary.lowsec == 0);}void boundary(struct part_entry *pe, int exp)/* Expand or reduce a primary partition to a track or cylinder boundary to * avoid giving the fdisk's of simpler operating systems a fit. */{	unsigned n;	n= !pad ? 1 : pe == &table[0] ? sectors : heads * sectors;	if (exp) pe->size+= n - 1;	pe->size= ((pe->lowsec + pe->size) / n * n) - pe->lowsec;}void distribute(char *device)/* Fit the partitions onto the device.  Try to start and end them on a * cylinder boundary if so required.  The first partition is to start on * track 1, not on cylinder 1. */{	struct part_entry *pe, *exp;	long count;	unsigned long base, size;	do {		exp= nil;		base= primary.lowsec;		count= primary.size;		for (pe= table; pe < arraylimit(table); pe++) {			pe->lowsec= base;			boundary(pe, 1);			base+= pe->size;			count-= pe->size;			if (pe->bootind & EXPAND_FLAG) exp= pe;		}		if (count < 0) {			if (fflag) break;			fprintf(stderr, "%s: %s is %ld sectors too small\n",				arg0, device, -count);			exit(1);		}		if (exp != nil) {			/* Add leftover space to the partition marked for			 * expanding.			 */			exp->size+= count;			boundary(exp, 0);			exp->bootind&= ~EXPAND_FLAG;		}	} while (exp != nil);	for (pe= table; pe < arraylimit(table); pe++) {		if (pe->sysind == NO_PART) {			memset(pe, 0, sizeof(*pe));		} else {			sec2dos(pe->lowsec, &pe->start_head);			sec2dos(pe->lowsec + pe->size - 1, &pe->last_head);			pe->bootind&= ACTIVE_FLAG;		}		show_part(pe);	}}void write_table(char *device){	int f;	short signature= 0xAA55;	struct part_entry newtable[NR_PARTITIONS];	int i;	for (i= 0; i < NR_PARTITIONS; i++) newtable[i]= table[1 + 2*i];	if ((f= open(device, O_WRONLY)) < 0		|| lseek(f, (off_t) PART_TABLE_OFF, SEEK_SET) == -1		|| write(f, newtable, sizeof(newtable)) < 0		|| write(f, &signature, sizeof(signature)) < 0		|| close(f) < 0	) fatal(device);}int main(int argc, char **argv){	int i;	char *device;	if ((arg0= strrchr(argv[0], '/')) == nil) arg0= argv[0]; else arg0++;	i= 1;	while (i < argc && argv[i][0] == '-') {		char *opt= argv[i++] + 1;		if (opt[0] == '-' && opt[1] == 0) break;		while (*opt != 0) switch (*opt++) {		case 'a':	aflag= 1;	break;		case 'm':	mflag= 1;	break;		case 'r':	rflag= 1;	break;		case 'f':	fflag= 1;	break;		default:	usage();		}	}	if (rflag) {		if (aflag) usage();		if ((argc - i) != 1) usage();		fprintf(stderr, "%s: -r is not yet implemented\n");		exit(1);	} else {		if ((argc - i) < 1) usage();		if (aflag) fprintf(stderr, "%s: -a is not yet implemented\n");		device= argv[i++];		geometry(device);		while (i < argc) parse(argv[i++]);		distribute(device);		write_table(device);	}	exit(0);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
www.日本不卡| 国产欧美日韩久久| 亚洲成人免费看| av网站一区二区三区| 国产精品嫩草影院av蜜臀| 粉嫩av一区二区三区粉嫩| 亚洲另类色综合网站| 成人激情电影免费在线观看| 亚洲天堂中文字幕| 国产盗摄女厕一区二区三区| 日韩视频国产视频| 成人午夜免费视频| 一区二区在线看| 日韩不卡一二三区| 国产不卡在线一区| 奇米在线7777在线精品| 男男成人高潮片免费网站| 色狠狠色狠狠综合| 综合网在线视频| 国产**成人网毛片九色| 精品播放一区二区| 午夜激情一区二区三区| 91女神在线视频| 国产日韩欧美精品在线| 激情伊人五月天久久综合| 欧美日韩国产经典色站一区二区三区 | 极品少妇xxxx偷拍精品少妇| 欧美中文字幕一区二区三区亚洲| 国产精品区一区二区三| 国产成人久久精品77777最新版本| 在线播放视频一区| 99re6这里只有精品视频在线观看| 精品少妇一区二区三区视频免付费| 亚洲bt欧美bt精品| 91精品国产一区二区三区 | 在线视频一区二区三| 亚洲欧美一区二区三区孕妇| 成人免费高清在线| 亚洲欧洲国产专区| 色婷婷久久久综合中文字幕| 亚洲欧美日韩中文字幕一区二区三区| 成人av资源在线观看| 亚洲欧洲日韩综合一区二区| 99riav久久精品riav| 亚洲激情图片小说视频| 欧美色区777第一页| 午夜精品免费在线观看| 日韩一区二区三区精品视频| 激情综合色播激情啊| 日本一区二区三区四区| 99精品在线免费| 亚洲动漫第一页| 欧美成人精品3d动漫h| 国产91色综合久久免费分享| 国产精品麻豆欧美日韩ww| 91尤物视频在线观看| 丝袜亚洲另类丝袜在线| 欧美岛国在线观看| 成人激情黄色小说| 视频精品一区二区| 欧美精品一区在线观看| 成人av网站免费观看| 亚洲第一综合色| 精品卡一卡二卡三卡四在线| 不卡的电影网站| 天天综合色天天综合| 久久色在线观看| 欧美在线短视频| 国产一区二区三区电影在线观看| 国产精品久久一卡二卡| 欧美乱妇20p| 国产成人精品亚洲日本在线桃色 | 欧美mv日韩mv亚洲| 不卡在线视频中文字幕| 日韩av网站在线观看| 中文欧美字幕免费| 欧美一区二区在线看| eeuss鲁一区二区三区| 蜜桃av一区二区三区电影| 日韩一区在线播放| 精品999在线播放| 国产欧美视频一区二区| 91极品美女在线| 成人午夜av电影| 美女在线观看视频一区二区| 亚洲欧洲综合另类| 欧美激情自拍偷拍| 日韩欧美一区在线| 欧美亚洲综合网| 成人h动漫精品一区二| 日韩国产精品久久久| 一区二区免费看| 国产精品久久久久精k8| 精品国产欧美一区二区| 欧美日韩国产中文| 91精彩视频在线观看| 成人久久18免费网站麻豆| 久久se这里有精品| 日本中文一区二区三区| 亚洲国产视频直播| 亚洲手机成人高清视频| 欧美经典一区二区| 欧美xxxx在线观看| 日韩欧美亚洲国产精品字幕久久久| 欧美亚洲日本国产| 色婷婷亚洲一区二区三区| av不卡一区二区三区| 国产麻豆精品一区二区| 狠狠色丁香婷婷综合| 欧美日韩你懂得| 91高清视频在线| 色欧美乱欧美15图片| 91在线观看成人| 99久久久国产精品免费蜜臀| 成人天堂资源www在线| 国产成人精品亚洲日本在线桃色 | 精品av久久707| 2021久久国产精品不只是精品| 欧美一区二区三区免费观看视频| 777xxx欧美| 日韩一级二级三级| 欧美v国产在线一区二区三区| 欧美一级片在线观看| 日韩一区二区三免费高清| 日韩视频在线一区二区| 日韩欧美在线观看一区二区三区| 日韩欧美高清一区| 久久婷婷久久一区二区三区| 久久精品综合网| 日本一区二区三区在线观看| 亚洲欧洲精品成人久久奇米网| 国产精品久久久久桃色tv| 亚洲欧美日韩国产综合| 亚洲国产另类av| 另类人妖一区二区av| 国产精品一区二区91| www.欧美.com| 欧美日韩一卡二卡| 精品久久国产字幕高潮| 麻豆久久久久久久| 国产69精品久久久久毛片| 99热在这里有精品免费| 欧美日韩国产另类不卡| 久久婷婷成人综合色| 18成人在线观看| 喷水一区二区三区| 成人理论电影网| 欧美日韩久久久一区| xnxx国产精品| 一区二区三区中文字幕在线观看| 日本视频一区二区| 成人黄色电影在线| 4hu四虎永久在线影院成人| 久久影视一区二区| 亚洲小说欧美激情另类| 精品一区二区三区在线观看| 色综合久久久久久久久久久| 欧美一区二区三区播放老司机| 中文字幕av一区 二区| 午夜精品福利一区二区三区av| 国产一区二区女| 欧美日韩国产免费| 国产精品久久久久久久久晋中| 日欧美一区二区| 色综合天天在线| 久久久五月婷婷| 性感美女极品91精品| 99久久免费视频.com| 日韩欧美国产系列| 香蕉久久夜色精品国产使用方法| 国产精品 日产精品 欧美精品| 欧美日韩精品一区二区天天拍小说| 国产日韩精品视频一区| 蜜臀av一区二区在线免费观看| 92精品国产成人观看免费| 26uuuu精品一区二区| 视频在线观看一区| 在线观看免费成人| ...av二区三区久久精品| 国产另类ts人妖一区二区| 欧美一区二区三区影视| 亚洲午夜羞羞片| 91色九色蝌蚪| 国产精品另类一区| 国产91对白在线观看九色| 欧美大尺度电影在线| 午夜精品在线看| 欧美日韩在线一区二区| 一区二区三区欧美| 一本色道亚洲精品aⅴ| 国产精品免费久久久久| 成人免费视频视频| 国产偷国产偷精品高清尤物| 制服丝袜亚洲网站| 一区二区三区日韩精品视频| 91麻豆精品在线观看| 亚洲视频一区二区在线观看| www.久久精品| 亚洲免费av观看| 91成人在线免费观看|