X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/55e303ae13a4cf49d70f2294092726f2fffb9ef2..935ed37a5c468c8a1c07408573c08b8b7ef80e8b:/bsd/man/man2/chmod.2 diff --git a/bsd/man/man2/chmod.2 b/bsd/man/man2/chmod.2 index bc34d2417..69002be40 100644 --- a/bsd/man/man2/chmod.2 +++ b/bsd/man/man2/chmod.2 @@ -44,9 +44,15 @@ .Fd #include .Fd #include .Ft int -.Fn chmod "const char *path" "mode_t mode" +.Fo chmod +.Fa "const char *path" +.Fa "mode_t mode" +.Fc .Ft int -.Fn fchmod "int fd" "mode_t mode" +.Fo fchmod +.Fa "int fildes" +.Fa "mode_t mode" +.Fc .Sh DESCRIPTION The function .Fn chmod @@ -59,13 +65,13 @@ to .Fn Fchmod sets the permission bits of the specified file descriptor -.Fa fd . +.Fa fildes . .Fn Chmod verifies that the process owner (user) either owns the file specified by .Fa path (or -.Fa fd ) , +.Fa fildes ) , or is the super-user. A mode is created from @@ -126,53 +132,91 @@ Otherwise, a value of -1 is returned and .Va errno is set to indicate the error. .Sh ERRORS -.Fn Chmod -will fail and the file mode will be unchanged if: +The +.Fn chmod +system call will fail and the file mode will be unchanged if: .Bl -tag -width Er -.It Bq Er ENOTDIR -A component of the path prefix is not a directory. +.\" ========== +.It Bq Er EACCES +Search permission is denied for a component of the path prefix. +.\" ========== +.It Bq Er EFAULT +.Fa Path +points outside the process's allocated address space. +.\" ========== +.It Bq Er EINTR +Its execution was interrupted by a signal. +.\" ========== +.It Bq Er EIO +An I/O error occurred while reading from or writing to the file system. +.\" ========== +.It Bq Er ELOOP +Too many symbolic links were encountered in translating the pathname. +This is taken to be indicative of a looping symbolic link. +.\" ========== .It Bq Er ENAMETOOLONG A component of a pathname exceeded .Dv {NAME_MAX} characters, or an entire path name exceeded .Dv {PATH_MAX} characters. +.\" ========== .It Bq Er ENOENT The named file does not exist. -.It Bq Er EACCES -Search permission is denied for a component of the path prefix. -.It Bq Er ELOOP -Too many symbolic links were encountered in translating the pathname. +.\" ========== +.It Bq Er ENOTDIR +A component of the path prefix is not a directory. +.\" ========== .It Bq Er EPERM The effective user ID does not match the owner of the file and the effective user ID is not the super-user. +.\" ========== .It Bq Er EROFS The named file resides on a read-only file system. -.It Bq Er EFAULT -.Fa Path -points outside the process's allocated address space. -.It Bq Er EIO -An I/O error occurred while reading from or writing to the file system. .El .Pp -.Fn Fchmod +.Fn fchmod will fail if: .Bl -tag -width Er +.\" ========== .It Bq Er EBADF -The descriptor is not valid. +.Fa fildes +is not a valid file descriptor. +.\" ========== .It Bq Er EINVAL -.Fa fd +.Fa fildes refers to a socket, not to a file. -.It Bq Er EROFS -The file resides on a read-only file system. +.\" ========== +.It Bq Er EINVAL +.Fa mode +is not a valid file mode. +.\" ========== +.It Bq Er EINTR +Its execution was interrupted by a signal. +.\" ========== .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.\" ========== +.It Bq Er EPERM +The effective user ID does not match the owner of the file and +the effective user ID is not the super-user. +.\" ========== +.It Bq Er EROFS +The file resides on a read-only file system. .El +.Sh LEGACY SYNOPSIS +.Fd #include +.Fd #include +.Pp +The include file +.In sys/types.h +is necessary. .Sh SEE ALSO .Xr chmod 1 , -.Xr open 2 , .Xr chown 2 , +.Xr open 2 , .Xr stat 2 , +.Xr compat 5 , .Xr sticky 8 .Sh STANDARDS The