8895 libtsol man pages are out of step with reality
[unleashed.git] / usr / src / man / man3tsol / m_label.3tsol
blob16874cf1b7294b58043b6225d43d6f5ce0183442
1 '\" te
2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .TH M_LABEL 3TSOL "Jul 20, 2007"
7 .SH NAME
8 m_label, m_label_alloc, m_label_dup, m_label_free \- m_label functions
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBcc\fR [\fIflag\fR...] \fIfile\fR... \fB-ltsol\fR [\fIlibrary\fR...]
13 .fi
15 .LP
16 .nf
17 #include <tsol/label.h>
19 \fBm_label_t *\fR\fBm_label_alloc\fR(\fBconst m_label_type_t\fR \fIlabel_type\fR);
20 .fi
22 .LP
23 .nf
24 \fBint\fR \fBm_label_dup\fR(\fBm_label_t **\fR\fIdst\fR, \fBconst m_label_t *\fR\fIsrc\fR);
25 .fi
27 .LP
28 .nf
29 \fBvoid\fR \fBm_label_free\fR(\fBm_label_t *\fR\fIlabel\fR);
30 .fi
32 .SH DESCRIPTION
33 .sp
34 .LP
35 The \fBm_label_alloc()\fR function allocates resources for a new label. The
36 \fIlabel_type\fR argument defines the type for a newly allocated label. The
37 label type can be:
38 .sp
39 .ne 2
40 .na
41 \fB\fBMAC_LABEL\fR\fR
42 .ad
43 .RS 14n
44 A Mandatory Access Control (MAC) label.
45 .RE
47 .sp
48 .ne 2
49 .na
50 \fB\fBUSER_CLEAR\fR\fR
51 .ad
52 .RS 14n
53 A user clearance.
54 .RE
56 .sp
57 .LP
58 The \fBm_label_dup()\fR function allocates resources for a new \fIdst\fR label.
59 The function returns a pointer to the allocated label, which is an exact copy
60 of the \fIsrc\fR label. The caller is responsible for freeing the allocated
61 resources by calling \fBm_label_free()\fR.
62 .sp
63 .LP
64 The \fBm_label_free()\fR function frees resources that are associated with the
65 previously allocated label.
66 .SH RETURN VALUES
67 .sp
68 .LP
69 Upon successful completion, the \fBm_label_alloc()\fR function returns a
70 pointer to the newly allocated label. Otherwise, \fBm_label_alloc()\fR returns
71 \fINULL\fR and \fIerrno\fR is set to indicate the error.
72 .sp
73 .LP
74 Upon successful completion, the \fBm_label_dup()\fR function returns 0.
75 Otherwise, \fB-1\fR is returned and \fIerrno\fR is set to indicate the error.
76 .SH ERRORS
77 .sp
78 .LP
79 The \fBm_label_alloc()\fR function will fail if:
80 .sp
81 .ne 2
82 .na
83 \fB\fBEINVAL\fR\fR
84 .ad
85 .RS 10n
86 Invalid parameter.
87 .RE
89 .sp
90 .ne 2
91 .na
92 \fB\fBENOMEM\fR\fR
93 .ad
94 .RS 10n
95 The physical limits of the system are exceeded by size bytes of memory which
96 cannot be allocated.
97 .RE
99 .SH ATTRIBUTES
102 See \fBattributes\fR(5) for descriptions of the following attributes:
107 box;
108 c | c
109 l | l .
110 ATTRIBUTE TYPE  ATTRIBUTE VALUE
112 Interface Stability     Committed
114 MT-Level        Safe
117 .SH SEE ALSO
120 \fBlabel_to_str\fR(3TSOL), \fBlibtsol\fR(3LIB), \fBstr_to_label\fR(3TSOL),
121 \fBlabel_encodings\fR(4), \fBattributes\fR(5), \fBlabels\fR(5)
124 \fIDetermining Whether the Printing Service Is Running in a Labeled
125 Environment\fR in \fISolaris Trusted Extensions Developer\&'s Guide\fR
126 .SH NOTES
129 The functionality described on this manual page is available only if the system
130 is configured with Trusted Extensions.