obj.mk: rewrite; use "obj" symlinks in unleashed tree
[unleashed.git] / include / ucred.h
bloba60fe0320588ee20f1edcb11e7ff7a6374dfe905
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
22 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
28 #ifndef _UCRED_H_
29 #define _UCRED_H_
31 #include <sys/types.h>
32 #include <sys/priv.h>
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
38 typedef struct ucred_s ucred_t;
41 * library functions prototype.
44 extern ucred_t *ucred_get(pid_t pid);
46 extern void ucred_free(ucred_t *);
48 extern uid_t ucred_geteuid(const ucred_t *);
49 extern uid_t ucred_getruid(const ucred_t *);
50 extern uid_t ucred_getsuid(const ucred_t *);
51 extern gid_t ucred_getegid(const ucred_t *);
52 extern gid_t ucred_getrgid(const ucred_t *);
53 extern gid_t ucred_getsgid(const ucred_t *);
54 extern int ucred_getgroups(const ucred_t *, const gid_t **);
56 extern const priv_set_t *ucred_getprivset(const ucred_t *, priv_ptype_t);
57 extern uint_t ucred_getpflags(const ucred_t *, uint_t);
59 extern pid_t ucred_getpid(const ucred_t *); /* for door_cred compatibility */
61 extern size_t ucred_size(void);
63 extern int getpeerucred(int, ucred_t **);
65 extern zoneid_t ucred_getzoneid(const ucred_t *);
67 extern projid_t ucred_getprojid(const ucred_t *);
69 #ifdef __cplusplus
71 #endif
73 #endif /* _UCRED_H_ */