1.Dd Oct 31, 2005
2.Dt LCHFLAGS 3
3.Os
4.Sh NAME
5.Nm lchflags
6.Nd set file flags
7.Sh SYNOPSIS
8.In sys/stat.h
9.In unistd.h
10.Ft int
11.Fn lchflags "const char *path" "u_int flags"
12.Sh DESCRIPTION
13The file whose name is given by
14.Fa path
15has its flags changed to
16.Fa flags .
17See
18.Xr chflags 2
19for the values of the
20.Fa flags .
21.Pp
22The
23.Fn lchflags
24call is like
25.Fn chflags
26except when the named file is a symbolic link,
27in which case
28.Fn lchflags
29will change the flags of the link itself,
30rather than the file it points to.
31.Sh NOTE
32Instead of being a system call,
33.Fn lchflags
34is emulated using
35.Xr setattrlist 2 .
36Not all file systems support
37.Xr setattrlist 2 .
38.Sh RETURN VALUES
39Upon successful completion, a value of 0 is returned.
40Otherwise, -1 is returned and the global variable
41.Va errno
42is set to indicate the error.
43.Sh ERRORS
44The
45.Fn lchflags
46call may return the same errors as
47.Xr chflags 2
48and
49.Xr setattrlist 2 .
50.Sh SEE ALSO
51.Xr chflags 2 ,
52.Xr setattrlist 2
53