Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ././../../../../../../usr/man/man3ext/efi_alloc_and_init.3ext
Real path: /usr/share/man/man3ext/efi_alloc_and_init.3ext
Zurück
'\" te .\" Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. .TH efi_alloc_and_init 3EXT "27 Nov 2017" "Oracle Solaris 11.4" "Extended Library Functions" .SH NAME efi_alloc_and_init, efi_alloc_and_read, efi_free, efi_write, efi_use_whole_disk \- manipulate a disk's EFI Partition Table .SH SYNOPSIS .LP .nf cc [ \fIflag ...\fR ] \fIfile\fR... \fB-lefi\fR [ \fIlibrary ...\fR ] #include <sys/vtoc.h> #include <sys/efi_partition.h> \fBint\fR \fBefi_alloc_and_init\fR(\fBint\fR \fIfd\fR, \fBuint32_t\fR \fInparts\fR, \fBdk_gpt_t **\fR\fIvtoc\fR); .fi .LP .nf \fBint\fR \fBefi_alloc_and_read\fR(\fBint\fR \fIfd\fR, \fBdk_gpt_t **\fR\fIvtoc\fR); .fi .LP .nf \fBvoid\fR \fBefi_free\fR(\fBdk_gpt_t *\fR\fIvtoc\fR); .fi .LP .nf \fBint\fR \fBefi_write\fR(\fBint\fR \fIfd\fR, \fBdk_gpt_t *\fR\fIvtoc\fR); .fi .LP .nf \fBint\fR \fBefi_use_whole_disk\fR(\fBint\fR \fIfd\fR); .fi .SH DESCRIPTION .sp .LP The \fBefi_alloc_and_init()\fR function initializes the \fBdk_gpt_t\fR structure specified by \fIvtoc\fR in preparation for a call to \fBefi_write()\fR. It calculates and initializes the \fBefi_version\fR, \fBefi_lbasize\fR, \fBefi_nparts\fR, \fBefi_first_u_lba\fR, \fBefi_last_lba\fR, and \fBefi_last_u_lba\fR members of this structure. The caller can then set the \fBefi_nparts\fR member. .sp .LP The \fBefi_alloc_and_read()\fR function allocates memory and returns the partition table. .sp .LP The \fBefi_free()\fR function frees the memory allocated by \fBefi_alloc_and_init()\fR and \fBefi_alloc_and_read()\fR. .sp .LP The \fBefi_write()\fR function writes the EFI partition table. .sp .LP The \fBefi_use_whole_disk()\fR function takes any space that is not contained in the disk label and adds it into the EFI label. If the reserved partition is right before the backup label, add the space to the last physically non-zero area before the reserved partition. Otherwise, add the space to the last physically non-zero area before the backup label. .sp .LP The \fIfd\fR argument refers to any partition on a raw disk, opened with \fBO_NDELAY\fR. See \fBopen\fR(2). .sp .LP The \fInparts\fR argument specifies the number of desired partitions. .sp .LP The \fIvtoc\fR argument is a \fBdk_gpt_t\fR structure that describes an EFI partition table and contains at least the following members: .sp .in +2 .nf uint_t efi_version; /* set to EFI_VERSION_CURRENT */ uint_t efi_nparts; /* index of last user-defined */ /* (non-zero) partition in efi_parts */ /* plus one */ uint_t efi_lbasize; /* size of block in bytes */ diskaddr_t efi_last_lba; /* last block on the disk */ diskaddr_t efi_first_u_lba; /* first block after labels */ diskaddr_t efi_last_u_lba; /* last block before backup labels */ uint_t efi_num_of_partition_entries /* number of partitions */ /* in efi_parts, representing actual */ /* GUID partition entries allocated */ /* on disk */ struct dk_part efi_parts[]; /* array of partitions */ .fi .in -2 .sp .SH RETURN VALUES .sp .LP Upon successful completion, \fBefi_alloc_and_init()\fR returns 0. Otherwise it returns \fBVT_EIO\fR if an I/O operation to the disk fails. .sp .LP Upon successful completion, \fBefi_alloc_and_read()\fR returns a positive integer indicating the partition index associated with the open file descriptor. Otherwise, it returns a negative integer to indicate one of the following: .sp .ne 2 .mk .na \fB\fBVT_EIO\fR\fR .ad .RS 13n .rt An I/O error occurred. .RE .sp .ne 2 .mk .na \fB\fBVT_ERROR\fR\fR .ad .RS 13n .rt An unknown error occurred. .RE .sp .ne 2 .mk .na \fB\fBVT_EINVAL\fR\fR .ad .RS 13n .rt An EFI label was not found. .RE .sp .LP Upon successful completion, \fBefi_write()\fR returns 0. Otherwise, it returns a negative integer to indicate one of the following: .sp .ne 2 .mk .na \fB\fBVT_EIO\fR\fR .ad .RS 13n .rt An I/O error occurred. .RE .sp .ne 2 .mk .na \fB\fBVT_ERROR\fR\fR .ad .RS 13n .rt An unknown error occurred. .RE .sp .ne 2 .mk .na \fB\fBVT_EINVAL\fR\fR .ad .RS 13n .rt The label contains incorrect data. .RE .sp .LP Upon successful completion, \fBefi_use_whole_disk()\fR returns 0. Otherwise, it returns a negative integer to indicate one of the following: .sp .ne 2 .mk .na \fB\fBVT_EIO\fR\fR .ad .RS 13n .rt An I/O error occurred. .RE .sp .ne 2 .mk .na \fB\fBVT_ERROR\fR\fR .ad .RS 13n .rt An unknown error occurred. .RE .sp .ne 2 .mk .na \fB\fBVT_EINVAL\fR\fR .ad .RS 13n .rt The label contains incorrect data. .RE .sp .ne 2 .mk .na \fB\fBVT_ENOSPC\fR\fR .ad .RS 13n .rt Space out of label was not found. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .TS tab( ) box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPE ATTRIBUTE VALUE _ Interface Stability Committed _ MT-Level Unsafe .TE .sp .SH SEE ALSO .sp .LP \fBioctl\fR(2), \fBopen\fR(2), \fBread_vtoc\fR(3EXT), \fBlibefi\fR(3LIB), \fBdkio\fR(4I), \fBattributes\fR(7), \fBfmthard\fR(8), \fBformat\fR(8), \fBprtvtoc\fR(8)