lchflags(3)

lchflags3

Set file flags

Usage

#include <sys/stat.h>

#include <unistd.h>

int

lchflags(const char *path, u_int flags);

Overview

The file whose name is given by path has its flags changed to flags. See chflags(2) for the values of the flags.

The lchflags() call is like chflags() except when the named file is a symbolic link, in which case lchflags() will change the flags of the link itself, rather than the file it points to.

Note

Instead of being a system call, lchflags() is emulated using setattrlist(2).

Return values

Upon successful completion, a value of 0 is returned. Otherwise, -1 is returned and the global variable errno is set to indicate the error.

Errors

The lchflags() call may return the same errors as setattrlist(2).

Releases

115 releases since Mac OS X 10.5; the text changed 1 time.

  1. 10.5–13.2
  2. 13.3–26.5

From Libc 1752.120.2 in macOS 26.5. Parsed by carta from the page's mdoc source.