don't use octal modes, list the #defines; describe system flag behavior
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Thu, 4 Mar 1993 12:05:17 +0000 (04:05 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Thu, 4 Mar 1993 12:05:17 +0000 (04:05 -0800)
SCCS-vsn: lib/libc/sys/chflags.2 6.8

usr/src/lib/libc/sys/chflags.2

index b8af399..2d3a2e7 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\" %sccs.include.redist.roff%
 .\"
 .\"
 .\" %sccs.include.redist.roff%
 .\"
-.\"    @(#)chflags.2   6.7 (Berkeley) %G%
+.\"    @(#)chflags.2   6.8 (Berkeley) %G%
 .\"
 .Dd 
 .Dt CHFLAGS 2
 .\"
 .Dd 
 .Dt CHFLAGS 2
@@ -28,9 +28,41 @@ or referenced by the descriptor
 has its flags changed to
 .Fa flags .
 .Pp
 has its flags changed to
 .Fa flags .
 .Pp
-Only the owner of a file (or the super-user) may change the flags.
-The owner may only change the lower 16 bits of the flags;
-the super-user may change all 32 bits of the flags.
+The flags specified are formed by
+.Em or Ns 'ing
+the following values
+.Pp
+.Bl -tag -width "SYS_IMMUTABLE" -compact -offset indent
+.It NODUMP
+Do not dump the file.
+.It USR_IMMUTABLE
+The file may not be changed.
+.It USR_APPEND
+The file may only be appended to.
+.\".It ARCHIVED
+.\"File is archived.
+.It SYS_IMMUTABLE
+The file may not be changed.
+.It SYS_APPEND
+The file may only be appended to.
+.El
+.Pp
+The
+.Dq USR_IMMUTABLE
+and
+.Dq USR_APPEND
+flags may be set or unset by either the owner of a file or the super-user.
+.Pp
+The
+.Dq SYS_IMMUTABLE
+and
+.Dq SYS_APPEND
+flags may only be set or unset by the super-user.
+They may be set at any time, but normally may only be unset when
+the system is in single-user mode.
+(See
+.Xr init 8
+for details.)
 .Sh RETURN VALUES
 Upon successful completion, a value of 0 is returned.
 Otherwise, -1 is returned and the global variable
 .Sh RETURN VALUES
 Upon successful completion, a value of 0 is returned.
 Otherwise, -1 is returned and the global variable
@@ -38,7 +70,7 @@ Otherwise, -1 is returned and the global variable
 is set to indicate the error.
 .Sh ERRORS
 .Fn Chflags
 is set to indicate the error.
 .Sh ERRORS
 .Fn Chflags
-fails if:
+will fail it:
 .Bl -tag -width Er
 .It Bq Er ENOTDIR
 A component of the path prefix is not a directory.
 .Bl -tag -width Er
 .It Bq Er ENOTDIR
 A component of the path prefix is not a directory.
@@ -86,10 +118,8 @@ An
 error occurred while reading from or writing to the file system.
 .El
 .Sh SEE ALSO
 error occurred while reading from or writing to the file system.
 .El
 .Sh SEE ALSO
-.Xr chmod 2 ,
-.Xr open 2 ,
-.Xr chown 2 ,
-.Xr stat 2
+.Xr chflags 1,
+.Xr init 8
 .Sh HISTORY
 The
 .Nm chflags
 .Sh HISTORY
 The
 .Nm chflags