94f03308 | 22-Feb-2019 |
Sascha Wildner <saw@online.de> |
Remove <sys/semaphore.h> so that we have <semaphore.h> only.
There is no point for us to go through the kernel for getting at SEM_VALUE_MAX from sysconf(3), so return it directly and remove the asso
Remove <sys/semaphore.h> so that we have <semaphore.h> only.
There is no point for us to go through the kernel for getting at SEM_VALUE_MAX from sysconf(3), so return it directly and remove the associated p1003_1b.sem_value_max sysctl.
Beyond that, the kernel didn't need this header. I've found no ports that need it, either.
For safety, bump __DragonFly_version anyway.
show more ...
|
dc676eae | 19-Feb-2019 |
Matthew Dillon <dillon@apollo.backplane.com> |
libc - Use sbrk() system call, remove brk() (2)
* Change the initial TLS allocation to use mmap() instead of sbrk() in order to maintain compatibility with older kernels.
* Using sbrk() will work
libc - Use sbrk() system call, remove brk() (2)
* Change the initial TLS allocation to use mmap() instead of sbrk() in order to maintain compatibility with older kernels.
* Using sbrk() will work with a fully updated system, but will not work with an old kernel because it returns an error and sets errno, but setting errno requires the TLS to already be installed. So even though we have back-off code in libc, it seg-faults before it gets to it.
* Only affects a few programs in base such as 'chflags' so not a disaster. But still, the intent was to maintain compatibility with older kernels.
show more ...
|
4b566556 | 17-Feb-2019 |
Matthew Dillon <dillon@apollo.backplane.com> |
kernel - Implement sbrk(), change low-address mmap hinting
* Change mmap()'s internal lower address bound from dmax (32GB) to RLIMIT_DATA's current value. This allows the rlimit to be e.g. redu
kernel - Implement sbrk(), change low-address mmap hinting
* Change mmap()'s internal lower address bound from dmax (32GB) to RLIMIT_DATA's current value. This allows the rlimit to be e.g. reduced and for hinted mmap()s to then map space below the 4GB mark. The default data rlimit is 32GB.
This change is needed to support several languages, at least lua and probably another one or two, who use mmap hinting under the assumption that it can map space below the 4GB address mark. The data limit must be lowered with a limit command too, which can be scripted or patched for such programs.
* Implement the sbrk() system call. This system call was already present but just returned EOPNOTSUPP and libc previously had its own shim for sbrk() which used the ancient break() system call. (Note that the prior implementation did not ENOSYS or signal).
sbrk() in the kernel is thread-safe for positive increments and is also byte-granular (the old libc sbrk() was only page-granular).
sbrk() in the kernel does not implement negative increments and will return EOPNOTSUPP if asked to. Negative increments were historically designed to be able to 'free' memory allocated with sbrk(), but it is not possible to implement the case in a modern VM system due to the mmap changes above.
(1) Because the new mmap hinting changes make it possible for normal mmap()s to have mapped space prior to the RLIMIT_DATA resource limit being increased, causing intermingling of sbrk() and user mmap()d regions. (2) because negative increments are not even remotely thread-safe.
* Note the previous commit refactored libc to use the kernel sbrk() and fall-back to its previous emulation code on failure, so libc supports both new and old kernels.
* Remove the brk() shim from libc. brk() is not implemented by the kernel. Symbol removed. Requires testing against ports so we may have to add it back in but basically there is no way to implement brk() properly with the mmap() hinting fix
* Adjust manual pages.
show more ...
|
1f119bc6 | 16-Jan-2019 |
Aaron LI <aly@aaronly.me> |
fgetln.3: Add the CAVEATS section with an example
Add the CAVEATS section to warn about the behavior of fgetln(). An example is included to demonstrate how to properly use it.
Obtained-from: NetBS
fgetln.3: Add the CAVEATS section with an example
Add the CAVEATS section to warn about the behavior of fgetln(). An example is included to demonstrate how to properly use it.
Obtained-from: NetBSD, with the ferror() check from OpenBSD
show more ...
|
14f65205 | 23-Dec-2018 |
Sascha Wildner <saw@online.de> |
<utmpx.h>: Change struct utmpx's ut_type from uint16_t to short, per POSIX.
See https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/utmpx.h.html
Our valid ut_types are 0-8 currently, so there
<utmpx.h>: Change struct utmpx's ut_type from uint16_t to short, per POSIX.
See https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/utmpx.h.html
Our valid ut_types are 0-8 currently, so there should not be any issues.
Also fix a no longer necessary cast in utmp_update.
show more ...
|
c8a21d03 | 01-Oct-2018 |
Imre Vadász <imre@vdsz.com> |
nmalloc - Try bigcache in posix_memalign() for big PAGE_SIZE aligned allocs.
* This improves performance (by reducing the amount of mmap() calls required and avoiding some amount of page faults) f
nmalloc - Try bigcache in posix_memalign() for big PAGE_SIZE aligned allocs.
* This improves performance (by reducing the amount of mmap() calls required and avoiding some amount of page faults) for applications which frequently call posix_memalign() with a 4096 byte alignment for allocations bigger than 8KB. Allocations of 8KB and smaller are efficiently handled by the SLAB allocator already.
show more ...
|