xref: /illumos-gate/usr/src/common/acl/acl_common.h (revision da6c28aa)
1fa9e4066Sahrens /*
2fa9e4066Sahrens  * CDDL HEADER START
3fa9e4066Sahrens  *
4fa9e4066Sahrens  * The contents of this file are subject to the terms of the
5*da6c28aaSamw  * Common Development and Distribution License (the "License").
6*da6c28aaSamw  * You may not use this file except in compliance with the License.
7fa9e4066Sahrens  *
8fa9e4066Sahrens  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9fa9e4066Sahrens  * or http://www.opensolaris.org/os/licensing.
10fa9e4066Sahrens  * See the License for the specific language governing permissions
11fa9e4066Sahrens  * and limitations under the License.
12fa9e4066Sahrens  *
13fa9e4066Sahrens  * When distributing Covered Code, include this CDDL HEADER in each
14fa9e4066Sahrens  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15fa9e4066Sahrens  * If applicable, add the following below this CDDL HEADER, with the
16fa9e4066Sahrens  * fields enclosed by brackets "[]" replaced with your own identifying
17fa9e4066Sahrens  * information: Portions Copyright [yyyy] [name of copyright owner]
18fa9e4066Sahrens  *
19fa9e4066Sahrens  * CDDL HEADER END
20fa9e4066Sahrens  */
21fa9e4066Sahrens /*
22*da6c28aaSamw  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23fa9e4066Sahrens  * Use is subject to license terms.
24fa9e4066Sahrens  */
25fa9e4066Sahrens 
26*da6c28aaSamw #ifndef	_ACL_COMMON_H
27*da6c28aaSamw #define	_ACL_COMMON_H
28fa9e4066Sahrens 
29fa9e4066Sahrens #pragma ident	"%Z%%M%	%I%	%E% SMI"
30fa9e4066Sahrens 
31fa9e4066Sahrens 
32fa9e4066Sahrens #include <sys/types.h>
33fa9e4066Sahrens #include <sys/acl.h>
34fa9e4066Sahrens #include <sys/stat.h>
35fa9e4066Sahrens 
36*da6c28aaSamw #ifdef	__cplusplus
37fa9e4066Sahrens extern "C" {
38fa9e4066Sahrens #endif
39fa9e4066Sahrens 
40fa9e4066Sahrens extern ace_t trivial_acl[6];
41fa9e4066Sahrens 
42fa9e4066Sahrens extern int acltrivial(const char *);
43fa9e4066Sahrens extern void adjust_ace_pair(ace_t *pair, mode_t mode);
44*da6c28aaSamw extern void adjust_ace_pair_common(void *, size_t, size_t, mode_t);
45fa9e4066Sahrens extern int ace_trivial(ace_t *acep, int aclcnt);
46*da6c28aaSamw extern int ace_trivial_common(void *, int,
47*da6c28aaSamw     uint64_t (*walk)(void *, uint64_t, int aclcnt, uint16_t *, uint16_t *,
48*da6c28aaSamw     uint32_t *mask));
49*da6c28aaSamw extern acl_t *acl_alloc(acl_type_t);
50*da6c28aaSamw extern void acl_free(acl_t *aclp);
51*da6c28aaSamw extern int acl_translate(acl_t *aclp, int target_flavor,
52*da6c28aaSamw     int isdir, uid_t owner, gid_t group);
53fa9e4066Sahrens void ksort(caddr_t v, int n, int s, int (*f)());
54fa9e4066Sahrens int cmp2acls(void *a, void *b);
55fa9e4066Sahrens 
56fa9e4066Sahrens 
57*da6c28aaSamw #ifdef	__cplusplus
58fa9e4066Sahrens }
59fa9e4066Sahrens #endif
60fa9e4066Sahrens 
61*da6c28aaSamw #endif /* _ACL_COMMON_H */
62