xref: /netbsd/lib/libutil/getdiskrawname.3 (revision a4ef5d37)
1*a4ef5d37Schristos.\"	$NetBSD: getdiskrawname.3,v 1.1 2012/04/07 16:44:39 christos Exp $
2*a4ef5d37Schristos.\"
3*a4ef5d37Schristos.\" Copyright (c) 2012 The NetBSD Foundation, Inc.
4*a4ef5d37Schristos.\" All rights reserved.
5*a4ef5d37Schristos.\"
6*a4ef5d37Schristos.\" This code is derived from software contributed to The NetBSD Foundation
7*a4ef5d37Schristos.\" by Christos Zoulas.
8*a4ef5d37Schristos.\"
9*a4ef5d37Schristos.\" Redistribution and use in source and binary forms, with or without
10*a4ef5d37Schristos.\" modification, are permitted provided that the following conditions
11*a4ef5d37Schristos.\" are met:
12*a4ef5d37Schristos.\" 1. Redistributions of source code must retain the above copyright
13*a4ef5d37Schristos.\"    notice, this list of conditions and the following disclaimer.
14*a4ef5d37Schristos.\" 2. Redistributions in binary form must reproduce the above copyright
15*a4ef5d37Schristos.\"    notice, this list of conditions and the following disclaimer in the
16*a4ef5d37Schristos.\"    documentation and/or other materials provided with the distribution.
17*a4ef5d37Schristos.\"
18*a4ef5d37Schristos.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19*a4ef5d37Schristos.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20*a4ef5d37Schristos.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21*a4ef5d37Schristos.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22*a4ef5d37Schristos.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23*a4ef5d37Schristos.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24*a4ef5d37Schristos.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25*a4ef5d37Schristos.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26*a4ef5d37Schristos.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27*a4ef5d37Schristos.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28*a4ef5d37Schristos.\" POSSIBILITY OF SUCH DAMAGE.
29*a4ef5d37Schristos.\"
30*a4ef5d37Schristos.\"
31*a4ef5d37Schristos.Dd March 7, 2012
32*a4ef5d37Schristos.Dt GETDISKRAWNAME 3
33*a4ef5d37Schristos.Os
34*a4ef5d37Schristos.Sh NAME
35*a4ef5d37Schristos.Nm getdiskrawname
36*a4ef5d37Schristos.Nd get the the block/character device name for a disk
37*a4ef5d37Schristos.Sh LIBRARY
38*a4ef5d37Schristos.Lb libutil
39*a4ef5d37Schristos.Sh SYNOPSIS
40*a4ef5d37Schristos.In util.h
41*a4ef5d37Schristos.Ft const char *
42*a4ef5d37Schristos.Fn getdiskrawname "char *buf" "size_t buflen" "const char *name"
43*a4ef5d37Schristos.Ft const char *
44*a4ef5d37Schristos.Fn getdiskcookedname "char *buf" "size_t buflen" "const char *name"
45*a4ef5d37Schristos.Sh DESCRIPTION
46*a4ef5d37SchristosThe
47*a4ef5d37Schristos.Fn getdiskrawname
48*a4ef5d37Schristosfunction converts the
49*a4ef5d37Schristos.Fa name
50*a4ef5d37Schristosargument thar contains a path to a disk block device node to the
51*a4ef5d37Schristospath that contains the corresponding character device node.
52*a4ef5d37SchristosThe
53*a4ef5d37Schristos.Fn getdiskcookedname
54*a4ef5d37Schristosfunction converts the
55*a4ef5d37Schristos.Fa name
56*a4ef5d37Schristosargument thar contains a path to a disk character device node to the
57*a4ef5d37Schristospath that contains the corresponding block device node.
58*a4ef5d37Schristos.Sh RETURN VALUES
59*a4ef5d37SchristosOn success the absolute pathname of the underlying device node is returned.
60*a4ef5d37SchristosOn failure
61*a4ef5d37Schristos.Dv NULL
62*a4ef5d37Schristosis returned and
63*a4ef5d37Schristos.Va errno
64*a4ef5d37Schristoscontains the reason for the error.
65*a4ef5d37Schristos.Sh HISTORY
66*a4ef5d37SchristosThe
67*a4ef5d37Schristos.Fn getdiskrawname
68*a4ef5d37Schristosand
69*a4ef5d37Schristos.Fn getdiskcookedname
70*a4ef5d37Schristosfunctions appeared in
71*a4ef5d37Schristos.Nx 7.0
72