acl_common.h revision 192800
1168404Spjd/* 2168404Spjd * CDDL HEADER START 3168404Spjd * 4168404Spjd * The contents of this file are subject to the terms of the 5185029Spjd * Common Development and Distribution License (the "License"). 6185029Spjd * You may not use this file except in compliance with the License. 7168404Spjd * 8168404Spjd * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9168404Spjd * or http://www.opensolaris.org/os/licensing. 10168404Spjd * See the License for the specific language governing permissions 11168404Spjd * and limitations under the License. 12168404Spjd * 13168404Spjd * When distributing Covered Code, include this CDDL HEADER in each 14168404Spjd * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15168404Spjd * If applicable, add the following below this CDDL HEADER, with the 16168404Spjd * fields enclosed by brackets "[]" replaced with your own identifying 17168404Spjd * information: Portions Copyright [yyyy] [name of copyright owner] 18168404Spjd * 19168404Spjd * CDDL HEADER END 20168404Spjd */ 21168404Spjd/* 22185029Spjd * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 23168404Spjd * Use is subject to license terms. 24168404Spjd */ 25168404Spjd 26185029Spjd#ifndef _ACL_COMMON_H 27185029Spjd#define _ACL_COMMON_H 28168404Spjd 29168404Spjd#pragma ident "%Z%%M% %I% %E% SMI" 30168404Spjd 31168404Spjd 32168404Spjd#include <sys/types.h> 33168404Spjd#include <sys/acl.h> 34168404Spjd#include <sys/stat.h> 35168404Spjd 36185029Spjd#ifdef __cplusplus 37168404Spjdextern "C" { 38168404Spjd#endif 39168404Spjd 40168404Spjdextern ace_t trivial_acl[6]; 41168404Spjd 42168404Spjdextern int acltrivial(const char *); 43168404Spjdextern void adjust_ace_pair(ace_t *pair, mode_t mode); 44185029Spjdextern void adjust_ace_pair_common(void *, size_t, size_t, mode_t); 45168404Spjdextern int ace_trivial(ace_t *acep, int aclcnt); 46185029Spjdextern int ace_trivial_common(void *, int, 47185029Spjd uint64_t (*walk)(void *, uint64_t, int aclcnt, uint16_t *, uint16_t *, 48185029Spjd uint32_t *mask)); 49192800Strasz#if !defined(_KERNEL) 50185029Spjdextern acl_t *acl_alloc(acl_type_t); 51185029Spjdextern void acl_free(acl_t *aclp); 52185029Spjdextern int acl_translate(acl_t *aclp, int target_flavor, 53185029Spjd int isdir, uid_t owner, gid_t group); 54168404Spjdvoid ksort(caddr_t v, int n, int s, int (*f)()); 55168404Spjdint cmp2acls(void *a, void *b); 56168404Spjd 57192800Strasz#endif /* _KERNEL */ 58168404Spjd 59185029Spjd#ifdef __cplusplus 60168404Spjd} 61168404Spjd#endif 62168404Spjd 63185029Spjd#endif /* _ACL_COMMON_H */ 64