2 .\" Copyright (c) 2004, 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 PRIV_GETBYNAME 9F "Mar 11, 2004"
8 priv_getbyname \- map a privilege name to a number
16 \fBint\fR \fBpriv_getbyname\fR(\fBconst char *\fR\fIpriv\fR, \fBint\fR \fIflags\fR);
22 Solaris DDI specific (Solaris DDI).
39 flags, must be zero or \fBPRIV_ALLOC\fR
45 The \fBpriv_getbyname()\fR function maps a privilege name to a privilege number
46 for use with the \fBpriv_*()\fR kernel interfaces.
49 If \fBPRIV_ALLOC\fR is passed as a flag parameter, an attempt is made to
50 allocate a privilege if it is not yet defined. The newly allocated privilege
54 Privilege names can be specified with an optional \fBpriv_\fR prefix, which is
58 Privilege names are case insensitive but allocated privileges preserve case.
61 Allocated privileges can be at most \fB{PRIVNAME_MAX}\fR characters long and
62 can contain only alphanumeric characters and the underscore character.
66 This function returns the privilege number, which is greater than or equal to
67 0, if it succeeds. It returns a negative error number if an error occurs.
75 This might be caused by any of the following
80 The \fIflags\fR parameter is invalid.
86 The specified privilege does not exist.
92 The \fIpriv\fR parameter contains invalid characters.
102 There is no room to allocate another privilege.
108 \fB\fBENAMETOOLONG\fR\fR
111 An attempt was made to allocate a privilege that was longer than
112 \fB{PRIVNAME_MAX}\fR characters.
118 This functions can be called from user and kernel contexts.
122 See \fBattributes\fR(5) for a description of the following attributes:
130 ATTRIBUTE TYPE ATTRIBUTE VALUE
134 Interface Stability Committed
140 \fBattributes\fR(5), \fBprivileges\fR(5)
143 \fIWriting Device Drivers\fR