summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys
Commit message (Collapse)AuthorAgeFilesLines
* sigsuspend(2): Add xrefs to pselect(2) and sigwait-alikes.jilles2013-08-151-1/+5
|
* Enhance the description of NOTE_TRACK:jhb2013-07-251-6/+11
| | | | | | | | | | | | | | - NOTE_TRACK has never triggered a NOTE_TRACK event from the parent pid. If NOTE_FORK is set, the listener will get a NOTE_FORK event from the parent pid, but not a separate NOTE_TRACK event. - Explicitly note that the event added to monitor the child process preserves the fflags from the original event. - Move the description of NOTE_TRACKERR under NOTE_TRACK as it is not a bit for the user to set (which is what this list pupports to be). Also, explicitly note that if an error occurs, the NOTE_CHILD event will not be generated. MFC after: 1 week
* Document EINVAL error return from PT_LWPINFOemaste2013-07-221-1/+9
|
* Minor mdoc fixes.joel2013-06-091-3/+3
|
* sigaction(2): Document various non-POSIX functions as async-signal safe.jilles2013-06-081-2/+15
|
* Add new system call - aio_mlock(). The name speaks for itself. It allowsglebius2013-06-083-0/+135
| | | | | | | | to perform the mlock(2) operation, which can consume a lot of time, under control of aio(4). Reviewed by: kib, jilles Sponsored by: Nginx, Inc.
* dup(2): Clarify return value, in particular of dup2().jilles2013-05-311-4/+5
|
* sigaction(2): *at system calls are async-signal safe.jilles2013-05-311-0/+14
|
* sigaction(2): Extend description of async-signal safe functions:jilles2013-05-311-13/+108
| | | | | * Improve description when unsafe functions are unsafe. * Add various safe functions from POSIX.1-2008 and Austin Group issue #692.
* fork(2): Add information about fork() in multi-threaded processes.jilles2013-05-311-0/+12
| | | | | There is nothing about pthread_atfork(3) or extensions like calling malloc(3) in the child process as this may be unreliable or broken.
* fork(2): #include <sys/types.h> is not needed.jilles2013-05-311-2/+1
|
* Remove the advertising clause from the Regents of the University ofemaste2013-05-283-15/+3
| | | | California's license, per the letter dated July 22, 1999.
* cap_rights_limit(2): CAP_ACCEPT also permits accept4(2).jilles2013-05-271-1/+3
|
* sigreturn(2): Remove ancient compatibility warning about 4.2BSD.jilles2013-05-251-4/+0
| | | | The HISTORY subsection still says that sigreturn() was added in 4.3BSD.
* Update the setfib man page to reflect recent changes.julian2013-05-201-3/+6
|
* POSIX 1003.1-2008: add ENOTRECOVERABLE, EOWNERDEAD errnos.pluknet2013-05-041-1/+5
|
* accept(2), pipe(2): Fix .Dd.jilles2013-05-012-2/+2
|
* Add pipe2() system call.jilles2013-05-013-2/+46
| | | | | | | | | | | | | The pipe2() function is similar to pipe() but allows setting FD_CLOEXEC and O_NONBLOCK (on both sides) as part of the function. If p points to two writable ints, pipe2(p, 0) is equivalent to pipe(p). If the pointer is not valid, behaviour differs: pipe2() writes into the array from the kernel like socketpair() does, while pipe() writes into the array from an architecture-specific assembler wrapper. Reviewed by: kan, kib
* Add accept4() system call.jilles2013-05-013-3/+46
| | | | | | | | | | | | | | | The accept4() function, compared to accept(), allows setting the new file descriptor atomically close-on-exec and explicitly controlling the non-blocking status on the new socket. (Note that the latter point means that accept() is not equivalent to any form of accept4().) The linuxulator's accept4 implementation leaves a race window where the new file descriptor is not close-on-exec because it calls sys_accept(). This implementation leaves no such race window (by using falloc() flags). The linuxulator could be fixed and simplified by using the new code. Like accept(), accept4() is async-signal-safe, a cancellation point and permitted in capability mode.
* intro(2): Fix some errors in ENFILE and EMFILE descriptions.jilles2013-04-271-5/+6
| | | | MFC after: 1 week
* getdtablesize(2): Describe what this function actually does.jilles2013-04-241-9/+11
| | | | | | | getdtablesize() returns the limit on new file descriptors; this says nothing about existing descriptors. MFC after: 1 week
* Keep up with negative addrlen check removal in r249649.pluknet2013-04-221-5/+1
|
* dup(2): Remove incorrect sentence about getdtablesize().jilles2013-04-211-4/+1
| | | | | | | | | There are no getdtablesize() bounds on the file descriptor to be duplicated; it only has to be open. If the RLIMIT_NOFILE rlimit was decreased after opening the file descriptor, it may be greater than or equal to getdtablesize() but still valid. MFC after: 1 week
* Remove cross-references to nonexistent CPU_SET(3) manpage.joel2013-04-212-4/+2
| | | | | | | Also fix cpu_getaffinity(2) document title. PR: 176317 Submitted by: brucec
* Correct the returned message lengths for timeval and bintime controlgnn2013-04-051-3/+3
| | | | | | messages (SO_BINTIME, SO_TIMEVAL). Obtained from: phk
* Fix return type of extattr_set_* and fix rmextattr(8) utility.mdf2013-04-021-3/+3
| | | | | | | | | extattr_set_{fd,file,link} is logically a write(2)-like operation and should return ssize_t, just like extattr_get_*. Also, the user-space utility was using an int for the return value of extattr_get_* and extattr_list_*, both of which return an ssize_t. MFC after: 1 week
* accept(2): Mention inheritance of O_ASYNC and signal destination.jilles2013-03-261-3/+13
| | | | | | While almost nobody uses O_ASYNC, and rightly so, the inheritance of the related properties across accept() is a portability issue like the inheritance of O_NONBLOCK.
* Document chflagsat(2).pjd2013-03-213-3/+54
| | | | Obtained from: jilles
* Implement chflagsat(2) system call, similar to fchmodat(2), but operates onpjd2013-03-211-0/+1
| | | | | | | file flags. Reviewed by: kib, jilles Sponsored by: The FreeBSD Foundation
* - Make 'flags' argument to chflags(2), fchflags(2) and lchflags(2) of typepjd2013-03-211-3/+3
| | | | | | | | | | | u_long. Before this change it was of type int for syscalls, but prototypes in sys/stat.h and documentation for chflags(2) and fchflags(2) (but not for lchflags(2)) stated that it was u_long. Now some related functions use u_long type for flags (strtofflags(3), fflagstostr(3)). - Make path argument of type 'const char *' for consistency. Discussed on: arch Sponsored by: The FreeBSD Foundation
* Allow O_CLOEXEC in posix_openpt() flags.jilles2013-03-211-2/+7
| | | | | PR: kern/162374 Reviewed by: ed
* Implement SOCK_CLOEXEC, SOCK_NONBLOCK and MSG_CMSG_CLOEXEC.jilles2013-03-193-4/+27
| | | | | | | | | | | | | | | | | | | This change allows creating file descriptors with close-on-exec set in some situations. SOCK_CLOEXEC and SOCK_NONBLOCK can be OR'ed in socket() and socketpair()'s type parameter, and MSG_CMSG_CLOEXEC to recvmsg() makes file descriptors (SCM_RIGHTS) atomically close-on-exec. The numerical values for SOCK_CLOEXEC and SOCK_NONBLOCK are as in NetBSD. MSG_CMSG_CLOEXEC is the first free bit for MSG_*. The SOCK_* flags are not passed to MAC because this may cause incorrect failures and can be done later via fcntl() anyway. On the other hand, audit is expected to cope with the new flags. For MSG_CMSG_CLOEXEC, unp_externalize() is extended to take a flags argument. Reviewed by: kib
* There are actually two different cases when mlock(2) returnsglebius2013-03-191-2/+7
| | | | | | ENOMEM. Clarify this, taking text from SUS. Reviewed by: kib
* Add a note to the HISTORY section about lchflags(2) being introduced inpjd2013-03-161-0/+4
| | | | FreeBSD 5.0.
* - Implement two new system calls:pjd2013-03-025-0/+232
| | | | | | | | | | | | | | | | | | | | | | | | | int bindat(int fd, int s, const struct sockaddr *addr, socklen_t addrlen); int connectat(int fd, int s, const struct sockaddr *name, socklen_t namelen); which allow to bind and connect respectively to a UNIX domain socket with a path relative to the directory associated with the given file descriptor 'fd'. - Add manual pages for the new syscalls. - Make the new syscalls available for processes in capability mode sandbox. - Add capability rights CAP_BINDAT and CAP_CONNECTAT that has to be present on the directory descriptor for the syscalls to work. - Update audit(4) to support those two new syscalls and to handle path in sockaddr_un structure relative to the given directory descriptor. - Update procstat(1) to recognize the new capability rights. - Document the new capability rights in cap_rights_limit(2). Sponsored by: The FreeBSD Foundation Discussed with: rwatson, jilles, kib, des
* mdoc: remove superfluous paragraph macro.joel2013-03-023-3/+0
|
* Merge Capsicum overhaul:pjd2013-03-027-144/+582
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Capability is no longer separate descriptor type. Now every descriptor has set of its own capability rights. - The cap_new(2) system call is left, but it is no longer documented and should not be used in new code. - The new syscall cap_rights_limit(2) should be used instead of cap_new(2), which limits capability rights of the given descriptor without creating a new one. - The cap_getrights(2) syscall is renamed to cap_rights_get(2). - If CAP_IOCTL capability right is present we can further reduce allowed ioctls list with the new cap_ioctls_limit(2) syscall. List of allowed ioctls can be retrived with cap_ioctls_get(2) syscall. - If CAP_FCNTL capability right is present we can further reduce fcntls that can be used with the new cap_fcntls_limit(2) syscall and retrive them with cap_fcntls_get(2). - To support ioctl and fcntl white-listing the filedesc structure was heavly modified. - The audit subsystem, kdump and procstat tools were updated to recognize new syscalls. - Capability rights were revised and eventhough I tried hard to provide backward API and ABI compatibility there are some incompatible changes that are described in detail below: CAP_CREATE old behaviour: - Allow for openat(2)+O_CREAT. - Allow for linkat(2). - Allow for symlinkat(2). CAP_CREATE new behaviour: - Allow for openat(2)+O_CREAT. Added CAP_LINKAT: - Allow for linkat(2). ABI: Reuses CAP_RMDIR bit. - Allow to be target for renameat(2). Added CAP_SYMLINKAT: - Allow for symlinkat(2). Removed CAP_DELETE. Old behaviour: - Allow for unlinkat(2) when removing non-directory object. - Allow to be source for renameat(2). Removed CAP_RMDIR. Old behaviour: - Allow for unlinkat(2) when removing directory. Added CAP_RENAMEAT: - Required for source directory for the renameat(2) syscall. Added CAP_UNLINKAT (effectively it replaces CAP_DELETE and CAP_RMDIR): - Allow for unlinkat(2) on any object. - Required if target of renameat(2) exists and will be removed by this call. Removed CAP_MAPEXEC. CAP_MMAP old behaviour: - Allow for mmap(2) with any combination of PROT_NONE, PROT_READ and PROT_WRITE. CAP_MMAP new behaviour: - Allow for mmap(2)+PROT_NONE. Added CAP_MMAP_R: - Allow for mmap(PROT_READ). Added CAP_MMAP_W: - Allow for mmap(PROT_WRITE). Added CAP_MMAP_X: - Allow for mmap(PROT_EXEC). Added CAP_MMAP_RW: - Allow for mmap(PROT_READ | PROT_WRITE). Added CAP_MMAP_RX: - Allow for mmap(PROT_READ | PROT_EXEC). Added CAP_MMAP_WX: - Allow for mmap(PROT_WRITE | PROT_EXEC). Added CAP_MMAP_RWX: - Allow for mmap(PROT_READ | PROT_WRITE | PROT_EXEC). Renamed CAP_MKDIR to CAP_MKDIRAT. Renamed CAP_MKFIFO to CAP_MKFIFOAT. Renamed CAP_MKNODE to CAP_MKNODEAT. CAP_READ old behaviour: - Allow pread(2). - Disallow read(2), readv(2) (if there is no CAP_SEEK). CAP_READ new behaviour: - Allow read(2), readv(2). - Disallow pread(2) (CAP_SEEK was also required). CAP_WRITE old behaviour: - Allow pwrite(2). - Disallow write(2), writev(2) (if there is no CAP_SEEK). CAP_WRITE new behaviour: - Allow write(2), writev(2). - Disallow pwrite(2) (CAP_SEEK was also required). Added convinient defines: #define CAP_PREAD (CAP_SEEK | CAP_READ) #define CAP_PWRITE (CAP_SEEK | CAP_WRITE) #define CAP_MMAP_R (CAP_MMAP | CAP_SEEK | CAP_READ) #define CAP_MMAP_W (CAP_MMAP | CAP_SEEK | CAP_WRITE) #define CAP_MMAP_X (CAP_MMAP | CAP_SEEK | 0x0000000000000008ULL) #define CAP_MMAP_RW (CAP_MMAP_R | CAP_MMAP_W) #define CAP_MMAP_RX (CAP_MMAP_R | CAP_MMAP_X) #define CAP_MMAP_WX (CAP_MMAP_W | CAP_MMAP_X) #define CAP_MMAP_RWX (CAP_MMAP_R | CAP_MMAP_W | CAP_MMAP_X) #define CAP_RECV CAP_READ #define CAP_SEND CAP_WRITE #define CAP_SOCK_CLIENT \ (CAP_CONNECT | CAP_GETPEERNAME | CAP_GETSOCKNAME | CAP_GETSOCKOPT | \ CAP_PEELOFF | CAP_RECV | CAP_SEND | CAP_SETSOCKOPT | CAP_SHUTDOWN) #define CAP_SOCK_SERVER \ (CAP_ACCEPT | CAP_BIND | CAP_GETPEERNAME | CAP_GETSOCKNAME | \ CAP_GETSOCKOPT | CAP_LISTEN | CAP_PEELOFF | CAP_RECV | CAP_SEND | \ CAP_SETSOCKOPT | CAP_SHUTDOWN) Added defines for backward API compatibility: #define CAP_MAPEXEC CAP_MMAP_X #define CAP_DELETE CAP_UNLINKAT #define CAP_MKDIR CAP_MKDIRAT #define CAP_RMDIR CAP_UNLINKAT #define CAP_MKFIFO CAP_MKFIFOAT #define CAP_MKNOD CAP_MKNODAT #define CAP_SOCK_ALL (CAP_SOCK_CLIENT | CAP_SOCK_SERVER) Sponsored by: The FreeBSD Foundation Reviewed by: Christoph Mallon <christoph.mallon@gmx.de> Many aspects discussed with: rwatson, benl, jonathan ABI compatibility discussed with: kib
* Provide cap_sandboxed(3) function, which is a wrapper around cap_getmode(2)pjd2013-03-022-0/+2
| | | | | | | | | | | system call, which has a nice property - it never fails, so it is a bit easier to use. If there is no support for capability mode in the kernel the function will return false (not in a sandbox). If the kernel is compiled with the support for capability mode, the function will return true or false depending if the calling process is in the capability mode sandbox or not respectively. Sponsored by: The FreeBSD Foundation
* Put one file per line so it is easier to read diffs against those files.pjd2013-02-161-59/+235
|
* Make the F_READAHEAD option to fcntl(2) work as documented: a value of zeroian2013-02-131-2/+2
| | | | | | | | now disables read-ahead. It used to effectively restore the system default readahead hueristic if it had been changed; a negative value now restores the default. Reviewed by: kib
* sigqueue(2): Fix typo (EEPERM -> EPERM).jilles2013-02-101-1/+1
| | | | MFC after: 3 days
* Fix logic inversion.eadler2013-02-091-1/+1
| | | | | | PR: docs/174966 Submitted by: Christian Ullrich <chris+freebsd@chrullrich.net> Approved by: bcr (mentor)
* Document the detail of interaction between vfork and PT_TRACEME.kib2013-02-071-1/+11
| | | | MFC after: 2 weeks
* Document the ERESTART translation to EINTR for devfs nodes.kib2013-02-071-1/+12
| | | | | Based on the submission by: jilles MFC after: 2 weeks
* Rework the __vdso_* symbols attributes to only make the symbols weak,kib2013-01-302-5/+4
| | | | | | | | | | but use normal references instead of weak. This makes the statically linked binaries to use fast gettimeofday(2) by forcing the linker to resolve references and providing the neccessary functions. Reported by: bde Tested by: marius (sparc64) MFC after: 2 weeks
* posix_fadvise(2) first appeared in FreeBSD 9.1glebius2013-01-231-1/+1
|
* Note that SIGCHLD is special and if ignored, won't be recorded by the filter.pjd2013-01-211-2/+4
|
* - Use standard RETURN VALUES section.zont2013-01-151-6/+2
| | | | | Approved by: kib (mentor) MFC after: 1 week
* - Update manual pages accordingly to r244384 and r244385.zont2012-12-252-9/+25
| | | | | Approved by: kib (mentor) MFC after: 1 week
* Document that socket(2) may fail with EAFNOSUPPORT if the family cannotkevlo2012-12-071-7/+12
| | | | | | | be found. Reviewed by: glebius Obtained from: NetBSD
OpenPOWER on IntegriCloud