---
name: "avc_compute_create"
section: "3"
platform: "linux"
package: "libselinux1-dev"
version: "3.8.1-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/avc_compute_create"
---

# avc\_compute\_create(3)

obtain SELinux label for new object

## NAME

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

## SYNOPSIS

**#include \<selinux/selinux.h\>**\
 **#include \<selinux/avc.h\>**

**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

**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

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

## ERRORS

- **EINVAL**

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

- **ENOMEM**

  An attempt to allocate memory failed.

## AUTHOR

Eamon Walsh \<ewalsh@tycho.nsa.gov\>

## SEE ALSO

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