summaryrefslogtreecommitdiffstats
path: root/lib/libc (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Add uid_from_user() and gid_from_group(), derived from pax's cache.c.millert2018-09-137-90/+450
| | | | | | It replaces the existing pwcache.c functions user_from_uid(3) and group_from_gid(3) with the pax equivalents. Adapted from NetBSD (mycroft) changes from our own pax's cache.c. OK guenther@
* Use an mmap()'d buffer instead of a static buffer for the contentsmillert2018-08-213-80/+136
| | | | | | | | of the pointer returned by getpw{ent,nam,uid}(). We unmap the buffer each time to catch callers using a stale passwd struct pointer. As a special case, we do not unmap the buffer if the previous lookup was for the same name or uid. This special case may be removed in the future. OK deraadt@
* 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
* Add retguard macros for arm64 asm and apply them in the straightforwardmortimer2018-08-1210-10/+30
| | | | | cases in kernel and libc. ok deraadt@
* 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
* Crank minor for unveilbeck2018-07-131-1/+1
| | | | ok deraadt@
* Unveiling unveil(2).beck2018-07-135-6/+171
| | | | | | | | | | | | | 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-122-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Drop a const-bomb on regexec. It's probably not a good idea to remove amartijn2018-07-112-56/+63
| | | | | | const promise when processing it in the regex engine. Minor tweak and OK schwarze@
* In asm.h ensure NENTRY uses the old-school nop-sled align, but change standardderaadt2018-07-101-1/+1
| | | | | | | ENTRY is a trapsled. Fix a few functions which fall-through into an ENTRY macro. amd64 binaries now are free of double+-nop sequences (except for one assember nit in aes-586.pl). Previous changes by guenther got us here. ok mortimer kettenis
* Add retguard macros for libc.mortimer2018-07-0323-23/+72
| | | | ok 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@
* Save and restore the relevant FPU state on armv7.kettenis2018-06-223-28/+26
| | | | ok deraadt@
* 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
|
* Add add PIE support for m88k (requires gcc4 toolchain)guenther2018-06-162-5/+7
| | | | | | Convert __cerror to hidden visibility. from miod@
* Use process-private futexes. This avoids the overhead of calling into uvmkettenis2018-06-041-6/+6
| | | | | | to look up the mapping for the futex address. ok visa@, mpi@
* 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;
* Drop include of <arm64/swi.h> and remove it.kettenis2018-05-281-2/+1
| | | | ok drahm@
* 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@
* Clear the sign bit in the QNAN constants used by strtof, strtod and strtold,jmatthew2018-05-284-16/+16
| | | | | | so passing "nan" and "-nan" produces a NaN with the right sign. Bug reported and diff provided by George Koehler. ok kettenis@
* document the new kern.audio node; OK ratchov@schwarze2018-05-261-2/+26
|
* Switch sparc64 to futex(2) based mutexes and condvars.mpi2018-05-191-2/+3
| | | | ok visa@
* Drop memory barrier in _atomic_lock() implementation since the callers nowkettenis2018-05-172-4/+2
| | | | | | take care of this. ok visa@, mpi@
* Document kern.witnesswatch in sysctl(2).visa2018-05-161-2/+29
| | | | Reminded by jmc@
* Enable futex(2)-based mutex on arm64.visa2018-05-131-2/+3
| | | | OK mpi@, kettenis@
* Add memory barriers to libc's _spinlock() to make the mechanismvisa2018-05-131-2/+11
| | | | | | | | | | serialize memory accesses properly. _spinlock()'s backend, _atomic_lock(), already issues an entry barrier on some architectures, but that practice has not been consistent. This patch generalizes the barrier use. OK kettenis@, mpi@
* Fix typo in RFC number.tb2018-05-101-2/+2
| | | | ok benno
* Add a missing header when compiling with -DDEBUGdenis2018-04-301-1/+5
| | | | | | With advice from jca@ OK jca@ millert@
* reference hosts(5) instead of networks(5)schwarze2018-04-281-3/+3
|
* Remove references to the obsolete getnetent(3) and networks(5).schwarze2018-04-282-10/+7
|
* Stop talking about /etc/networks, which is no longer used,schwarze2018-04-281-39/+38
| | | | | | and reference gethostby*(3) and /etc/hosts instead. Say that setnetent(3), getnetent(3), and endnetent(3) now do nothing. With feedback from guenther and significant help from deraadt@.
* Say that sethostent(3), gethostent(3), and endhostent(3) do nothing.schwarze2018-04-281-50/+19
| | | | | | While here, stop implying plans to support additional address families in the future, and do not call gethostbyname2(3) "advanced". OK deraadt@ guenther@
* To allow us to get rid of /etc/networks, make getnetby*(3)schwarze2018-04-285-442/+79
| | | | | | wrappers around gethostby*_async(3). If you had anything of importance in /etc/networks, specify it in /etc/hosts instead. Feedback and OK eric@, OK deraadt@
* Minor cleanup, no functional change:schwarze2018-04-281-8/+3
| | | | | | | Remove unused headers and a comment implying that we might consider reviving these dead horses in the future, which we do not intend to do. OK deraadt@ guenther@
* To allow us to get rid of /etc/networks, make setnetent(3),schwarze2018-04-281-75/+4
| | | | | | getnetent(3), and endnetent(3) do nothing, just like sethostent(3), gethostent(3), and endhostent(3) years ago. OK deraadt@ guenther@
* Fix typo in binary-float example in commentguenther2018-04-271-2/+2
|
* <sys/mount.h> and <sys/swap.h> no longer require <sys/param.h>guenther2018-04-276-18/+18
| | | | 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-242-6/+16
| | | | | | | | | | | | | | | 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
|