/*
 * The ACL header file /usr/include/sys/acl.h
 *
 * You should use the definitions from the following header file
 * in you ACL implementation.
 */

#ifndef _ACL_H
#define _ACL_H

/*
 * ACLs are stored as a table of acl_t structures in a single disk
 * block. The acl_flags field denotes that the ACL entry is in use,
 * and whether acl_uid contains a valid uid_t. If acl_uid is not
 * valid and the entry is in use, it is taken to be the default ACL.
 */
typedef struct acl {
    long        acl_flags;      /* acl flags */
    uid_t       acl_uid;        /* user id */
    mode_t      acl_perm;       /* permission bits */
} acl_t;

/* manifest constants */
#define NACLS   (BLOCK_SIZE/sizeof(acl_t))  /* max # of acls per file */

/* acl option definitions */
#define ACL_ADD         1       /* add new acls */
#define ACL_GET         2       /* get acls */
#define ACL_CLR         3       /* clear all acls */

/* acl type definitions */
#define ACL_USED        01      /* slot is in use */
#define ACL_UID         02      /* acl_uid contains a user id*/

/* function prototypes */
#ifndef _ANSI_H
#include <ansi.h>
#endif

_PROTOTYPE( int acl, (char *name, int option, int nacls, acl_t *acls) );

#endif /* _ACL_H */


