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