diff options
Diffstat (limited to 'lib/libc/sys')
28 files changed, 46 insertions, 138 deletions
diff --git a/lib/libc/sys/brk.2 b/lib/libc/sys/brk.2 index 50c8196..72e3c47 100644 --- a/lib/libc/sys/brk.2 +++ b/lib/libc/sys/brk.2 @@ -105,17 +105,14 @@ e.g.\& for the definition of .Va etext ) . .Sh RETURN VALUES -.Fn Brk -returns 0 if successful; -otherwise -1 with -.Va errno -set to indicate why the allocation failed. +.Rv -std brk +.Pp The .Fn sbrk function returns a pointer to the base of the new storage if successful; -otherwise -1 with +otherwise the value \-1 is returned and the global variable .Va errno -set to indicate why the allocation failed. +is set to indicate the error. .Sh ERRORS .Fn Brk or diff --git a/lib/libc/sys/chdir.2 b/lib/libc/sys/chdir.2 index bd969f9..8648789 100644 --- a/lib/libc/sys/chdir.2 +++ b/lib/libc/sys/chdir.2 @@ -73,11 +73,7 @@ a slash, In order for a directory to become the current directory, a process must have execute (search) access to the directory. .Sh RETURN VALUES -Upon successful completion, a value of 0 is returned. -Otherwise, a value of -1 is returned and -.Va errno -is set to indicate -the error. +.Rv -std .Sh ERRORS .Fn Chdir will fail and the current working directory will be unchanged if diff --git a/lib/libc/sys/chflags.2 b/lib/libc/sys/chflags.2 index 632e359..05205c6 100644 --- a/lib/libc/sys/chflags.2 +++ b/lib/libc/sys/chflags.2 @@ -106,10 +106,7 @@ the system is in single-user mode. .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 -.Va errno -is set to indicate the error. +.Rv -std .Sh ERRORS .Fn Chflags will fail if: diff --git a/lib/libc/sys/chmod.2 b/lib/libc/sys/chmod.2 index d003503..5a165ca 100644 --- a/lib/libc/sys/chmod.2 +++ b/lib/libc/sys/chmod.2 @@ -157,10 +157,7 @@ by protecting set-user-id (set-group-id) files from remaining set-user-id (set-group-id) if they are modified, at the expense of a degree of compatibility. .Sh RETURN VALUES -Upon successful completion, a value of 0 is returned. -Otherwise, a value of -1 is returned and -.Va errno -is set to indicate the error. +.Rv -std .Sh ERRORS .Fn Chmod will fail and the file mode will be unchanged if: diff --git a/lib/libc/sys/chown.2 b/lib/libc/sys/chown.2 index 363893a..65fd888 100644 --- a/lib/libc/sys/chown.2 +++ b/lib/libc/sys/chown.2 @@ -91,10 +91,7 @@ but does not follow symbolic links. One of the owner or group id's may be left unchanged by specifying it as -1. .Sh RETURN VALUES -Zero is returned if the operation was successful; --1 is returned if an error occurs, with a more specific -error code being placed in the global variable -.Va errno . +.Rv -std .Sh ERRORS .Fn Chown and diff --git a/lib/libc/sys/clock_gettime.2 b/lib/libc/sys/clock_gettime.2 index 5737560..633f3f9 100644 --- a/lib/libc/sys/clock_gettime.2 +++ b/lib/libc/sys/clock_gettime.2 @@ -94,10 +94,7 @@ The resolution (granularity) of a clock is returned by the call. This value is placed in a (non-NULL) .Fa *tp . .Sh RETURN VALUES -A 0 return value indicates that the call succeeded. -A -1 return value indicates an error occurred, and in this -case an error code is stored into the global variable -.Va errno . +.Rv -std .Sh ERRORS The following error codes may be set in .Va errno : diff --git a/lib/libc/sys/extattr_get_file.2 b/lib/libc/sys/extattr_get_file.2 index f22271a..bb44004 100644 --- a/lib/libc/sys/extattr_get_file.2 +++ b/lib/libc/sys/extattr_get_file.2 @@ -131,13 +131,12 @@ calls return the number of bytes that were read or written from the .Fa iovp , respectively. -The -.Fn extattr_delete_file -call returns 0 on success. If any of the calls are unsuccessful, the value \-1 is returned and the global variable .Va errno is set to indicate the error. +.Pp +.Rv -std extattr_delete_file .Sh ERRORS The following errors may be returned by the system calls themselves. Additionally, the filesystem implementing the call may return any diff --git a/lib/libc/sys/fhopen.2 b/lib/libc/sys/fhopen.2 index 6deb16a..270be1c 100644 --- a/lib/libc/sys/fhopen.2 +++ b/lib/libc/sys/fhopen.2 @@ -87,14 +87,12 @@ rather than an open file. .Sh RETURN VALUES Upon successful completion, .Fn fhopen -returns the file descriptor for the opened file, while -.Fn fhstat -and -.Fn fhstatfs -return 0. -Otherwise, -1 is returned and +returns the file descriptor for the opened file; +otherwise the value \-1 is returned and the global variable .Va errno is set to indicate the error. +.Pp +.Rv -std fhstat fhstatfs .Sh ERRORS In addition to the errors returned by .Xr open 2 , diff --git a/lib/libc/sys/getitimer.2 b/lib/libc/sys/getitimer.2 index 156caa1..e99e9a8 100644 --- a/lib/libc/sys/getitimer.2 +++ b/lib/libc/sys/getitimer.2 @@ -147,10 +147,7 @@ tests if a time value is non-zero, and .Fa timercmp compares two time values. .Sh RETURN VALUES -If the calls succeed, a value of 0 is returned. If an error occurs, -the value -1 is returned, and a more precise error code is placed -in the global variable -.Va errno . +.Rv -std .Sh ERRORS .Fn Getitimer and diff --git a/lib/libc/sys/getlogin.2 b/lib/libc/sys/getlogin.2 index 89c9211..07e54f6 100644 --- a/lib/libc/sys/getlogin.2 +++ b/lib/libc/sys/getlogin.2 @@ -139,13 +139,7 @@ if the name has not been set. .Fn getlogin_r returns zero if successful, or the error number upon failure. .Pp -If a call to -.Fn setlogin -succeeds, a value of 0 is returned. If -.Fn setlogin -fails, a value of -1 is returned and an error code is -placed in the global location -.Va errno . +.Rv -std setlogin .Sh ERRORS The following errors may be returned by these calls: .Bl -tag -width Er diff --git a/lib/libc/sys/getpriority.2 b/lib/libc/sys/getpriority.2 index efaa5ed..d156702 100644 --- a/lib/libc/sys/getpriority.2 +++ b/lib/libc/sys/getpriority.2 @@ -99,10 +99,8 @@ to clear the external variable prior to the call, then check it afterward to determine if a -1 is an error or a legitimate value. -The -.Fn setpriority -call returns 0 if there is no error, or --1 if there is. +.Pp +.Rv -std setpriority .Sh ERRORS .Fn Getpriority and diff --git a/lib/libc/sys/getrlimit.2 b/lib/libc/sys/getrlimit.2 index 9b76214..d573fbc 100644 --- a/lib/libc/sys/getrlimit.2 +++ b/lib/libc/sys/getrlimit.2 @@ -155,11 +155,7 @@ the soft cpu time limit is exceeded, a signal is sent to the offending process. .Sh RETURN VALUES -A 0 return value indicates that the call succeeded, changing -or returning the resource limit. A return value of -1 indicates -that an error occurred, and an error code is stored in the global -location -.Va errno . +.Rv -std .Sh ERRORS .Fn Getrlimit and diff --git a/lib/libc/sys/getsockopt.2 b/lib/libc/sys/getsockopt.2 index b5bc37b..c61691e 100644 --- a/lib/libc/sys/getsockopt.2 +++ b/lib/libc/sys/getsockopt.2 @@ -391,7 +391,7 @@ Before returning, unlocks .Fa s . .Sh RETURN VALUES -A 0 is returned if the call succeeds, -1 if it fails. +.Rv -std .Sh ERRORS The call succeeds unless: .Bl -tag -width Er diff --git a/lib/libc/sys/gettimeofday.2 b/lib/libc/sys/gettimeofday.2 index 06b7996..a0cb096 100644 --- a/lib/libc/sys/gettimeofday.2 +++ b/lib/libc/sys/gettimeofday.2 @@ -108,10 +108,7 @@ The system time can still be adjusted backwards using the .Xr adjtime 2 system call even when the system is secure. .Sh RETURN VALUES -A 0 return value indicates that the call succeeded. -A -1 return value indicates an error occurred, and in this -case an error code is stored into the global variable -.Va errno . +.Rv -std .Sh ERRORS The following error codes may be set in .Va errno : diff --git a/lib/libc/sys/mlock.2 b/lib/libc/sys/mlock.2 index ba2bbb1..fd92aa2 100644 --- a/lib/libc/sys/mlock.2 +++ b/lib/libc/sys/mlock.2 @@ -106,13 +106,10 @@ resource limit. .Pp These calls are only available to the super-user. .Sh RETURN VALUES -A return value of 0 indicates that the call -succeeded and all pages in the range have either been locked or unlocked. -A return value of -1 indicates an error occurred and the locked -status of all pages in the range remains unchanged. -In this case, the global location -.Va errno -is set to indicate the error. +.Rv -std +.Pp +If the call succeeds, all pages in the range become locked (unlocked); +otherwise the locked status of all pages in the range remains unchanged. .Sh ERRORS .Fn Mlock will fail if: diff --git a/lib/libc/sys/mount.2 b/lib/libc/sys/mount.2 index ef3d22d..d8f8dec 100644 --- a/lib/libc/sys/mount.2 +++ b/lib/libc/sys/mount.2 @@ -169,19 +169,7 @@ and .Xr chmod 2 pages for more information. .Sh RETURN VALUES -The -.Fn mount -returns the value 0 if the mount was successful, otherwise -1 is returned -and the variable -.Va errno -is set to indicate the error. -.Pp -The -.Fn unmount -function returns the value 0 if the umount succeeded; otherwise -1 is returned -and the variable -.Va errno -is set to indicate the error. +.Rv -std .Sh ERRORS The .Fn mount diff --git a/lib/libc/sys/rtprio.2 b/lib/libc/sys/rtprio.2 index bfd72c4..f5175ad 100644 --- a/lib/libc/sys/rtprio.2 +++ b/lib/libc/sys/rtprio.2 @@ -82,11 +82,7 @@ Higher real/idle priority processes preempt lower real/idle priority processes. Processes of equal real/idle priority are run round-robin. .Sh RETURN VALUES -.Fn rtprio -will return 0 for success and -1 for all errors. -The global variable -.Va errno -will be set to indicate the error. +.Rv -std rtprio .Sh ERRORS .Fn rtprio will fail if diff --git a/lib/libc/sys/sched_get_priority_max.2 b/lib/libc/sys/sched_get_priority_max.2 index 54095d0..82b8685 100644 --- a/lib/libc/sys/sched_get_priority_max.2 +++ b/lib/libc/sys/sched_get_priority_max.2 @@ -85,12 +85,7 @@ respectively. If unsuccessful, they shall return a value of -1 and set .Fa errno to indicate the error. .Pp -If successful, the -.Fn sched_rr_get_interval -function will return 0. Otherwise, it will -return a value of -1 and set -.Fa errno -to indicate the error. +.Rv -std sched_rr_get_interval .Sh ERRORS On failure .Va errno diff --git a/lib/libc/sys/sched_setparam.2 b/lib/libc/sys/sched_setparam.2 index 57b077f..ac9be76 100644 --- a/lib/libc/sys/sched_setparam.2 +++ b/lib/libc/sys/sched_setparam.2 @@ -134,10 +134,7 @@ function will fail if .Fa pid is negative. .Sh RETURN VALUES -The function will return zero if it completes successfully, or it -will return a value of -1 and set -.Va errno -to indicate the error. +.Rv -std .Sh ERRORS On failure .Va errno diff --git a/lib/libc/sys/sched_setscheduler.2 b/lib/libc/sys/sched_setscheduler.2 index b616e6d..556b986 100644 --- a/lib/libc/sys/sched_setscheduler.2 +++ b/lib/libc/sys/sched_setscheduler.2 @@ -129,10 +129,7 @@ function will fail if .Fa pid is negative. .Sh RETURN VALUES -The function will return zero if it completes successfully, or it -will return a value of -1 and set -.Va errno -to indicate the error. +.Rv -std .Sh ERRORS On failure .Va errno diff --git a/lib/libc/sys/setpgid.2 b/lib/libc/sys/setpgid.2 index d9178b5..30667d6 100644 --- a/lib/libc/sys/setpgid.2 +++ b/lib/libc/sys/setpgid.2 @@ -61,11 +61,7 @@ If the invoker is not the super-user, then the affected process must have the same effective user-id as the invoker or be a descendant of the invoking process. .Sh RETURN VALUES -.Fn Setpgid -returns 0 when the operation was successful. -If the request failed, -1 is returned and the global variable -.Va errno -indicates the reason. +.Rv -std setpgid .Sh ERRORS .Fn Setpgid will fail and the process group will not be altered if: diff --git a/lib/libc/sys/setresuid.2 b/lib/libc/sys/setresuid.2 index 37b44ab..d1a3b28 100644 --- a/lib/libc/sys/setresuid.2 +++ b/lib/libc/sys/setresuid.2 @@ -65,11 +65,7 @@ and calls retrieve the real, effective, and saved group and user IDs of the current process, respectively. .Sh RETURN VALUES -These functions return the value 0 if successful; -otherwise the value -1 is returned -and the global variable -.Va errno -is set to indicate the error. +.Rv -std .Sh ERRORS .Bl -tag -width Er .It Bq Er EPERM diff --git a/lib/libc/sys/setuid.2 b/lib/libc/sys/setuid.2 index 4ef4d35..3403b108 100644 --- a/lib/libc/sys/setuid.2 +++ b/lib/libc/sys/setuid.2 @@ -120,12 +120,14 @@ by reverting to the set-user-ID value. Similarly, the effective group ID may be set to the value of the real group ID or the saved set-user-ID. .Sh RETURN VALUES -Upon success, these functions return 0; -otherwise \-1 is returned. -.Pp -If the user is not the super user, or the uid -specified is not the real, effective ID, or saved ID, -these functions return \-1. +.Rv -std +.Sh ERRORS +The functions will fail if: +.Bl -tag -width Er +.It Bq Er EPERM +The user is not the super user and the ID +specified is not the real, effective ID, or saved ID. +.El .Sh SEE ALSO .Xr getgid 2 , .Xr getuid 2 , diff --git a/lib/libc/sys/shmat.2 b/lib/libc/sys/shmat.2 index 6f7dc13..63a08bc 100644 --- a/lib/libc/sys/shmat.2 +++ b/lib/libc/sys/shmat.2 @@ -85,11 +85,7 @@ is returned and .Va errno is set to indicate the error. .Pp -Upon success, -.Fn shmdt -returns 0; otherwise, -1 is returned and -.Va errno -is set to indicate the error. +.Rv -std shmdt .Sh ERRORS .Fn Shmat will fail if: diff --git a/lib/libc/sys/stat.2 b/lib/libc/sys/stat.2 index 9984a1e..50499f7 100644 --- a/lib/libc/sys/stat.2 +++ b/lib/libc/sys/stat.2 @@ -200,10 +200,7 @@ For a list of access modes, see and .Xr chmod 2 . .Sh RETURN VALUES -Upon successful completion a value of 0 is returned. -Otherwise, a value of -1 is returned and -.Va errno -is set to indicate the error. +.Rv -std .Sh COMPATIBILITY Previous versions of the system used different types for the .Li st_dev , diff --git a/lib/libc/sys/statfs.2 b/lib/libc/sys/statfs.2 index 7119d25..17e8ebe 100644 --- a/lib/libc/sys/statfs.2 +++ b/lib/libc/sys/statfs.2 @@ -125,10 +125,7 @@ Fields that are undefined for a particular file system are set to -1. returns the same information about an open file referenced by descriptor .Fa fd . .Sh RETURN VALUES -Upon successful completion, a value of 0 is returned. -Otherwise, -1 is returned and the global variable -.Va errno -is set to indicate the error. +.Rv -std .Sh ERRORS .Fn Statfs fails if one or more of the following are true: diff --git a/lib/libc/sys/truncate.2 b/lib/libc/sys/truncate.2 index fb3311f..aa6a4b6 100644 --- a/lib/libc/sys/truncate.2 +++ b/lib/libc/sys/truncate.2 @@ -65,10 +65,7 @@ With .Fn ftruncate , the file must be open for writing. .Sh RETURN VALUES -A value of 0 is returned if the call succeeds. If the call -fails a -1 is returned, and the global variable -.Va errno -specifies the error. +.Rv -std .Sh ERRORS .Fn Truncate succeeds unless: diff --git a/lib/libc/sys/utimes.2 b/lib/libc/sys/utimes.2 index 84a0a0d..1b2ef22 100644 --- a/lib/libc/sys/utimes.2 +++ b/lib/libc/sys/utimes.2 @@ -91,10 +91,7 @@ while .Fn utimes changes the times of the file the link references. .Sh RETURN VALUES -Upon successful completion, a value of 0 is returned. -Otherwise, a value of -1 is returned and -.Va errno -is set to indicate the error. +.Rv -std .Sh ERRORS .Fn utimes and |