1*dba3562dSLionel Sambuc.\" $NetBSD: getlabelsector.3,v 1.8 2011/09/14 11:43:29 njoly Exp $ 20c3983b2SBen Gras.\" 30c3983b2SBen Gras.\" 40c3983b2SBen Gras.\" Copyright 2002 Wasabi Systems, Inc. 50c3983b2SBen Gras.\" All rights reserved. 60c3983b2SBen Gras.\" 70c3983b2SBen Gras.\" Written by Steve C. Woodford for Wasabi Systems, Inc. 80c3983b2SBen Gras.\" 90c3983b2SBen Gras.\" Redistribution and use in source and binary forms, with or without 100c3983b2SBen Gras.\" modification, are permitted provided that the following conditions 110c3983b2SBen Gras.\" are met: 120c3983b2SBen Gras.\" 1. Redistributions of source code must retain the above copyright 130c3983b2SBen Gras.\" notice, this list of conditions and the following disclaimer. 140c3983b2SBen Gras.\" 2. Redistributions in binary form must reproduce the above copyright 150c3983b2SBen Gras.\" notice, this list of conditions and the following disclaimer in the 160c3983b2SBen Gras.\" documentation and/or other materials provided with the distribution. 170c3983b2SBen Gras.\" 3. All advertising materials mentioning features or use of this software 180c3983b2SBen Gras.\" must display the following acknowledgement: 190c3983b2SBen Gras.\" This product includes software developed for the NetBSD Project by 200c3983b2SBen Gras.\" Wasabi Systems, Inc. 210c3983b2SBen Gras.\" 4. The name of Wasabi Systems, Inc. may not be used to endorse 220c3983b2SBen Gras.\" or promote products derived from this software without specific prior 230c3983b2SBen Gras.\" written permission. 240c3983b2SBen Gras.\" 250c3983b2SBen Gras.\" THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND 260c3983b2SBen Gras.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 270c3983b2SBen Gras.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 280c3983b2SBen Gras.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC 290c3983b2SBen Gras.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 300c3983b2SBen Gras.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 310c3983b2SBen Gras.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 320c3983b2SBen Gras.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 330c3983b2SBen Gras.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 340c3983b2SBen Gras.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 350c3983b2SBen Gras.\" POSSIBILITY OF SUCH DAMAGE. 360c3983b2SBen Gras.\" 37*dba3562dSLionel Sambuc.Dd August 25, 2011 380c3983b2SBen Gras.Dt GETLABELSECTOR 3 390c3983b2SBen Gras.Os 400c3983b2SBen Gras.Sh NAME 410c3983b2SBen Gras.Nm getlabelsector , 42*dba3562dSLionel Sambuc.Nm getlabeloffset , 43*dba3562dSLionel Sambuc.Nm getlabelusesmbr 44*dba3562dSLionel Sambuc.Nd get disklabel location informations 450c3983b2SBen Gras.Sh LIBRARY 460c3983b2SBen Gras.Lb libutil 470c3983b2SBen Gras.Sh SYNOPSIS 480c3983b2SBen Gras.In util.h 490c3983b2SBen Gras.Ft daddr_t 500c3983b2SBen Gras.Fn getlabelsector void 510c3983b2SBen Gras.Ft off_t 520c3983b2SBen Gras.Fn getlabeloffset void 53*dba3562dSLionel Sambuc.Ft int 54*dba3562dSLionel Sambuc.Fn getlabelusesmbr void 550c3983b2SBen Gras.Sh DESCRIPTION 560c3983b2SBen GrasThe 570c3983b2SBen Gras.Fn getlabelsector 580c3983b2SBen Grasand 590c3983b2SBen Gras.Fn getlabeloffset 600c3983b2SBen Grasfunctions return values which describe the exact on-disk location of the 610c3983b2SBen Gras.Xr disklabel 5 620c3983b2SBen Grason the current system, or \-1 on error. 630c3983b2SBen GrasThese functions supersede the hardcoded 640c3983b2SBen Gras.Dv LABELSECTOR 650c3983b2SBen Grasand 660c3983b2SBen Gras.Dv LABELOFFSET 670c3983b2SBen Grasdefinitions previously used to derive the location of the 680c3983b2SBen Gras.Xr disklabel 5 . 69*dba3562dSLionel Sambuc.Pp 70*dba3562dSLionel SambucThe 71*dba3562dSLionel Sambuc.Fn getlabelusesmbr 72*dba3562dSLionel Sambucreturns 1 if the disklabel is located inside a MBR partition, 0 if it's stored 73*dba3562dSLionel Sambucrelative to the start of the disk, or \-1 on error. 740c3983b2SBen Gras.Sh SEE ALSO 750c3983b2SBen Gras.Xr sysctl 3 , 760c3983b2SBen Gras.Xr disklabel 5 770c3983b2SBen Gras.Sh HISTORY 780c3983b2SBen GrasThe 790c3983b2SBen Gras.Fn getlabelsector 800c3983b2SBen Grasand 810c3983b2SBen Gras.Fn getlabeloffset 820c3983b2SBen Grasfunctions appeared in 830c3983b2SBen Gras.Nx 2.0 . 84