diff options
Diffstat (limited to 'lib/libc/sys')
-rw-r--r-- | lib/libc/sys/accept.2 | 3 | ||||
-rw-r--r-- | lib/libc/sys/chmod.2 | 15 | ||||
-rw-r--r-- | lib/libc/sys/connect.2 | 3 | ||||
-rw-r--r-- | lib/libc/sys/execve.2 | 3 | ||||
-rw-r--r-- | lib/libc/sys/fcntl.2 | 3 | ||||
-rw-r--r-- | lib/libc/sys/fhopen.2 | 6 | ||||
-rw-r--r-- | lib/libc/sys/intro.2 | 12 | ||||
-rw-r--r-- | lib/libc/sys/lseek.2 | 3 | ||||
-rw-r--r-- | lib/libc/sys/mmap.2 | 18 | ||||
-rw-r--r-- | lib/libc/sys/msync.2 | 6 | ||||
-rw-r--r-- | lib/libc/sys/pipe.2 | 3 | ||||
-rw-r--r-- | lib/libc/sys/read.2 | 9 | ||||
-rw-r--r-- | lib/libc/sys/reboot.2 | 3 | ||||
-rw-r--r-- | lib/libc/sys/rfork.2 | 6 | ||||
-rw-r--r-- | lib/libc/sys/rtprio.2 | 15 | ||||
-rw-r--r-- | lib/libc/sys/sendfile.2 | 12 | ||||
-rw-r--r-- | lib/libc/sys/sigaction.2 | 3 | ||||
-rw-r--r-- | lib/libc/sys/sync.2 | 3 | ||||
-rw-r--r-- | lib/libc/sys/write.2 | 6 |
19 files changed, 88 insertions, 44 deletions
diff --git a/lib/libc/sys/accept.2 b/lib/libc/sys/accept.2 index 384823e..e716261 100644 --- a/lib/libc/sys/accept.2 +++ b/lib/libc/sys/accept.2 @@ -150,7 +150,8 @@ for read and write, then calls .Fn _thread_sys_accept . If the call to .Fn _thread_sys_accept -would block, a context switch is performed. Before returning, +would block, a context switch is performed. +Before returning, .Fn accept unlocks .Va s . diff --git a/lib/libc/sys/chmod.2 b/lib/libc/sys/chmod.2 index 87e171f..87e0098 100644 --- a/lib/libc/sys/chmod.2 +++ b/lib/libc/sys/chmod.2 @@ -116,7 +116,8 @@ If mode .Dv ISVTX (the `sticky bit') is set on a directory, an unprivileged user may not delete or rename -files of other users in that directory. The sticky bit may be +files of other users in that directory. +The sticky bit may be set by any user on a directory which the user owns or has appropriate permissions. For more details of the properties of the sticky bit, see @@ -129,15 +130,19 @@ created within this directory are set to be the same as the owner of that directory. If this function is enabled, new directories will inherit the bit from their parents. Execute bits are removed from -the file, and it will not be given to root. This behavior does not change the +the file, and it will not be given to root. +This behavior does not change the requirements for the user to be allowed to write the file, but only the eventual -owner after it has been created. Group inheritance is not effected. +owner after it has been created. +Group inheritance is not effected. .Pp This feature is designed for use on fileservers serving PC users via -ftp, SAMBA, or netatalk. It provides security holes for shell users and as +ftp, SAMBA, or netatalk. +It provides security holes for shell users and as such should not be used on shell machines, especially on home directories. This option requires the SUIDDIR -option in the kernel to work. Only UFS filesystems support this option. +option in the kernel to work. +Only UFS filesystems support this option. For more details of the suiddir mount option, see .Xr mount 8 . .Pp diff --git a/lib/libc/sys/connect.2 b/lib/libc/sys/connect.2 index aef52f1..8885e72 100644 --- a/lib/libc/sys/connect.2 +++ b/lib/libc/sys/connect.2 @@ -89,7 +89,8 @@ for read and write, then calls .Fn _thread_sys_connect . If the call to .Fn _thread_sys_connect -would block, a context switch is performed. Before returning, +would block, a context switch is performed. +Before returning, .Fn connect unlocks .Va s . diff --git a/lib/libc/sys/execve.2 b/lib/libc/sys/execve.2 index 2adc7c9..3e35f42 100644 --- a/lib/libc/sys/execve.2 +++ b/lib/libc/sys/execve.2 @@ -117,7 +117,8 @@ Descriptors that remain open are unaffected by .Pp Signals set to be ignored in the calling process are set to be ignored in the -new process. Signals which are set to be caught in the calling process image +new process. +Signals which are set to be caught in the calling process image are set to default action in the new process image. Blocked signals remain blocked regardless of changes to the signal action. The signal stack is reset to be undefined (see diff --git a/lib/libc/sys/fcntl.2 b/lib/libc/sys/fcntl.2 index 97236fe..ee38c33 100644 --- a/lib/libc/sys/fcntl.2 +++ b/lib/libc/sys/fcntl.2 @@ -263,7 +263,8 @@ but may not start or extend before the beginning of the file. A lock is set to extend to the largest possible value of the file offset for that file if .Fa l_len -is set to zero. If +is set to zero. +If .Fa l_whence and .Fa l_start diff --git a/lib/libc/sys/fhopen.2 b/lib/libc/sys/fhopen.2 index 6265771..d82e26f 100644 --- a/lib/libc/sys/fhopen.2 +++ b/lib/libc/sys/fhopen.2 @@ -61,13 +61,15 @@ opens the file referenced by .Fa fhp for reading and/or writing as specified by the argument .Fa flags -and returns the file descriptor to the calling process. The +and returns the file descriptor to the calling process. +The .Fa flags are specified by .Em or Ns 'ing together the flags used for the .Xr open 2 -call. All said flags are valid except for +call. +All said flags are valid except for .Dv O_CREAT . .Pp .Fn fhstat diff --git a/lib/libc/sys/intro.2 b/lib/libc/sys/intro.2 index fd978ca..b43b9c8 100644 --- a/lib/libc/sys/intro.2 +++ b/lib/libc/sys/intro.2 @@ -49,7 +49,8 @@ their error returns, and other common definitions and concepts. .\"<more later...> .Sh RETURN VALUES Nearly all of the system calls provide an error number referenced via -the external identifier errno. This identifier is defined in +the external identifier errno. +This identifier is defined in .Aq Pa sys/errno.h as .Pp @@ -59,7 +60,8 @@ as The .Va __error() function returns a pointer to a field in the thread specific structure for -threads other than the initial thread. For the initial thread and +threads other than the initial thread. +For the initial thread and non-threaded processes, .Va __error() returns a pointer to a global @@ -104,7 +106,8 @@ An asynchronous signal (such as or .Dv SIGQUIT ) was caught by the process during the execution of an interruptible -function. If the signal handler performs a normal return, the +function. +If the signal handler performs a normal return, the interrupted function call will seem to have returned the error condition. .It Er 5 EIO Em "Input/output error" . Some physical input or output error occurred. @@ -264,7 +267,8 @@ A message sent on a socket was larger than the internal message buffer or some other network limit. .It Er 41 EPROTOTYPE Em "Protocol wrong type for socket" . A protocol was specified that does not support the semantics of the -socket type requested. For example, you cannot use the +socket type requested. +For example, you cannot use the .Tn ARPA Internet .Tn UDP diff --git a/lib/libc/sys/lseek.2 b/lib/libc/sys/lseek.2 index aaccac7..83ed0cd 100644 --- a/lib/libc/sys/lseek.2 +++ b/lib/libc/sys/lseek.2 @@ -92,7 +92,8 @@ bytes. The .Fn lseek function allows the file offset to be set beyond the end -of the existing end-of-file of the file. If data is later written +of the existing end-of-file of the file. +If data is later written at this point, subsequent reads of the data in the gap return bytes of zeros (until data is actually written into the gap). .Pp diff --git a/lib/libc/sys/mmap.2 b/lib/libc/sys/mmap.2 index 185b7b8..cffccf8 100644 --- a/lib/libc/sys/mmap.2 +++ b/lib/libc/sys/mmap.2 @@ -133,9 +133,12 @@ Modifications are private. Modifications are shared. .It Dv MAP_STACK This option is only available if your system has been compiled with -VM_STACK defined when compiling the kernel. This is the default for -i386 only. Consider adding -DVM_STACK to COPTFLAGS in your /etc/make.conf -to enable this option for other architechures. MAP_STACK implies +VM_STACK defined when compiling the kernel. +This is the default for +i386 only. +Consider adding -DVM_STACK to COPTFLAGS in your /etc/make.conf +to enable this option for other architechures. +MAP_STACK implies MAP_ANON, and .Fa offset of 0. @@ -274,16 +277,19 @@ is limited to 2GB. Mmapping slightly more than 2GB doesn't work, but it is possible to map a window of size (filesize % 2GB) for file sizes of slightly less than 2G, 4GB, 6GB and 8GB. .Pp -The limit is imposed for a variety of reasons. Most of them have to do +The limit is imposed for a variety of reasons. +Most of them have to do with .Tn FreeBSD not wanting to use 64 bit offsets in the VM system due to -the extreme performance penalty. So +the extreme performance penalty. +So .Tn FreeBSD uses 32bit page indexes and this gives .Tn FreeBSD -a maximum of 8TB filesizes. It's actually bugs in +a maximum of 8TB filesizes. +It's actually bugs in the filesystem code that causes the limit to be further restricted to 1TB (loss of precision when doing blockno calculations). .Pp diff --git a/lib/libc/sys/msync.2 b/lib/libc/sys/msync.2 index 24e33e8..d0b5345 100644 --- a/lib/libc/sys/msync.2 +++ b/lib/libc/sys/msync.2 @@ -71,7 +71,8 @@ MS_INVALIDATE Invalidate all cached data .Ed .Sh RETURN VALUES If any errors occur, -1 is returned and errno is set to indicate the -error. Otherwise, a 0 value is returned. +error. +Otherwise, a 0 value is returned. .Sh ERRORS .Fn msync will fail if: @@ -84,7 +85,8 @@ is not a multiple of the hardware page size. is too large or negative. .It Bq Er EINVAL .Fa flags -was both MS_ASYNC and MS_INVALIDATE. Only one of these flags is allowed. +was both MS_ASYNC and MS_INVALIDATE. +Only one of these flags is allowed. .It Bq Er EIO An I/O error occurred while writing to the file system. .Sh SEE ALSO diff --git a/lib/libc/sys/pipe.2 b/lib/libc/sys/pipe.2 index 1151505..98f53aa 100644 --- a/lib/libc/sys/pipe.2 +++ b/lib/libc/sys/pipe.2 @@ -86,7 +86,8 @@ portable to older systems, so it is recommended to use the convention for using the endpoints in the traditional manner when using a pipe in one direction. .Sh RETURN VALUES -On successful creation of the pipe, zero is returned. Otherwise, +On successful creation of the pipe, zero is returned. +Otherwise, a value of -1 is returned and the variable .Va errno set to indicate the diff --git a/lib/libc/sys/read.2 b/lib/libc/sys/read.2 index b8c451d..16fe7284 100644 --- a/lib/libc/sys/read.2 +++ b/lib/libc/sys/read.2 @@ -135,7 +135,8 @@ for read, then calls .Fn _thread_sys_read . If the call to .Fn _thread_sys_read -would block, a context switch is performed. Before returning, +would block, a context switch is performed. +Before returning, .Fn read unlocks .Va d . @@ -158,13 +159,15 @@ for read, then calls .Fn _thread_sys_readv . If the call to .Fn _thread_sys_readv -would block, a context switch is performed. Before returning, +would block, a context switch is performed. +Before returning, .Fn readv unlocks .Va d . .Sh RETURN VALUES If successful, the -number of bytes actually read is returned. Upon reading end-of-file, +number of bytes actually read is returned. +Upon reading end-of-file, zero is returned. Otherwise, a -1 is returned and the global variable .Va errno diff --git a/lib/libc/sys/reboot.2 b/lib/libc/sys/reboot.2 index 00d750c..85a6717 100644 --- a/lib/libc/sys/reboot.2 +++ b/lib/libc/sys/reboot.2 @@ -84,7 +84,8 @@ the processor is simply halted; no reboot takes place. This option should be used with caution. .It Dv RB_POWEROFF After halting, the shutdown code will do what it can to turn -of the power. This requires hardware support. +of the power. +This requires hardware support. .It Dv RB_INITNAME An option allowing the specification of an init program (see .Xr init 8 ) diff --git a/lib/libc/sys/rfork.2 b/lib/libc/sys/rfork.2 index c5825cb..b9b5aa7 100644 --- a/lib/libc/sys/rfork.2 +++ b/lib/libc/sys/rfork.2 @@ -37,7 +37,8 @@ If set a new process is created; otherwise changes affect the current process. The current implementation requires this flag to always be set. .It RFNOWAIT -If set, the child process will be dissociated from the parent. Upon +If set, the child process will be dissociated from the parent. +Upon exit the child will not leave a status for the parent to collect. See .Xr wait 2 . @@ -53,7 +54,8 @@ Is mutually exclusive with .It RFMEM If set, the kernel will force sharing of the entire address space. The child -will then inherit all the shared segments the parent process owns. Other segment +will then inherit all the shared segments the parent process owns. +Other segment types will be unaffected. Subsequent forks by the parent will then propagate the shared data and bss between children. The stack segment is always split. May be set only with diff --git a/lib/libc/sys/rtprio.2 b/lib/libc/sys/rtprio.2 index 579ed1b..3ee2a91 100644 --- a/lib/libc/sys/rtprio.2 +++ b/lib/libc/sys/rtprio.2 @@ -44,7 +44,8 @@ is used to lookup or change the realtime or idle priority of a process. .Fa function -specifies the operation to be performed. RTP_LOOKUP to lookup the current priority, +specifies the operation to be performed. +RTP_LOOKUP to lookup the current priority, and RTP_SET to set the priority. .Fa pid specifies the process to be used, 0 for the current process. @@ -73,11 +74,14 @@ Realtime and idle priority is inherited through fork() and exec(). A realtime process can only be preempted by a process of equal or higher priority, or by an interrupt; idle priority processes will run only -when no other real/normal priority process is runnable. Higher real/idle priority processes -preempt lower real/idle priority processes. Processes of equal real/idle priority are run round-robin. +when no other real/normal priority process is runnable. +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 +will return 0 for success and -1 for all errors. +The global variable .Va errno will be set to indicate the error. .Sh ERRORS @@ -89,7 +93,8 @@ The specified .Fa prio was out of range. .It Bq Er EPERM -The calling process is not allowed to set the realtime priority. Only +The calling process is not allowed to set the realtime priority. +Only root is allowed to change the realtime priority of any process, and non-root may only change the idle priority of the current process. .It Bq Er ESRCH diff --git a/lib/libc/sys/sendfile.2 b/lib/libc/sys/sendfile.2 index 87b9bac..254f1630 100644 --- a/lib/libc/sys/sendfile.2 +++ b/lib/libc/sys/sendfile.2 @@ -46,7 +46,8 @@ out a stream socket specified by descriptor .Pp The .Fa offset -argument specifies where to begin in the file. The +argument specifies where to begin in the file. +The .Fa nbytes argument specifies how many bytes of the file should be sent, with 0 having the special meaning of send until the end of file has been reached. @@ -67,9 +68,11 @@ The .Fa headers and .Fa tailers -pointers, if non-NULL, point to arrays of struct iovec structures. See the +pointers, if non-NULL, point to arrays of struct iovec structures. +See the .Fn writev -system call for information on the iovec structure. The number of iovecs in these +system call for information on the iovec structure. +The number of iovecs in these arrays is specified by .Fa hdr_cnt and @@ -85,7 +88,8 @@ argument is currently undefined and should be specified as 0. .Pp When using a socket marked for non-blocking I/O, .Fn sendfile -may send fewer bytes than requested. In this case, the number of bytes successfully +may send fewer bytes than requested. +In this case, the number of bytes successfully written is returned in .Fa *sbytes (if specified), diff --git a/lib/libc/sys/sigaction.2 b/lib/libc/sys/sigaction.2 index c3c41f7..efddfc5 100644 --- a/lib/libc/sys/sigaction.2 +++ b/lib/libc/sys/sigaction.2 @@ -320,7 +320,8 @@ or Any attempt to do so will be silently ignored. .Pp The following functions are either reentrant or not interruptible -by signals and are async-signal safe. Therefore applications may +by signals and are async-signal safe. +Therefore applications may invoke them, without restriction, from signal-catching functions: .Pp Base Interfaces: diff --git a/lib/libc/sys/sync.2 b/lib/libc/sys/sync.2 index a989e8d5..68acbb9 100644 --- a/lib/libc/sys/sync.2 +++ b/lib/libc/sys/sync.2 @@ -47,7 +47,8 @@ The .Fn sync function forces a write of dirty (modified) buffers in the block buffer cache out -to disk. The kernel keeps this information in core to reduce +to disk. +The kernel keeps this information in core to reduce the number of disk I/O transfers required by the system. As information in the cache is lost after a system crash a .Fn sync diff --git a/lib/libc/sys/write.2 b/lib/libc/sys/write.2 index ab5d236..0f4693f 100644 --- a/lib/libc/sys/write.2 +++ b/lib/libc/sys/write.2 @@ -142,7 +142,8 @@ for read and write, then calls .Fn _thread_sys_write . If the call to .Fn _thread_sys_write -would block, a context switch is performed. Before returning, +would block, a context switch is performed. +Before returning, .Fn write unlocks .Va d . @@ -165,7 +166,8 @@ for read and write, then calls .Fn _thread_sys_writev . If the call to .Fn _thread_sys_writev -would block, a context switch is performed. Before returning, +would block, a context switch is performed. +Before returning, .Fn writev unlocks .Va d . |