summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Point people to ipcomp(4) instead of ipsecctl(8) forajacoutot2019-01-221-3/+3
| | | | | | net.inet.ipcomp.enable. ok deraadt@ bluhm@
* Document 'video' promise.landry2019-01-211-2/+27
| | | | looks fine to jmc@
* correct the RETURN VALUES of the macros, document the HISTORY ofschwarze2019-01-201-9/+37
| | | | | the macros, and simplify one wording; OK millert@, tweak and OK jmc@
* sys/time.h: new macros: timerisvalid() and timespecisvalid().cheloha2019-01-181-2/+10
| | | | | | | | | | | Make it less likely you miss a zero when typing out 100000 or 100000000. Document them in getitimer.2 for the masses. These may be of use in library code as well as the kernel. Comparable inline functions exist in Linux but are not available to userspace like these. "OK." deraadt@
* minor tweaks:schwarze2019-01-181-9/+17
| | | | | | * correctly mark up NULL * avoid gratuitous future tense * replace one wrong .Nm macro
* Adjust EINVAL wording: tv_nsec cannot be 1 billion, either.cheloha2019-01-181-3/+4
|
* futex(2): validate relative timeout before sleeping.cheloha2019-01-181-2/+7
| | | | | | | | Linux does validation. Document this new failure case as an EINVAL, like Linux. "stop waiting" deraadt
* adjtime(2), settimeofday(2), clock_settime(2): validate inputcheloha2019-01-182-6/+15
| | | | | | | | | Add documentation for the new EINVAL cases for adjtime(2) and settimeofday(2). adjtime.2 docs ok schwarze@, settimeofday(2)/clock_settime(2) stuff ok tedu@, "stop waiting" deraadt@
* mincore() is a relic from the past, exposing physical machine informationderaadt2019-01-1110-93/+19
| | | | | | | about shared resources which no program should see. only a few pieces of software use it, generally poorly thought out. they are being fixed, so mincore() can be deleted. ok guenther tedu jca sthen, others
* getsockopt(2) recv(2) rmdir(2) and send(2) were present and implementedjsg2019-01-114-12/+12
| | | | | | in 4.1c ok schwarze@
* make spelling in previous consistent within the page;jmc2019-01-091-3/+3
|
* Document SO_ZEROIZE socket option.bluhm2019-01-081-2/+9
| | | | OK claudio@
* Fix most of the .Li abuse:schwarze2019-01-061-47/+49
| | | | | | | | | * Use .Vt for struct names and other type names like in_port_t. * Use .Dv for #define'd constants like CPUSTATES and KERN_SYSVIPC_INFO. * Use .Va for sysctl variable names like "machdep". Not touching some of the .Li use related to networking; that stuff looks suspicious in more than one way and a diff would need review.
* note that tracefile must be null when clearing points.tedu2019-01-061-7/+4
| | | | ok kn
* nanosleep: loop tsleep(9) to ensure coverage of the full timeout range.cheloha2018-12-311-4/+5
| | | | | | | | | | | | tsleep(9)'s maximum timeout shrinks as HZ grows, so this ensures we do not return early from longer timeouts on alpha or on custom kernels. POSIX says you cannot return early unless a signal is delivered, so this makes us more compliant with the standard. While here, remove the 100 million second upper bound. It is an artifact from itimerfix() and it serves no discernible purpose. ok tedu@ visa@
* document kern.pool_debug; ok tedu@anton2018-12-261-2/+20
|
* remove double .Pp. oops - sorry for not spotting!jmc2018-11-291-2/+1
|
* Improve introduction so there is more clarity about the patterns ofderaadt2018-11-291-17/+17
| | | | unveil calls should follow. ok various, including jmc
* fold the contents of malloc.conf.5 into malloc.3 and sysctl.2,jmc2018-11-211-5/+7
| | | | | | now that there is essentially no malloc.conf; text tweaked by deraadt; ok otto deraadt
* delete the dns jackport experiment. it has no future.tedu2018-11-191-6/+2
|
* Add new KERN_CPUSTATS sysctl(2) so we can identify offline CPUs.cheloha2018-11-171-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because of hw.smt we need a way to determine whether a given CPU is "online" or "offline" from userspace. KERN_CPTIME2 is an array, and so cannot be cleanly extended for this purpose, so add a new sysctl(2) KERN_CPUSTATS with an extensible struct. At the moment it's just KERN_CPTIME2 with a flags member, but it can grow as needed. KERN_CPUSTATS appears to have been defined by BSDi long ago, but there are few (if any) packages in the wild still using the symbol so breakage in ports should be near zero. No other system inherited the symbol from BSDi, either. Then, use the new sysctl(2) in systat(1) and top(1): - systat(1) draws placeholder marks ('-') instead of percentages for offline CPUs in the cpu view. - systat(1) omits offline CPU ticks when drawing the "big bar" in the vmstat view. The upshot is that the bar isn't half idle when half your logical CPUs are disabled. - top(1) does not draw lines for offline CPUs; if CPUs toggle on or offline in interactive mode we redraw the display to expand/reduce space for the new/missing CPUs. This is consistent with what some top(1) implementations do on Linux. - top(1) omits offline CPUs from the totals when CPU totals are combined into a single line (the '-1' flag). Originally prompted by deraadt@. Discussed endlessly with deraadt@, ketennis@, and sthen@. Tested by jmc@ and jca@. Earlier versions also discussed with jca@. Earlier versions tested by jmc@, tb@, and many others. docs ok jmc@, kernel bits ok ketennis@, everything ok sthen@, "Is your stuff in yet?" deraadt@
* Do not translate the EACCES error from pf(4) to EHOSTUNREACH anymore.bluhm2018-11-101-5/+7
| | | | | | It also translated a documented send(2) EACCES case erroneously. This was too much magic and always prone to errors. from Jan Klemkow; man page jmc@; OK claudio@
* Conform to POSIX-2001 in which the behavior of passing a negative length usinganton2018-11-101-3/+18
| | | | | | | posix file locks is defined. Also, detect overflows when dealing with positive lengths. ok millert@ visa@
* zap last remains of malloc.conf; prompted by and ok jmc@otto2018-11-081-5/+2
|
* typo on fs.posix.setuid; from Piotr Durlejotto2018-11-061-2/+2
|
* vm.malloc_conf, userland sysctl parts; ok millert@ deraadt@otto2018-11-061-2/+7
|
* add missing NET_RT_TABLEdenis2018-11-041-2/+3
| | | | OK benno@
* Correctly deal with upper level unveil's by keeping track of the coveringbeck2018-10-281-13/+2
| | | | | | | unveil for each unveil in the process at unveil() time, and refactoring the handling of current directory and ISDOTDOT to be much more sensible. Worked out at ns2k18 with guenther@. ok deraadt@
* 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@