#ifndef _SYS_ACL_H_
#define _SYS_ACL_H_
#ifndef _SYS_TYPES_H_
#include <sys/types.h>
#endif
#define ACL_MAX_ENTRIES 32
#define _POSIX_ACL_PATH_MAX ACL_MAX_ENTRIES
typedef int acl_type_t;
typedef int acl_tag_t;
typedef mode_t acl_perm_t;
struct acl_entry {
acl_tag_t ae_tag;
uid_t ae_id;
acl_perm_t ae_perm;
};
typedef struct acl_entry *acl_entry_t;
struct acl {
int acl_cnt;
struct acl_entry acl_entry[ACL_MAX_ENTRIES];
};
typedef struct acl *acl_t;
#define ACL_USER_OBJ 0x00000001
#define ACL_USER 0x00000002
#define ACL_GROUP_OBJ 0x00000004
#define ACL_GROUP 0x00000008
#define ACL_MASK 0x00000010
#define ACL_OTHER 0x00000020
#define ACL_OTHER_OBJ ACL_OTHER
#define ACL_TYPE_ACCESS 0x00000000
#define ACL_TYPE_DEFAULT 0x00000001
#define ACL_TYPE_AFS 0x00000002
#define ACL_TYPE_CODA 0x00000003
#define ACL_TYPE_NTFS 0x00000004
#define ACL_PERM_EXEC 0x0001
#define ACL_PERM_WRITE 0x0002
#define ACL_PERM_READ 0x0004
#define ACL_PERM_NONE 0x0000
#define ACL_PERM_BITS (ACL_PERM_EXEC | ACL_PERM_WRITE | ACL_PERM_READ)
#define ACL_POSIX1E_BITS (ACL_PERM_EXEC | ACL_PERM_WRITE | ACL_PERM_READ)
#ifndef _KERNEL
__BEGIN_DECLS
int __acl_aclcheck_fd(int, acl_type_t, struct acl *);
int __acl_aclcheck_file(const char *, acl_type_t, struct acl *);
int __acl_delete_fd(int, acl_type_t);
int __acl_delete_file(const char *, acl_type_t);
int __acl_get_fd(int, acl_type_t, struct acl *);
int __acl_get_file(const char *, acl_type_t, struct acl *);
int __acl_set_fd(int, acl_type_t, struct acl *);
int __acl_set_file(const char *, acl_type_t, struct acl *);
__END_DECLS
__BEGIN_DECLS
int acl_delete_fd_np(int, acl_type_t);
int acl_delete_file_np(const char *, acl_type_t);
int acl_delete_def_file(const char *);
acl_t acl_dup(acl_t);
int acl_free(void *);
acl_t acl_from_text(const char *);
acl_t acl_get_fd(int);
acl_t acl_get_fd_np(int, acl_type_t);
acl_t acl_get_file(const char *, acl_type_t);
acl_t acl_init(int);
int acl_set_fd(int, acl_t);
int acl_set_fd_np(int, acl_t, acl_type_t);
int acl_set_file(const char *, acl_type_t, acl_t);
char *acl_to_text(acl_t, ssize_t *);
int acl_valid(acl_t);
int acl_valid_fd_np(int, acl_type_t, acl_t);
int acl_valid_file_np(const char *, acl_type_t, acl_t);
__END_DECLS
#endif
#endif