4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 1991-1994, by Sun Microsystems, Inc.
24 * All rights reserved.
27 #pragma ident "%Z%%M% %I% %E% SMI"
29 #include <sys/promif.h>
30 #include <sys/promimpl.h>
33 prom_devname_from_pathname(register char *pathname
, register char *buffer
)
37 if ((pathname
== NULL
) || (*pathname
== '\0'))
40 p
= prom_strrchr(pathname
, '/');
47 if ((*p
== '@') || (*p
== ':'))
56 * Get base device name of stdin/stdout device into callers buffer.
57 * Return 0 if successful; -1 otherwise.
61 prom_stdin_devname(char *buffer
)
63 return (prom_devname_from_pathname(prom_stdinpath(), buffer
));
67 prom_stdout_devname(char *buffer
)
69 return (prom_devname_from_pathname(prom_stdoutpath(), buffer
));
73 * Return 1 if stdin/stdout are on the same device and subdevice.
74 * Return 0, otherwise.
78 prom_stdin_stdout_equivalence(void)
83 p
= prom_stdoutpath();
85 if ((s
!= NULL
) && (p
!= NULL
)) {
86 return (prom_strcmp(s
, p
) == 0 ? 1:0);
93 * This just returns a pointer to the option's part of the
94 * last part of the string. Useful for determining which is
95 * the boot partition, tape file or channel of the DUART.
98 prom_path_options(register char *path
)
100 register char *p
, *s
;
102 s
= prom_strrchr(path
, '/');
105 p
= prom_strrchr(s
, ':');