Copyright (c) 2004, 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]
#include <sys/cred.h> int priv_getbyname(const char *priv, int flags);
name of the privilege
flags, must be zero or PRIV_ALLOC
If PRIV_ALLOC is passed as a flag parameter, an attempt is made to allocate a privilege if it is not yet defined. The newly allocated privilege number is returned.
Privilege names can be specified with an optional priv_ prefix, which is stripped.
Privilege names are case insensitive but allocated privileges preserve case.
Allocated privileges can be at most {PRIVNAME_MAX} characters long and can contain only alphanumeric characters and the underscore character.
This might be caused by any of the following
The flags parameter is invalid.
The specified privilege does not exist.
The priv parameter contains invalid characters.
There is no room to allocate another privilege.
An attempt was made to allocate a privilege that was longer than {PRIVNAME_MAX} characters.
ATTRIBUTE TYPE ATTRIBUTE VALUE |
Architecture All |
Interface Stability Committed |
Writing Device Drivers