---
name: "acl_get_entry"
section: "3"
platform: "linux"
package: "acl"
version: "2.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/acl_get_entry"
---

# acl\_get\_entry(3)

get an ACL entry

## NAME

**acl\_get\_entry** – get an ACL entry

## LIBRARY

Linux Access Control Lists library (libacl, -lacl).

## 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 obtains a descriptor for an ACL entry as specified by *entry\_id* within the ACL indicated by the argument *acl*. If the value of *entry\_id* is ACL\_FIRST\_ENTRY, then the function returns in *entry\_p* a descriptor for the first ACL entry within *acl*. If the value of  *entry\_id* is ACL\_NEXT\_ENTRY, then the function returns in *entry\_p* a descriptor for the next 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\_get\_entry**() following a call to **acl\_calc\_mask**(), **acl\_copy\_int**(), **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 effect is unspecified.

Calls to **acl\_get\_entry**() do not modify any ACL entries. Subsequent operations using the returned ACL entry descriptor operate on the ACL entry within the ACL in working storage. The order of all existing entries in the ACL remains unchanged. Any existing ACL entry descriptors that refer to entries within the ACL continue to refer to those entries. Any existing ACL pointers that refer to the ACL referred to by *acl* continue to refer to the ACL.

## RETURN VALUE

If the function successfully obtains an ACL entry, the function returns a value of 1. If the ACL has no ACL entries, the function returns the value 0. If 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**(), the function returns the value 0 until a successful call with an *entry\_id* of ACL\_FIRST\_ENTRY is made. Otherwise, the value -1 is returned and *errno* is set to indicate the error.

## ERRORS

If any of the following conditions occur, the **acl\_get\_entry**() function returns -1 and sets *errno* to the corresponding value:

- \[EINVAL\]

  The argument *acl\_p* is not a valid pointer to an ACL.

  The argument *entry\_id* is neither ACL\_NEXT\_ENTRY nor ACL\_FIRST\_ENTRY.

## STANDARDS

IEEE Std 1003.1e draft 17 (“POSIX.1e”, abandoned)

## SEE ALSO

[acl\_calc\_mask(3)](/acl_calc_mask/3.md), [acl\_create\_entry(3)](/acl_create_entry/3.md), [acl\_copy\_entry(3)](/acl_copy_entry/3.md), [acl\_delete\_entry(3)](/acl_delete_entry/3.md), [acl\_get\_file(3)](/acl_get_file/3.md), [acl(5)](/acl/5.md)

## AUTHOR

Derived from the FreeBSD manual pages written by Robert N M Watson ⟨rwatson@FreeBSD.org⟩, and adapted for Linux by Andreas Gruenbacher ⟨andreas.gruenbacher@gmail.com⟩.
