---
name: "chsid"
section: "2"
platform: "linux"
package: "libselinux-dev"
version: "2002031409-4"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/chsid"
---

# chsid(2)

change security identifier of a file

## NAME

chsid, fchsid - change security identifier of a file

## SYNOPSIS

**#include \<fs\_secure.h\>**

**int chsid(const char \****path***, security\_id\_t** *sid***);**\
 **int fchsid(int** *fd***, security\_id\_t** *sid***);**

## DESCRIPTION

The SID of the file given by *path* or referenced by *fd* is changed to the value specified by the *sid* parameter.

## RETURN VALUE

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

## SEE ALSO

**stat\_secure**(2)
