fdiskaixlabel.c

来自「Util-linux 软件包包含许多工具。其中比较重要的是加载、卸载、格式化、分」· C语言 代码 · 共 70 行

C
70
字号
/*  Changes:  Sat Mar 20 09:51:38 EST 1999 Arnaldo Carvalho de Melo <acme@conectiva.com.br>  	Internationalization*/#include <stdio.h>              /* stderr */#include <string.h>             /* strstr */#include <unistd.h>             /* write */#include <endian.h>#include "common.h"#include "fdisk.h"#include "fdiskaixlabel.h"#include "nls.h"static	int     other_endian = 0;static  short	volumes=1;/* * only dealing with free blocks here */static voidaix_info( void ) {    puts(	_("\n\tThere is a valid AIX label on this disk.\n"	"\tUnfortunately Linux cannot handle these\n"	"\tdisks at the moment.  Nevertheless some\n"	"\tadvice:\n"	"\t1. fdisk will destroy its contents on write.\n"	"\t2. Be sure that this disk is NOT a still vital\n"	"\t   part of a volume group. (Otherwise you may\n"	"\t   erase the other disks as well, if unmirrored.)\n"	"\t3. Before deleting this physical volume be sure\n"	"\t   to remove the disk logically from your AIX\n"	"\t   machine.  (Otherwise you become an AIXpert).")    );}voidaix_nolabel( void ){    aixlabel->magic = 0;    aix_label = 0;    partitions = 4;    memset( MBRbuffer, 0, sizeof(MBRbuffer) );	/* avoid fdisk cores */    return;}intcheck_aix_label( void ){    if (aixlabel->magic != AIX_LABEL_MAGIC &&	aixlabel->magic != AIX_LABEL_MAGIC_SWAPPED) {	aix_label = 0;	other_endian = 0;	return 0;    }    other_endian = (aixlabel->magic == AIX_LABEL_MAGIC_SWAPPED);    update_units();    aix_label = 1;    partitions= 1016;    volumes = 15;    aix_info();    aix_nolabel();		/* %% */    aix_label = 1;		/* %% */    return 1;}

⌨️ 快捷键说明

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