avc\_compute\_create(3) SELinux API documentation avc\_compute\_create(3)

# [NAME](#NAME)

avc\_compute\_create, avc\_compute\_member - obtain SELinux label for new object

# [SYNOPSIS](#SYNOPSIS)

**#include &lt;selinux/selinux.h&gt;**  
**#include &lt;selinux/avc.h&gt;**

**int avc\_compute\_create(security\_id\_t ssid, security\_id\_t tsid,**  
**security\_class\_t tclass, security\_id\_t \*newsid);**

**int avc\_compute\_member(security\_id\_t ssid, security\_id\_t tsid,**  
**security\_class\_t tclass, security\_id\_t \*newsid);**

# [DESCRIPTION](#DESCRIPTION)

**avc\_compute\_create**() is used to compute a SID to use for labeling a new object in a particular class based on a SID pair. This call is identical to **security\_compute\_create**(), but does not require converting from userspace SID's to contexts and back again.

**avc\_compute\_member**() is used to compute a SID to use for labeling a polyinstantiated object instance of a particular class based on a SID pair. This call is identical to **security\_compute\_member**(), but does not require converting from userspace SID's to contexts and back again.

These functions return a SID for the computed context in the memory referenced by *sid*.

# [RETURN VALUE](#RETURN_VALUE)

On success, zero is returned. On error, -1 is returned and *errno* is set appropriately.

# [ERRORS](#ERRORS)

[**EINVAL**](#EINVAL)

The *tclass* and/or the security contexts referenced by *ssid* and *tsid* are not recognized by the currently loaded policy.

[**ENOMEM**](#ENOMEM)

An attempt to allocate memory failed.

# [AUTHOR](#AUTHOR)

Eamon Walsh &lt;ewalsh@tycho.nsa.gov&gt;

# [SEE ALSO](#SEE_ALSO)

[**avc\_init**(3)](/man/os/libselinux/avc_init.3), [**avc\_context\_to\_sid**(3)](/man/os/libselinux/avc_context_to_sid.3), [**security\_compute\_create**(3)](/man/os/libselinux/security_compute_create.3), [**selinux**(8)](/man/os/libselinux/selinux.8)

30 Mar 2007

---

Document: avc_compute_create(3) from libselinux 3.11-r2 (Chainguard OS)
Source: https://github.com/SELinuxProject/selinux.git
