---
name: "acl_get_entry"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
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.

## RETURN VALUES

If the **acl\_get\_entry**() function successfully obtains an ACL entry, a value of 1 is returned. If the ACL has no ACL entries, the **acl\_get\_entry**() returns a value of 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**(), a value of 0 will be returned until a successful call with *entry\_id* of ACL\_FIRST\_ENTRY is made. 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 nor ACL\_NEXT\_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.

## HISTORY

POSIX.1e support was introduced in FreeBSD 4.0. The **acl\_get\_entry**() function was added in FreeBSD 5.0.

## AUTHORS

The **acl\_get\_entry**() function was written by Chris D. Faulhaber ⟨*jedgar@fxp.org*⟩.
