summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Early daemons like dhcpleased(8), slaacd(8), unwind(8), resolvd(8)bluhm2021-03-091-4/+6
| | | | | | | | | | | | | are started before syslogd(8). This resulted in ugly sendsyslog(2) dropped logs and the real message was lost. Create a temporary stash for log messages within the kernel. It has a limited size of 100 messages, and each message is truncated to 8192 bytes. When the stash is exhausted, the well-known dropped message is generated with a counter. After syslogd(8) has setup everything, it sends a debug line through libc to flush the kernel stash. Then syslogd receives all messages from the kernel before the usual logs. OK deraadt@ visa@
* document ENOTSUP wxallowed/wxneeded behaviour more clearly; ok kurtderaadt2021-03-021-4/+8
|
* Referece trpt(8) from the SO_DEBUG section of getsockopt(2).bluhm2021-02-041-2/+4
| | | | OK claudio@ visa@
* Missing return value; ok jmc@otto2021-01-201-2/+3
|
* kernel, sysctl(8): remove dead variable: tickadjcheloha2021-01-131-5/+4
| | | | | | | | | | | | | | | | | | | | The global "tickadj" variable is a remnant of the old NTP adjustment code we used in the kernel before the current timecounter subsystem was imported from FreeBSD circa 2004 or 2005. Fifteen years hence it is completely vestigial and we can remove it. We probably should have removed it long ago but I guess it slipped through the cracks. FreeBSD removed it in 2002: https://cgit.freebsd.org/src/commit/?id=e1d970f1811e5e1e9c912c032acdcec6521b2a6d NetBSD and DragonflyBSD can probably remove it, too. We export tickadj via the kern.clockrate sysctl(2), so update sysctl.2 and sysctl(8) accordingly. Hypothetically this change could break someone's sysctl(8) parsing script. I don't think that's very likely. ok mvs@
* Make consistent reference to pathname.rob2021-01-0310-35/+35
| | | | OK schwarze@, jmc@, deraadt@
* Document kern.video.record.mglocker2020-12-291-2/+19
| | | | | | With help/input from jmc@ and kn@. ok jmc@
* EVFILT_EXCEPT operates on sockets (emil engler)jmc2020-11-141-3/+4
| | | | | | or pseudo terminals (visa); ok mpi visa
* double word fixes;jmc2020-11-051-3/+3
|
* clock_gettime.2: overhaul manpagecheloha2020-10-251-76/+241
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The clock_gettime.2 page is clumsy. It will be easier to use if it is reorganized to emphasize clock_gettime(2), a general and widely used interface, over clock_settime(2), a special-purpose and rarely used interface. While doing that I found a bunch of other things I wanted to tweak or improve: - Simplify the NAME summary. No need to mention "calibration" or "date". - "now", "res", and "clock" are better argument names than "tp" and "clock_id". - The CLOCK_* list is a bunch of fragments. Rewrite the list to make it easier to understand what the clocks represent and how they behave. - Mention clock_settime(2) *after* the list of clocks. Almost nobody needs to use it. It shouldn't lead the page alongside clock_gettime(2). - Drop the adjtime(2) reference. We could mention it in a CAVEATS section but it definitely doesn't belong here in the DESCRIPTION. - Drop the useless init(8) reference. - Add a bunch of EXAMPLES demonstrating how to actually use each clock. - Clean up the ERRORS. - Update the cross references. - Add a HISTORY for the interfaces and each clock. High-level structural ideas from jmc@ and schwarze@. Edited by jmc@. ok jmc@, probably ok schwarze@
* adjust protos for utimes/futimes to use [2], and then add documentationderaadt2020-09-301-4/+28
| | | | | regarding EINVAL for denomalized time values (sub-second out of range) ok jmc millert, discussion with kettenis
* select.2: Xr directly to timersub(3) now that it has a dedicated manpagecheloha2020-08-131-5/+3
| | | | Reported by Fabian Raetz <fabian.raetz@gmail.com>.
* We have `pipexinq' and `pipexoutq' mbuf(9) queues to store pipex(4)mvs2020-08-041-26/+2
| | | | | | | | | | | | | related mbufs. Each mbuf(9) passed to these queues stores the pointer to corresponding pipex(4) session referenced as `m_pkthdr.ph_cookie'. When session was destroyed its reference can still be in these queues so we have use after free issue while pipexintr() dereference it. I removed `pipexinq', `pipexoutq' and pipexintr(). This not only allows us to avoid issue described above, but also removes unnecessary context switch in packet processing. Also it makes code simpler. ok mpi@ yasuoka@
* Reference unveil(2) in system accounting and daily.8.rob2020-07-261-6/+5
| | | | | | | Reminder that unveil does not kill from brynet and gsoares. Wording tweaks from jmc; feedback from deraadt. ok jmc@, millert@, solene@, "fine with me" deraadt@
* "wroute" allows changes to the routing table; ok deraadtjmc2020-07-171-2/+2
|
* route and wroute were undocumented; ok florianderaadt2020-07-171-2/+7
|
* adjfreq(2): limit adjustment to [-500000, +500000] ppmcheloha2020-07-091-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we recompute the scaling factor during tc_windup() there is an opportunity for arithmetic overflow if the active timecounter's adjfreq(2) adjustment is too large. If we limit the adjustment to [-500000, +500000] ppm the statement in question cannot overflow. In particular, we are concerned with the following bit of code: scale = (u_int64_t)1 << 63; scale += \ ((th->th_adjustment + th->th_counter->tc_freq_adj) / 1024) * 2199; scale /= th->th_counter->tc_frequency; th->th_scale = scale * 2; where scale is an int64_t. Overflow when we do: scale += (...) / 1024 * 2199; as th->th_counter->tc_freq_adj is currently unbounded. th->th_adjustment is limited to [-5000ppm, 5000ppm]. To see that overflow is prevented with the new bounds, consider the new edge case where th->th_counter->tc_freq_adj is 500000ppm and th->th_adjustment is 5000ppm. Both are of type int64_t. We have: int64_t th_adjustment = (5000 * 1000) << 32; /* 21474836480000000 */ int64_t tc_freq_adj = 500000000LL << 32; /* 2147483648000000000 */ scale = (u_int64_t)1 << 63; /* 9223372036854775808 */ scale += (th_adjustment + tc_freq_adj) / 1024 * 2199; /* scale += 2168958484480000000 / 1024 * 2199; */ /* scale += 4657753620480000000; */ 9223372036854775808 + 4657753620480000000 = 13881125657334775808, which less than 18446744073709551616, so we don't have overflow. On the opposite end, if th->th_counter->tc_freq_adj is -500000ppm and th->th_adjustment is -5000ppm we would have -4657753620480000000. 9223372036854775808 - 4657753620480000000 = 4565618416374775808. Again, no overflow. 500000ppm and -500000ppm are extreme adjustments. otto@ says ntpd(8) would never arrive at them naturally, so we are not at risk of breaking a working setup by imposing these restrictions. Documentation input from kettenis@. No complaints from otto@.
* Add support for timeconting in userland.pirofti2020-07-064-5/+236
| | | | | | | | | | | | | | | | | | | | | | | | | | This diff exposes parts of clock_gettime(2) and gettimeofday(2) to userland via libc eliberating processes from the need for a context switch everytime they want to count the passage of time. If a timecounter clock can be exposed to userland than it needs to set its tc_user member to a non-zero value. Tested with one or multiple counters per architecture. The timing data is shared through a pointer found in the new ELF auxiliary vector AUX_openbsd_timekeep containing timehands information that is frequently updated by the kernel. Timing differences between the last kernel update and the current time are adjusted in userland by the tc_get_timecount() function inside the MD usertc.c file. This permits a much more responsive environment, quite visible in browsers, office programs and gaming (apparently one is are able to fly in Minecraft now). Tested by robert@, sthen@, naddy@, kmos@, phessler@, and many others! OK from at least kettenis@, cheloha@, naddy@, sthen@
* spelling fix;jmc2020-06-221-2/+2
|
* Extend kqueue interface with EVFILT_EXCEPT filter.mpi2020-06-221-2/+9
| | | | | | | | | | This filter, already implemented in macOS and Dragonfly BSD, returns exceptional conditions like the reception of out-of-band data. The functionnality is similar to poll(2)'s POLLPRI & POLLRDBAND and it can be used by the kqfilter-based poll & select implementation. ok millert@ on a previous version, ok visa@
* Remove an outdated BUGS section.visa2020-05-311-6/+2
| | | | OK mpi@ beck@
* Fix forgotten references to removed mixer.4 manualratchov2020-05-171-4/+2
|
* Clairify the point at which unveil first makes restricitons on thebeck2020-04-251-9/+4
| | | | | | filesystem, and remove the BUGS section, as this was fixed by making realpath() a system call. ok ingo@ deraadt@
* move mixerctl and audioctl man pages to section 8, as these workderaadt2020-04-211-3/+3
| | | | against root-only device nodes.
* Update ARG_MAX bytes countjca2020-04-101-3/+3
| | | | ok deraadt@
* typo; from bryan stensonjmc2020-03-111-3/+3
|
* Some system calls can fail due to an open-ended variety of causesschwarze2020-02-113-10/+10
| | | | | | | | | | | in many underlying subsystems and device drivers. guenther@ pointed out this applies to system calls taking a file descriptor as an argument. deraadt@ warned against attempting to be excessively precise and against spreading fear, uncertainty, and doubt. So apply a minimal patch that merely avoids the misleading wording "will succeed unless", given that the lists aren't really exhaustive, and simply uses a more usual wording. Unfortunate wording reported by <David dot Raymond at nmt dot edu>.
* A getlogin() function which used utmp(5) appeared in v7.jsg2020-02-091-4/+12
| | | | | | | This was replaced by a getlogin() system call which Ingo discovered we incorrectly list as being 4.2BSD when it was introduced in 4.3BSD Reno. ok schwarze@
* correct Research Unix edition "appeared in" use in HISTORYjsg2020-02-082-6/+6
| | | | | | | | | | | | | | | | | Starting from "Combined Table of Contents" in Doug McIlroy's "A Research UNIX Reader" a table of which edition manuals appeared in. Checked against manuals from bitsavers/TUHS and source from TUHS where available. Ingo points out there are cases where something is included but not documented until a later release. bcd(6) v6 v7 printf(3) v2 v4 abort(3) v5 v6 system(3) v6 v7 fmod(3) v5 v6 ok schwarze@
* Mention AUDIO_MIXER_{DEVINFO,READ,WRITE} in the "audio" sectionratchov2020-02-051-3/+6
|
* Document `kern.allowdt' button.mpi2020-01-241-2/+10
| | | | sysctl.2 bits from benno@
* It is believed that an implementation of madvise was available injsg2019-12-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SunOS 4.0 based on text from the following papers. "Two 4.2BSD system calls, madvise and mincore, remain unspecified, madvise is intended to provide information to the system to influence its management policies. Since a major rework of such policies was deferred to a future release, we decided to defer full specification and implementation of madvise until that time." R. Gingell, J. Moran, W. Shannon "Virtual Memory Architecture in SunOS" Proceedings of USENIX Summer Conference, June 1987 AUUGN Volume 8 Number 5, October 1987 "Memory management related system calls based on the original 4.2BSD specification that were implemented include mmap, munmap, mprotect, madvise, and mincore." J. Moran "SunOS Virtual Memory Implementation" Proceedings of the Spring 1988 European UNIX Users Group Conference, April 1988 AUUGN Volume 9 Number 3, June 1988 and a reference in "Global Index", Part Number: 800-1758-10, Revision A, of 9 May 1988 bitsavers pdf/sun/sunos/4.0/800-1758-10A_Global_Index_198805.pdf discussed with an ok schwarze@
* In "4.2BSD System Manual" (/usr/doc/sysman in 4.2BSD source)jsg2019-12-215-20/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | mmap(), munman(), madvise() and mprotect() are described as planned for later releases. A fully functional mmap(2) supporting shared libraries first appeared in SunOS 4.0 along with msync(2). SunOS 4.1 added madvise(3) and replaced msync(2) with mctl(2) which was was used to implement msync(3), mlock(3) and munlock(3). While some of these functions appear as empty or ifdef'd functions in 4.1cBSD and later it was not until the Mach VM was integrated with Net/2 that most of them were implemented. Though the CSRG releases never supported shared libraries or madvise(). mlock()/munlock() were not in Net/2 as they were added by hibler in 1993, but were in 4.4BSD. madvise(2) was implemented for UVM in NetBSD 1.5 and ported to OpenBSD 2.7. For now instead of trying to accurately describe when interfaces first appeared in other systems correct when they were first available in CSRG or OpenBSD releases, retaining the text in mmap(2) discussing SunOS 4.0. madvise(2) 4.4BSD -> OpenBSD 2.7 mmap2(2) 4.4BSD -> 4.3BSD Net/2 mprotect(2) 4.4BSD -> 4.3BSD Net/2 msync(2) 4.4BSD -> 4.3BSD Net/2 munmap(2) 4.1cBSD -> 4.3BSD Net/2
* The msync interface first appeared in SunOS 4.0.jsg2019-12-101-3/+4
|
* Adjust history text.jsg2019-12-101-5/+8
| | | | | | | A fully functional mmap() system call first appeared in SunOS 4.0 and has been available since 4.4BSD. wording from and ok schwarze@ input from deraadt@
* tweak previous;jmc2019-12-081-13/+13
|
* Make sure packet destination address matches interface address,sashan2019-12-081-2/+12
| | | | | | | | | where such packet is bound to. This check is enforced if and only IP forwarding is disabled. Change discussed with bluhm@, claudio@, deraadt@, markus@, tobhe@ OK bluhm@, claudio@, tobhe@
* replace links to uvm(9) to uvm_init(9); ok mpijmc2019-12-061-3/+3
|
* Explicitly say that *permissions can be "".schwarze2019-12-061-3/+4
| | | | | | Potential for misunderstanding noticed by Chris Rawnsley <chris at puny dot agency>, wording proposed by deraadt@, patch sent by Chris Rawnsley, OK deraadt@.
* Document IP6_SOIIKEY_LENkn2019-12-051-3/+6
| | | | OK florian jmc
* comply with POSIX and make execve() return EACCES for directoriesnaddy2019-12-011-4/+2
| | | | ok millert@ deraadt@
* tweak previous: add missing name after .Fn, delete stray .Pp,schwarze2019-11-271-4/+2
| | | | and drop NetBSD RCS tag apparently left over from copy & paste
* Document msyscall(2): ld.so can use this (once only) to tell the kernelderaadt2019-11-272-2/+76
| | | | | | | where libc.so's text segment is, thereby allowing invocation of system calls from that region. An upcoming change will kill the process if a system call is invoked from addresses not explicitly permitted. ok guenther kettenis mortimer
* MPLSCTL_MAXINKLOOP (net.mpls.maxloop_inkernel) was removed. Adjust manpage.claudio2019-11-051-8/+3
|
* mobileip(4) is going to the atticdlg2019-10-291-7/+2
|
* 1) don't repeat the 256 / EIO commentaryderaadt2019-09-281-7/+6
| | | | | 2) say that the data comes from the random(4) subsystem, so that curious people can go read up on how this works
* sbrk(2) already existed in Version 4 AT&T UNIX;schwarze2019-09-081-5/+7
| | | | | source: https://minnie.tuhs.org/cgi-bin/utree.pl?file=V4/man/man2/break.2 pointed out by Sevan Janiyan <venture37 at geeklan dot co dot uk>
* more Version 1 AT&T UNIX history:schwarze2019-09-071-5/+11
| | | | | a few cases that weren't altogether straightforward; tweak and OK jmc@, OK sobrado@
* More Version 1 AT&T UNIX history.schwarze2019-09-061-14/+12
| | | | | | This became possible because copies of the original v1 manuals have shown up on the Internet some time ago. Reminded by Sevan Janiyan <venture37 at geeklan dot co dot uk>.
* Correct the description of EINTR and EINVAL. This looks like a mis-mergeasou2019-09-061-6/+8
| | | | | | in revision 1.30. ok deraadt@ tb@