acl_init() — Initialize ACL working storage

Standards

Standards / Extensions C or C++ Dependencies
z/OS® UNIX
both z/OS V1R3

Format

#define _OPEN_SYS	1
#include <sys/acl.h>

lacl_t   acl_init (int count);	

General description

Use access control lists (ACLs) in conjunction with permission bits to control access to files and directories. Currently, ACLs are supported by the HFS, TFS, and zFS file systems. You must know whether your security product supports ACLs and what rules are used when determining file access. See z/OS UNIX System Services Planning for details.

The acl_init() function allocates and initializes working storage for an ACL of at least count extended ACL entries. A pointer to the working storage is returned. The working storage allocated to contain the ACL must be freed by a call to acl_free(). The working storage contains an ACL with no ACL entries. The count must be greater than 0.

The acl_init() function initializes fields in the lacl_t it returns. When those fields are destroyed (for example, using memset or overwriting storage), the results are unpredictable. To re-use the buffer, acl_entry_delete() all extended ACL entries and set lacl_base = 0 or acl_free() the existing buffer and acl_init() for a new one.

Returned value

Upon successful completion, the function returns a pointer to the working storage.

If any of the following conditions occur, the acl_init() function returns NULL and sets errno to the corresponding value:

Error Code
Description
ENOMEM
The lacl_t to be returned requires more memory than is available.
EINVAL
The count is less than or equal to zero.

Related information