dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / lib / libc / port / sys / ppriv.c
blob6a1992c38c6a75f27f7a4973d0e81fd8a60f157a
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
29 #pragma weak _setppriv = setppriv
30 #pragma weak _getppriv = getppriv
31 #pragma weak _setpflags = setpflags
32 #pragma weak _getpflags = getpflags
34 #include "lint.h"
35 #include <sys/types.h>
36 #include <sys/syscall.h>
37 #include "priv_private.h"
38 #include <priv.h>
40 int
41 setppriv(priv_op_t op, priv_ptype_t type, const priv_set_t *pset)
43 priv_data_t *d;
44 int set;
46 LOADPRIVDATA(d);
48 set = priv_getsetbyname(type);
50 return (syscall(SYS_privsys, PRIVSYS_SETPPRIV, op, set, (void *)pset,
51 d->pd_setsize));
54 int
55 getppriv(priv_ptype_t type, priv_set_t *pset)
57 priv_data_t *d;
58 int set;
60 LOADPRIVDATA(d);
62 set = priv_getsetbyname(type);
64 return (syscall(SYS_privsys, PRIVSYS_GETPPRIV, 0, set, (void *)pset,
65 d->pd_setsize));
68 int
69 getprivinfo(priv_impl_info_t *buf, size_t bufsize)
71 return (syscall(SYS_privsys, PRIVSYS_GETIMPLINFO, 0, 0, (void *)buf,
72 bufsize));
75 int
76 setpflags(uint_t flag, uint_t val)
78 return (syscall(SYS_privsys, PRIVSYS_SETPFLAGS, (priv_op_t)flag,
79 (priv_ptype_t)(uintptr_t)val, 0, 0));
82 uint_t
83 getpflags(uint_t flag)
85 return (syscall(SYS_privsys, PRIVSYS_GETPFLAGS, flag, 0, 0, 0));