---
name: "acl_add_perm"
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_add_perm"
---

# acl\_add\_perm(3)

add permissions to a permission set

## NAME

**acl\_add\_perm** – add permissions to a permission set

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

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

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

*int*\

**acl\_add\_perm**(*acl\_permset\_t permset\_d*, *acl\_perm\_t perm*);

## DESCRIPTION

The **acl\_add\_perm**() function is a POSIX.1e call that adds the permission contained in *perm* to the permission set *permset\_d*.

Note: it is not considered an error to attempt to add permissions that already exist in the permission set.

For POSIX.1e ACLs, valid values are:

| |
| --- |
| ACL\_EXECUTE Execute permission |
| ACL\_WRITE Write permission |
| ACL\_READ Read permission |

For NFSv4 ACLs, valid values are:

| | |
| --- | --- |
| ACL\_READ\_DATA | Read permission |
| ACL\_LIST\_DIRECTORY | Same as ACL\_READ\_DATA |
| ACL\_WRITE\_DATA | Write permission, or permission to create files |
| ACL\_ADD\_FILE | Same as ACL\_READ\_DATA |
| ACL\_APPEND\_DATA | Permission to create directories. Ignored for files |
| ACL\_ADD\_SUBDIRECTORY | Same as ACL\_APPEND\_DATA |
| ACL\_READ\_NAMED\_ATTRS | Ignored |
| ACL\_WRITE\_NAMED\_ATTRS | Ignored |
| ACL\_EXECUTE | Execute permission |
| ACL\_DELETE\_CHILD | Permission to delete files and subdirectories |
| ACL\_READ\_ATTRIBUTES | Permission to read basic attributes |
| ACL\_WRITE\_ATTRIBUTES | Permission to change basic attributes |
| ACL\_DELETE | Permission to delete the object this ACL is placed on |
| ACL\_READ\_ACL | Permission to read ACL |
| ACL\_WRITE\_ACL | Permission to change the ACL and file mode |
| ACL\_SYNCHRONIZE | Ignored |

Calling **acl\_add\_perm**() with *perm* equal to ACL\_WRITE or ACL\_READ brands the ACL as POSIX. Calling it with ACL\_READ\_DATA, ACL\_LIST\_DIRECTORY, ACL\_WRITE\_DATA, ACL\_ADD\_FILE, ACL\_APPEND\_DATA, ACL\_ADD\_SUBDIRECTORY, ACL\_READ\_NAMED\_ATTRS, ACL\_WRITE\_NAMED\_ATTRS, ACL\_DELETE\_CHILD, ACL\_READ\_ATTRIBUTES, ACL\_WRITE\_ATTRIBUTES, ACL\_DELETE, ACL\_READ\_ACL, ACL\_WRITE\_ACL or ACL\_SYNCHRONIZE brands the ACL as NFSv4.

## RETURN VALUES

The **acl\_add\_perm()** 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\_add\_perm**() function fails if:

- \[EINVAL\]

  Argument *permset\_d* is not a valid descriptor for a permission set within an ACL entry. Argument *perm* does not contain a valid *acl\_perm\_t* value. ACL is already branded differently.

## SEE ALSO

[acl(3)](/acl/3.md), [acl\_clear\_perms(3)](/acl_clear_perms/3.md), [acl\_delete\_perm(3)](/acl_delete_perm/3.md), [acl\_get\_brand\_np(3)](/acl_get_brand_np/3.md), [acl\_get\_permset(3)](/acl_get_permset/3.md), [acl\_set\_permset(3)](/acl_set_permset/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\_add\_perm**() function was added in FreeBSD 5.0.

## AUTHORS

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