---
name: "acl_get_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_get_entry"
---

# acl\_get\_entry(3)

retrieve an ACL entry from an ACL

## NAME

**acl\_get\_entry** – retrieve an ACL entry from an ACL

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

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

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

*int*\

**acl\_get\_entry**(*acl\_t acl*, *int entry\_id*, *acl\_entry\_t \*entry\_p*);

## DESCRIPTION

The **acl\_get\_entry**() function is a POSIX.1e call that retrieves a descriptor for an ACL entry specified by the argument *entry\_id* within the ACL indicated by the argument *acl*.

If the value of *entry\_id* is ACL\_FIRST\_ENTRY, then the function will return in *entry\_p* a descriptor for the first ACL entry within *acl*. If a call is made to **acl\_get\_entry**() with *entry\_id* set to ACL\_NEXT\_ENTRY when there has not been either an initial successful call to **acl\_get\_entry**(), or a previous successful call to **acl\_create\_entry**(), **acl\_delete\_entry**(), **acl\_dup**(), **acl\_from\_text**(), **acl\_get\_fd**(), **acl\_get\_file**(), **acl\_set\_fd**(), **acl\_set\_file**(), or **acl\_valid**(), then the result is unspecified.

The caller may also set *entry\_id* to the index of the desired entry within the ACL.  This is a non-portable extension.  A subsequent call with *entry\_id* set to ACL\_NEXT\_ENTRY will return the entry following the previously nominated entry and so forth.

## RETURN VALUES

If the **acl\_get\_entry**() function successfully obtains an ACL entry, a value of 0 is returned. Otherwise, a value of -1 will be returned and the global variable *errno* will be set to indicate the error.

## ERRORS

The **acl\_get\_entry**() function fails if:

- \[EINVAL\]

  Argument *acl* does not point to a valid ACL. Argument *entry\_id* is neither ACL\_FIRST\_ENTRY, ACL\_NEXT\_ENTRY or a valid entry index.

- \[EINVAL\]

  The value of *entry\_id* is ACL\_NEXT\_ENTRY and the last ACL entry in the ACL has already been returned by a previous call to **acl\_get\_entry**().

## SEE ALSO

[acl(3)](/acl/3.md), [acl\_calc\_mask(3)](/acl_calc_mask/3.md), [acl\_create\_entry(3)](/acl_create_entry/3.md), [acl\_delete\_entry(3)](/acl_delete_entry/3.md), [acl\_dup(3)](/acl_dup/3.md), [acl\_from\_text(3)](/acl_from_text/3.md), [acl\_get\_fd(3)](/acl_get_fd/3.md), [acl\_get\_file(3)](/acl_get_file/3.md), [acl\_init(3)](/acl_init/3.md), [acl\_set\_fd(3)](/acl_set_fd/3.md), [acl\_set\_file(3)](/acl_set_file/3.md), [acl\_valid(3)](/acl_valid/3.md), [posix1e(3)](/posix1e/3.md)

## STANDARDS

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

## AUTHORS

Michael Smith Chris D. Faulhaber
