---
name: "acl_create_entry"
section: "3"
platform: "macos"
package: "Libc"
version: "1752.120.2"
release: "macOS 26.5"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/acl_create_entry"
---

# acl\_create\_entry(3)

create a new ACL entry

## NAME

**acl\_create\_entry**, **acl\_create\_entry\_np** – create a new ACL entry

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

**#include \<sys/types.h\>**

**#include \<sys/acl.h\>**

*int*\

**acl\_create\_entry**(*acl\_t \*acl\_p*, *acl\_entry\_t \*entry\_p*);

*int*\

**acl\_create\_entry\_np**(*acl\_t \*acl\_p*, *acl\_entry\_t \*entry\_p*, *int entry\_index*);

## DESCRIPTION

The **acl\_create\_entry**() function is a POSIX.1e call that creates a new ACL entry in the ACL pointed to by *acl\_p*. The function will return in *entry\_p* a descriptor for this ACL entry.

The **acl\_create\_entry\_np**() function is a non-portable extension which allows the caller to specify the position of the created entry within the ACL.  If *entry\_index* is ACL\_FIRST\_ENTRY the entry will be created at the head of the ACL.  If *entry\_index* is ACL\_LAST\_ENTRY the entry will be created at the end of the ACL.  After inserting an ACL entry with an *entry\_index* other than ACL\_LAST\_ENTRY the behaviour of any acl\_entry\_t's previously obtained from the ACL by **acl\_create\_entry**() or **acl\_get\_entry**() is undefined.

## RETURN VALUES

The **acl\_create\_entry()** function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error.

## ERRORS

The **acl\_create\_entry**() and **acl\_create\_entry\_np**() functions fail if:

- \[EINVAL\]

  Argument *acl\_p* does not point to a pointer to a valid ACL.

- \[ENOMEM\]

  The ACL working storage requires more memory than is allowed by the hardware or system-imposed memory management constraints.

- \[ERANGE\]

  The *entry\_index* argument to **acl\_create\_entry\_np**() is greater than the number of entries in the ACL.

## SEE ALSO

[acl(3)](/acl/3.md), [acl\_delete\_entry(3)](/acl_delete_entry/3.md), [acl\_get\_entry(3)](/acl_get_entry/3.md), [posix1e(3)](/posix1e/3.md)

## STANDARDS

POSIX.1e is described in IEEE POSIX.1e draft 17.

## AUTHORS

Michael Smith Chris D Fulhaber
