summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* add spin lock in KERN_CPTIME cpu statessolene2018-09-301-3/+3
| | | | ok mpi@ jca@
* Make the HISTORY sections of the "intro" manuals less confusing andschwarze2018-09-301-3/+3
| | | | more uniform; potential for confusion noticed by aalm@; OK jmc@.
* typo; ok jmc@miko2018-09-261-2/+2
|
* align RETURN VALUES section with pledge manual; ok deraadt@miko2018-09-261-4/+3
|
* Don't mention using poll(2) as a timeout.cheloha2018-08-181-8/+2
| | | | | | | Not a strictly portable use of the interface and there are more suitable interfaces for timeouts anyway. ok schwarze millert
* Some cleanups and clarification, especially regarding locking (observed by rob)deraadt2018-07-301-31/+33
| | | | ok beck jmc
* tweak previous;jmc2018-07-301-10/+11
|
* document the current limitation (we don't yet find an above coveringbeck2018-07-301-2/+12
| | | | unveil for relative operations) that I am working on in BUGS
* re-ordering for sensibility, by semarie; ok jmcderaadt2018-07-281-13/+13
|
* Full stop.rob2018-07-271-3/+3
|
* tidy up the flags section a little: supply a little more indent, and reducejmc2018-07-181-12/+16
| | | | the amount of modal verbs going on;
* fix thinkoespie2018-07-161-3/+3
| | | | okay mestre@
* Correct some typos and also ran it through mandoc -Tlintmestre2018-07-131-12/+12
| | | | OK millert@ deraadt@ and jmc@ who also gave me a cluebat stick
* Unveiling unveil(2).beck2018-07-133-5/+167
| | | | | | | | | | | | | This brings unveil into the tree, disabled by default - Currently this will return EPERM on all attempts to use it until we are fully certain it is ready for people to start using, but this now allows for others to do more tweaking and experimentation. Still needs to send the unveil's across forks and execs before fully enabling. Many thanks to robert@ and deraadt@ for extensive testing. ok deraadt@
* Add hw.ncpuonline to count the number of online CPUs.cheloha2018-07-121-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The introduction of hw.smt means that logical CPUs can be disabled after boot and prior to suspend/resume. If hw.smt=0 (the default), there needs to be a way to count the number of hardware threads available on the system at any given time. So, import HW_NCPUONLINE/hw.ncpuonline from NetBSD and document it. hw.ncpu becomes equal to the number of CPUs given to sched_init_cpu() during boot, while hw.ncpuonline is equal to the number of CPUs available to the scheduler in the cpuset "sched_all_cpus". Set_SC_NPROCESSORS_ONLN equal to this new sysctl and keep _SC_NPROCESSORS_CONF equal to hw.ncpu. This is preferable to adding a new sysctl to count the number of configured CPUs and keeping hw.ncpu equal to the number of online CPUs because such a change would break software in the ecosystem that relies on HW_NCPU/hw.ncpu to measure CPU usage and the like. Such software in base includes top(1), systat(1), and snmpd(8), and perhaps others. We don't need additional locking to count the cardinality of a cpuset in this case because the only interfaces that can modify said cardinality are sysctl(2) and ioctl(2), both of which are under the KERNEL_LOCK. Software using HW_NCPU/hw.ncpu to determine optimal parallism will need to be updated to use HW_NCPUONLINE/hw.ncpuonline. Until then, such software may perform suboptimally. However, most changes will be similar to the change included here for libcxx's std::thread:hardware_concurrency(): using HW_NCPUONLINE in lieu of HW_NCPU should be sufficient for determining optimal parallelism for most software if the change to _SC_NPROCESSORS_ONLN is insufficient. Prompted by deraadt. Discussed at length with kettenis, deraadt, and sthen. Lots of patch tweaks from kettenis. ok kettenis, "proceed" deraadt
* During open(2), release the fdp lock before calling vn_open(9).visa2018-06-251-2/+4
| | | | | | | | | | | | | | | This lets other threads of the process modify the file descriptor table even if the vn_open(9) call blocks. The change has an effect on dup2(2) and dup3(2). If the new descriptor is the same as the one reserved by an unfinished open(2), the system call will fail with error EBUSY. The accept(2) system call already behaves like this. Issue pointed out by art@ via mpi@ Tested in a bulk build by ajacoutot@ OK mpi@
* sort SEE ALSO;jmc2018-06-211-4/+4
|
* s/simultanious/simultaneous/jmc2018-06-211-2/+2
|
* Document hw.smt.kettenis2018-06-211-2/+7
|
* use a full stop, as per the other items; from nan xiaojmc2018-06-191-3/+3
|
* for the witness(4) text, we already Xr the page in the first sentence, so addingjmc2018-06-031-6/+2
| | | | "See witness(4)" is unneccessary, and just bulks this already large page: remove it;
* Returns EBUSY if dup2(2) is called for a LARVAL file.mpi2018-05-281-2/+6
| | | | | | | | | | | This prevents a panic due to a double free if a program exits after having called accept(2) and dup2(2) on the same fd but without the corresponding connect(5). It will also allows us to simplify file descriptor locking. The error code has been choosed to match Linux's behavior. Pointed by Mathieu on tech@ after a discussion with guenther@. ok visa@
* document the new kern.audio node; OK ratchov@schwarze2018-05-261-2/+26
|
* Document kern.witnesswatch in sysctl(2).visa2018-05-161-2/+29
| | | | Reminded by jmc@
* <sys/mount.h> and <sys/swap.h> no longer require <sys/param.h>guenther2018-04-275-15/+15
| | | | ok krw@
* Make futex(2) also return ECANCELED in case SA_RESTART was set.pirofti2018-04-241-2/+7
| | | | Prodded by and ok mpi@
* Validate timespec and return ECANCELED when interrupted with SA_RESTART.pirofti2018-04-241-3/+11
| | | | | | | | | | | | | | | Discussing with mpi@ and guenther@, we decided to first fix the existing semaphore implementation with regards to SA_RESTART and POSIX compliant returns in the case where we deal with restartable signals. Currently we return EINTR everywhere which is mostly incorrect as the user can not know if she needs to recall the syscall or not. Return ECANCELED to signal that SA_RESTART was set and EINTR otherwise. Regression tests pass and so does the posixsuite. Timespec validation bits are needed to pass the later. OK mpi@, guenther@
* use NULL for pointerderaadt2018-04-221-2/+2
|
* mmap() no longer needs to be used. Without providing too many details,deraadt2018-04-221-12/+14
| | | | | | describe how an inner-region is found for applying MAP_STACK, and that currently MAP_STACK remains set when the sigaltstack is disabled. ok kettenis guenther schwarze
* Actually describe the parameters rather than calling facts BUGSschwarze2018-04-081-19/+21
| | | | | that aren't even small bugs. And stop talking about AF_LOCAL. Feedback and OK guenther@, OK jmc@.
* on failure, mmap() returns MAP_FAILEDgsoares2018-03-211-3/+3
| | | | OK deraadt
* anton points out that my previous commit completely messed with thejmc2018-03-161-293/+293
| | | | | | | (unknown to me) relevant ordering of the various promises; restore them now to their original order; partial revert requested by deraadt too
* typo in kern.maxlocksperuidotto2018-03-051-3/+3
|
* various tweaks, in part to try and clean up the amount of verticaljmc2018-03-041-361/+351
| | | | | | whitespace in this page; ok deraadt
* improve lining up of tabs inside .Fd macros for terminal output;schwarze2018-02-271-3/+3
| | | | from <Edgar at Pettijohn dash web dot com> on tech@
* macro fix;jmc2018-02-111-2/+3
|
* Document how MAP_STACK will be used. All stacks must be mmap'd withderaadt2018-02-112-5/+20
| | | | | | | | | this attribute. The kernel does so for main-process stacks at execve() time, pthread stack functions do so for new stacks, and stacks provided to sigaltstack() and other user-provided stacks will need to be allocated in that way. Not required yet, but paving the way. Work done with stefan
* zap trailing whitespace;jmc2018-02-101-2/+2
|
* add support for binary sysctl payloads by handling them as hexflorian2018-02-101-2/+8
| | | | | | | | | | | | | | | | strings. this was part of a demo showing how to implement the kernel side of sysctl(3) for setting Semantically Opaque Interface Identifier key material (for RFC 7217), but it seems to be the most straightforward path toward integrating soiikey handling and rc. Originally written by dlg, who commited it some time ago on my request. I then backed it out again, now it's time to put it back in. ok florian@ sthen@ naddy@ tb@ Man page bits tweaked & OK jmc
* tweak previous;jmc2018-01-131-5/+6
|
* introduce a filter called EVFILT_DEVICE that can be used to notifyrobert2018-01-131-2/+15
| | | | | | | listeners of device state changes. currently only supports NOTE_CHANGE that will be used by drm(4) ok kettenis@
* Adjust references for sysctl(3) to sysctl(2)deraadt2018-01-126-20/+20
|
* sysctl(3) can now be renamed to sysctl(2)deraadt2018-01-122-3/+2260
|
* TIOCUCNTL is now allowed by promise "tty".mpi2018-01-081-4/+5
| | | | Reminded by jmc@
* let's not try to document the number of items in a list...jmc2017-12-181-3/+3
|
* Add the CLOCK_BOOTTIME clockid for use with clock_gettime(2)cheloha2017-12-181-3/+16
| | | | | | | | | | | | | | | | | and put it to use in userspace in lieu of the kern.boottime sysctl. Its absolute value is the time that has elapsed since the system booted, i.e., the system uptime. Use in top(1), w(1), and snmpd(8) eliminates a race with settimeofday(2), adjtime(2), etc. inherent to deriving the system uptime via the kern.boottime sysctl. Product of a great deal of discussion/revision with jca@, tb@, and guenther@. ok tb@ jca@ guenther@ dlg@ mlarkin@ tom@
* Consistently use .Va for "errno";schwarze2017-12-121-3/+3
| | | | | patch from Jan Stary <hans at stare dot cz>; "I think it makes sense to speak about errno as a variable (.Va)" jca@.
* space required between macro arg and punctuation;jmc2017-12-121-2/+2
|
* pledge()'s 2nd argument becomes char *execpromises, which becomes thederaadt2017-12-122-44/+48
| | | | | | | | | | pledge for a new execve image immediately upon start. Also introduces "error" which makes violations return -1 ENOSYS instead of killing the program ("error" may not be handed to a setuid/setgid program, which may be missing/ignoring syscall return values and would continue with inconsistant state) Discussion with many florian has used this to improve the strictness of a daemon
* clang doesn't propagate attributes like "asm labels" and "visibility(hidden)"guenther2017-11-291-2/+2
| | | | | | | | | to builtins like mem{set,cpy,move} and __stack_smash_handler. So, when building with clang, instead mark those as protected visibility to get rid of the PLT relocations. We can't take the address of them then, but that's ok: it's a build-time error not a run-time error. ok kettenis@