summaryrefslogtreecommitdiff
path: root/usr/src/man/man3tsol/getzonerootbyid.3tsol
blob: 92348a92b8b92c68c9c255ea7a4718e75f3f197e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
'\" te
.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH GETZONEROOTBYID 3TSOL "Jul 20, 2007"
.SH NAME
getzonerootbyid, getzonerootbylabel, getzonerootbyname \- map between zone root
pathnames and labels
.SH SYNOPSIS
.LP
.nf
\fBcc\fR [\fIflags\fR...] \fIfile\fR... \fB-ltsol\fR [\fIlibrary\fR...]
.fi

.LP
.nf
#include <tsol/label.h>

\fBchar *\fR\fBgetzonerootbyid\fR(\fBzoneid_t\fR \fIzoneid\fR);
.fi

.LP
.nf
\fBchar *\fR\fBgetzonerootbylabel\fR(\fBconst m_label_t *\fR\fIlabel\fR);
.fi

.LP
.nf
\fBchar *\fR\fBgetzonerootbyname\fR(\fBconst char *\fR\fIzonename\fR);
.fi

.SH DESCRIPTION
.sp
.LP
The \fBgetzonerootbyid()\fR function returns the root pathname of \fIzoneid\fR.
.sp
.LP
The \fBgetzonerootbylabel()\fR function returns the root pathname of the zone
whose label is \fIlabel\fR.
.sp
.LP
The \fBgetzonerootbyname()\fR function returns the root pathname of
\fIzonename\fR.
.sp
.LP
All of these functions require that the specified zone's state is at least
\fBZONE_IS_READY\fR. The zone of the calling process must dominate the
specified zone's label, or the calling process must be in the global zone. The
returned pathname is relative to the root path of the caller's zone.
.SH RETURN VALUES
.sp
.LP
On successful completion, the \fBgetzonerootbyid()\fR,
\fBgetzonerootbylabel()\fR, and \fBgetzonerootbyname()\fR functions return a
pointer to a pathname that is allocated within these functions. To free the
storage, use \fBfree\fR(3C). On failure, these functions return \fBNULL\fR and
set \fIerrno\fR to indicate the error.
.SH ERRORS
.sp
.LP
These functions will fail if:
.sp
.ne 2
.na
\fB\fBEFAULT\fR\fR
.ad
.RS 10n
Invalid argument; pointer location is invalid.
.RE

.sp
.ne 2
.na
\fB\fBEINVAL\fR\fR
.ad
.RS 10n
\fIzoneid\fR invalid, or zone not found or not ready.
.RE

.sp
.ne 2
.na
\fB\fBENOENT\fR\fR
.ad
.RS 10n
Zone does not exist.
.RE

.sp
.ne 2
.na
\fB\fBENOMEM\fR\fR
.ad
.RS 10n
Unable to allocate pathname.
.RE

.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Committed
_
MT-Level	Safe
.TE

.SH SEE ALSO
.sp
.LP
.BR Intro (2),
.BR free (3C),
.BR getzonenamebyid (3C),
.BR libtsol (3LIB),
.BR attributes (7),
.BR labels (7)
.SH NOTES
.sp
.LP
The functionality described on this manual page is available only if the system
is configured with Trusted Extensions.