.\" $NetBSD: ahdi_writedisktab.3,v 1.1 2000/02/05 20:40:41 jdc Exp $ .\" .\" Copyright (c) 1998 The NetBSD Foundation, Inc. .\" All rights reserved. .\" .\" This code is derived from software contributed to The NetBSD Foundation .\" by Julian Coleman. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the NetBSD .\" Foundation, Inc. and its contributors. .\" 4. Neither the name of The NetBSD Foundation nor the names of its .\" contributors may be used to endorse or promote products derived .\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" .Dd January 5, 2000 .Dt ahdi_writedisktab 3 .Sh NAME .Nm ahdi_writedisktab .Nd write AHDI partition label in disktab form .Sh LIBRARY .Lb libahdi .Sh SYNOPSIS .Fd #include .Ft int .Fn ahdi_writedisktab "struct ahdi_ptable *ptable" "char *disktype" "char *disktab" "char *dtype" .Sh DESCRIPTION The .Nm function takes an AHDI label and writes it out in .Xr disktab 5 format. The .Em disktype parameter is the name given to the entry and can be passed as the .Em disktype to .Xr disklabel 8 . The .Em disktab parameter is the name of the disktab file to append the disktab to. If this parameter is empty, the default /etc/disktab is used. The .Em dtype parameter, if not empty, is used as the `dt' paramter in the disktab. It should be one of the dktypenames defined in /usr/include/sys/disklabel.h. .Pp If an AHDI label has been written to the disk using the .Fn ahdi_writedisktab function, the partition letters on the disk may not be consistent with those in the ptable variable until a NetBSD dislabel has been written with the .Xr disklabel command, using the disklabel generated by this function. .Sh DIAGNOSTICS The .Nm function returns the following codes: .Bl -column "Code" "Meaning" -offset indent .It Em Code Ta Em Meaning .It Li 1 Ta OK .It Li -1 Ta System call error (see value of errno) .El .Sh SEE ALSO .Xr errno 2 , .Xr ahdi_buildlabel 3 , .Xr ahdi_checklabel 3 , .Xr ahdi_readlabel 3 , .Xr ahdi_writelabel 3 , .Xr ahdi 4 , .Xr disktab 5 , .Xr disklabel 8 .Sh HISTORY The .Nm libahdi package appeared in .Nx 1.5 . .Sh AUTHORS .An Julian Coleman, Waldi Ravens, Leo Weppelman .Sh BUGS The .Nm function does not recognise the (deprecated) partition ID's .Em NBR , .Em NBU or .Em NBS . .Pp If no partition of type .Em NBD or .Em RAW exist, no NetBSD disklabel can be written to the disk.