summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys
Commit message (Collapse)AuthorAgeFilesLines
* Fix a typo.markj2014-07-091-1/+1
| | | | MFC after: 3 days
* Note that most errors are possible for all syscalls from utimes(2)kib2014-07-031-46/+20
| | | | | | | | | family. Minor wording corrections. Based on the suggestions by bde. Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Document EINVAL as per POSIX.pluknet2014-06-262-2/+10
| | | | | | | | This also follows r124335-r124336, r225827. PR: 191382 MFC after: 1 week Sponsored by: Nginx, Inc.
* Catch up with many years of changes:wollman2014-06-241-13/+50
| | | | | | | | | | | | | | | | | | | o Document PF_LOCAL as being an alias for PF_UNIX o Document POSIX standardization of this interface using AF_* constants rather than PF_* constants, and note the three particular families which POSIX standardizes. o Note anticipated POSIX standardization of SOCK_CLOEXEC. o Delete from listing protocol families that FreeBSD doesn't support (in some cases, like PF_PUP, has never supported). o Add to listing some current protocol families that have been introduced in the last decade or so. o Document the correspondence of PF_* and AF_* constants. We should probably change the documentation to make the AF_* constants primary, but this commit does not do so. Reviewed by: kevlo@ MFC after: 1 month
* mdoc: remove superfluous paragraph macros.joel2014-06-231-2/+0
|
* use .Mt to mark up email addresses consistently (part4)bapt2014-06-2328-40/+40
| | | | | PR: 191174 Submitted by: Franco Fichtner <franco at lastsummer.de>
* Add MAP_EXCL flag for mmap(2). It should be combined with MAP_FIXED,kib2014-06-191-6/+27
| | | | | | | | | | | and prevents the request from deleting existing mappings in the region, failing instead. Reviewed by: alc Discussed with: jhb Tested by: markj, pho (previous version, as part of the bigger patch) Sponsored by: The FreeBSD Foundation MFC after: 1 week
* The time come to remove the wrapper, most likely, but tidy up it codekib2014-06-191-11/+6
| | | | | | | | instead for now. Remove spurious blank line, use C89 definition, wrap long line. Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Minor mdoc fixbjk2014-05-301-1/+1
| | | | | Submitted by: hrs Approved by: hrs (mentor, implicit)
* Correct documentation of the limit on how much memory can be mlock()edbjk2014-05-171-7/+14
| | | | | | | | | vm.max_wired is a system-wide limit, not per-process. Reword the section to make this more clear. PR: docs/189214 Submitted by: Lawrence Chen (original text) Approved by: hrs (mentor)
* msync(2) must return ENOMEM and not EINVAL when the address is outside thepho2014-05-071-5/+7
| | | | | | | | | | | allowed range or when one or more pages are not mapped. This according to The Open Group Base Specifications Issue 7. Discussed with: attilio, Bruce Evans Reviewed by: alc, Garrett Cooper Reported by: ATF MFC after: 2 weeks Sponsored by: EMC / Isilon storage division
* Fix table alignment. EVFILT_PROCDESC is longer than the existing filters.ed2014-04-071-1/+1
|
* Implement kqueue(2) for procdesc(4).ed2014-04-072-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | kqueue(2) already supports EVFILT_PROC. Add an EVFILT_PROCDESC that behaves the same, but operates on a procdesc(4) instead. Only implement NOTE_EXIT for now. The nice thing about NOTE_EXIT is that it also returns the exit status of the process, meaning that we can now obtain this value, even if pdwait4(2) is still unimplemented. Notes: - Simply reuse EVFILT_NETDEV for EVFILT_PROCDESC. As both of these will be used on totally different descriptor types, this should not clash. - Let procdesc_kqops_event() reuse the same structure as filt_proc(). The only difference is that procdesc_kqops_event() should also be able to deal with the case where the process was already terminated after registration. Simply test this when hint == 0. - Fix some style(9) issues in filt_proc() to keep it consistent with the newly added procdesc_kqops_event(). - Save the exit status of the process in pd->pd_xstat, as we cannot pick up the proctree_lock from within procdesc_kqops_event(). Discussed on: arch@ Reviewed by: kib@
* Convert from WITHOUT_SYSCALL_COMPAT to MK_SYSCALL_COMPAT.imp2014-04-051-1/+1
|
* Correct return type of pdfork(2).ed2014-04-041-2/+2
| | | | | | | | | | The pdfork(2) man page states: "pdfork() returns a PID, 0 or -1, as fork(2) does." As it returns a PID, the return type should obviously be pid_t. As int and pid_t have the same size on all architectures, this change does not affect the ABI in any way.
* Use the correct variable name in the example code.eadler2014-03-301-1/+1
|
* Update system man pages for s/capability.h/capsicum.h/.rwatson2014-03-274-8/+8
| | | | MFC after: 3 weeks
* Replace use of ${.CURDIR} by ${LIBC_SRCTOP} and define ${LIBC_SRCTOP}marcel2014-03-041-4/+4
| | | | | | | | | | | if not already defined. This allows building libc from outside of lib/libc using a reach-over makefile. A typical use-case is to build a standard ILP32 version and a COMPAT32 version in a single iteration by building the COMPAT32 version using a reach-over makefile. Obtained from: Juniper Networks, Inc.
* syncer(4) is a kernel process, not a user processbjk2014-02-271-1/+1
| | | | | Noticed by: Geoffrey Thomas <gthomas@mokafive.com> Approved by: hrs (mentor)
* Match the correct variable to the variable description.brueffer2014-02-211-3/+3
| | | | | | PR: 121173 Submitted by: Thomas Mueller <tmueller at sysgo.com> MFC after: 1 week
* document _JAIL as a possible option to set a cpuset for a jail..jmg2014-02-151-1/+2
| | | | MFC after: 3 days
* Fix a typo.brueffer2014-02-031-1/+1
| | | | MFC after: 1 week
* The posix_madvise(3) and posix_fadvise(2) should return error onkib2014-01-303-7/+9
| | | | | | | | | failure, same as posix_fallocate(2). Noted by: Bob Bishop <rb@gid.co.uk> Discussed with: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week
* mdoc: fix several uses of the Fx macro to point to actual releases.uqs2014-01-281-1/+1
| | | | Found by: make manlint
* The posix_fallocate(2) syscall should return error number on error,kib2014-01-231-2/+2
| | | | | | | | | | without modifying errno. Reported and tested by: Gennady Proskurin <gpr@mail.ru> Reviewed by: mdf PR: standards/186028 Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Update EINVAL description.pluknet2014-01-231-2/+2
| | | | | | This matches current POSIX standards and actual FreeBSD behavior. MFC after: 1 week
* Add some missing .Nm for newer syscalls in existing man pages.jilles2014-01-113-3/+6
| | | | MFC after: 1 week
* - Fix EBADF description, in following the future POSIX tc and what FreeBSDpluknet2013-12-271-3/+4
| | | | | | | actually implements. - Improve grammar: use more preferred "can", not "could". Submitted by: jilles
* Fix an apparent typo.pluknet2013-12-261-1/+1
| | | | MFC after: 3 days
* Provide the manual page for aio_fsync(2).pluknet2013-12-262-0/+153
| | | | | Reviewed by: davidxu MFC after: 1 week
* The compile time constant limit on number of swap devices was removed in 5.2.pluknet2013-12-251-5/+1
| | | | | | | As such, remove the EINVAL error saying so. Currently the vm.nswapdev sysctl just represents the number of added swap devices. MFC after: 1 week
* shm_open(2): Fixed the history information.ru2013-12-181-3/+3
| | | | | | While here, sort xrefs. Reviewed by: jhb
* mdoc: remove EOL whitespace.joel2013-12-061-2/+2
|
* Various updates and tweaks to the wait(2) manpage.jhb2013-12-031-132/+174
| | | | | | PR: docs/183904 Submitted by: Michael Galassi <michaelgalassi@gmail.com> Reviewed by: kib, wblock (earlier version)
* chmod(2): Document S_ISVTX following SUSv3/SUSv4.jilles2013-12-011-10/+16
| | | | | | S_ISTXT is non-standard. While here, also update fchmodat() standards entry to POSIX.1-2008.
* waitid(2): Do not tell userland programmers to include <sys/signal.h>.jilles2013-12-011-1/+1
| | | | Userland should get these definitions by including <signal.h>.
* Make process descriptors standard part of the kernel. rwhod(8) alreadypjd2013-11-301-6/+0
| | | | | | | | requires process descriptors to work and having PROCDESC in GENERIC seems not enough, especially that we hope to have more and more consumers in the base. MFC after: 3 days
* Fix extattr(2) MLINKS.pluknet2013-11-091-2/+2
| | | | MFC after: 1 week
* - Add manual pages for capability rights (rights(4)), cap_rights_init(3)pjd2013-11-042-519/+57
| | | | | | | | family of functions and cap_rights_get(3) function. - Update remaining Capsicum-related manual pages. Reviewed by: bdrewery MFC after: 3 days
* kqueue: Change error for kqueues rlimit from EMFILE to ENOMEM and documentjilles2013-11-031-1/+8
| | | | | | this error condition in the kqueue(2) manual page. Discussed with: kib
* Add a resource limit for the total number of kqueues available to thekib2013-10-211-0/+2
| | | | | | | | | | | | | | | | | | user. Kqueue now saves the ucred of the allocating thread, to correctly decrement the counter on close. Under some specific and not real-world use scenario for kqueue, it is possible for the kqueues to consume memory proportional to the square of the number of the filedescriptors available to the process. Limit allows administrator to prevent the abuse. This is kernel-mode side of the change, with the user-mode enabling commit following. Reported and tested by: pho Discussed with: jmg Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
* accept(2): Update portability note for accept4().jilles2013-10-011-3/+10
| | | | | | | | | | | The accept(2) man page warns that O_NONBLOCK and other properties on the new socket may vary across implementations. However, this issue only applies to accept() and not to accept4(). On the other hand, accept4() is not commonly available yet. Reported by: pluknet Reviewed by: bjk Approved by: re (kib)
* Minor mdoc improvements.joel2013-09-191-4/+4
| | | | Approved by: re (blanket)
* Extend the support for exempting processes from being killed when swap isjhb2013-09-193-0/+146
| | | | | | | | | | | | | | | | | | | | | | exhausted. - Add a new protect(1) command that can be used to set or revoke protection from arbitrary processes. Similar to ktrace it can apply a change to all existing descendants of a process as well as future descendants. - Add a new procctl(2) system call that provides a generic interface for control operations on processes (as opposed to the debugger-specific operations provided by ptrace(2)). procctl(2) uses a combination of idtype_t and an id to identify the set of processes on which to operate similar to wait6(). - Add a PROC_SPROTECT control operation to manage the protection status of a set of processes. MADV_PROTECT still works for backwards compatability. - Add a p_flag2 to struct proc (and a corresponding ki_flag2 to kinfo_proc) the first bit of which is used to track if P_PROTECT should be inherited by new child processes. Reviewed by: kib, jilles (earlier version) Approved by: re (delphij) MFC after: 1 month
* Consistently reference file descriptors as "fd". 55 other manpagesbdrewery2013-09-125-31/+31
| | | | | | | | used "fd", while these used "d" and "filedes". MFC after: 1 week Approved by: gjb Approved by: re (delphij)
* Add a mmap flag (MAP_32BIT) on 64-bit platforms to request that a mapping usejhb2013-09-091-1/+14
| | | | | | | | | | | | | an address in the first 2GB of the process's address space. This flag should have the same semantics as the same flag on Linux. To facilitate this, add a new parameter to vm_map_find() that specifies an optional maximum virtual address. While here, fix several callers of vm_map_find() to use a VMFS_* constant for the findspace argument instead of TRUE and FALSE. Reviewed by: alc Approved by: re (kib)
* wait(2): Add some possible caveats to standards section.jilles2013-09-071-4/+18
|
* Update some signal man pages for multithreading.jilles2013-09-064-25/+41
|
* Change the cap_rights_t type from uint64_t to a structure that we can extendpjd2013-09-051-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in the future in a backward compatible (API and ABI) way. The cap_rights_t represents capability rights. We used to use one bit to represent one right, but we are running out of spare bits. Currently the new structure provides place for 114 rights (so 50 more than the previous cap_rights_t), but it is possible to grow the structure to hold at least 285 rights, although we can make it even larger if 285 rights won't be enough. The structure definition looks like this: struct cap_rights { uint64_t cr_rights[CAP_RIGHTS_VERSION + 2]; }; The initial CAP_RIGHTS_VERSION is 0. The top two bits in the first element of the cr_rights[] array contain total number of elements in the array - 2. This means if those two bits are equal to 0, we have 2 array elements. The top two bits in all remaining array elements should be 0. The next five bits in all array elements contain array index. Only one bit is used and bit position in this five-bits range defines array index. This means there can be at most five array elements in the future. To define new right the CAPRIGHT() macro must be used. The macro takes two arguments - an array index and a bit to set, eg. #define CAP_PDKILL CAPRIGHT(1, 0x0000000000000800ULL) We still support aliases that combine few rights, but the rights have to belong to the same array element, eg: #define CAP_LOOKUP CAPRIGHT(0, 0x0000000000000400ULL) #define CAP_FCHMOD CAPRIGHT(0, 0x0000000000002000ULL) #define CAP_FCHMODAT (CAP_FCHMOD | CAP_LOOKUP) There is new API to manage the new cap_rights_t structure: cap_rights_t *cap_rights_init(cap_rights_t *rights, ...); void cap_rights_set(cap_rights_t *rights, ...); void cap_rights_clear(cap_rights_t *rights, ...); bool cap_rights_is_set(const cap_rights_t *rights, ...); bool cap_rights_is_valid(const cap_rights_t *rights); void cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src); void cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src); bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little); Capability rights to the cap_rights_init(), cap_rights_set(), cap_rights_clear() and cap_rights_is_set() functions are provided by separating them with commas, eg: cap_rights_t rights; cap_rights_init(&rights, CAP_READ, CAP_WRITE, CAP_FSTAT); There is no need to terminate the list of rights, as those functions are actually macros that take care of the termination, eg: #define cap_rights_set(rights, ...) \ __cap_rights_set((rights), __VA_ARGS__, 0ULL) void __cap_rights_set(cap_rights_t *rights, ...); Thanks to using one bit as an array index we can assert in those functions that there are no two rights belonging to different array elements provided together. For example this is illegal and will be detected, because CAP_LOOKUP belongs to element 0 and CAP_PDKILL to element 1: cap_rights_init(&rights, CAP_LOOKUP | CAP_PDKILL); Providing several rights that belongs to the same array's element this way is correct, but is not advised. It should only be used for aliases definition. This commit also breaks compatibility with some existing Capsicum system calls, but I see no other way to do that. This should be fine as Capsicum is still experimental and this change is not going to 9.x. Sponsored by: The FreeBSD Foundation
* Xref capsicum(4) and procdesc(4) from pdfork(2).rwatson2013-08-281-4/+18
| | | | | Suggested by: sbruno MFC after: 3 days
OpenPOWER on IntegriCloud