|
Revision tags: release/15.0.0, release/14.3.0-p6, release/13.5.0-p7 |
|
| #
4a1c7529 |
| 19-Nov-2025 |
Robert Clausecker <fuz@FreeBSD.org> |
libc/tests: add test for *_MAX, *_MIN, and *_WIDTH
This file checks the correctness of the various _MAX, _MIN, and _WIDTH macros defined for the libc types. It assumes that none of the types have p
libc/tests: add test for *_MAX, *_MIN, and *_WIDTH
This file checks the correctness of the various _MAX, _MIN, and _WIDTH macros defined for the libc types. It assumes that none of the types have padding bits.
Approved by: markj (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D53831
show more ...
|
|
Revision tags: release/13.5.0-p6, release/14.3.0-p5, release/13.5.0-p5, release/14.2.0-p7, release/14.3.0-p4, release/14.3.0-p3, release/14.2.0-p6, release/13.5.0-p4, release/13.5.0-p3, release/14.2.0-p5, release/14.3.0-p2 |
|
| #
c08e019c |
| 08-Jul-2025 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
opendir, fdopendir: Add tests, clean up.
* Add test cases for opendir() and fdopendir(). * Drop O_NONBLOCK from opendir(); it was added a long time ago to avoid blocking if given a closed named pi
opendir, fdopendir: Add tests, clean up.
* Add test cases for opendir() and fdopendir(). * Drop O_NONBLOCK from opendir(); it was added a long time ago to avoid blocking if given a closed named pipe, but now we use O_DIRECTORY, which ensures that we get ENOTDIR in that case. * While here, remove unused #includes left over from the split.
Sponsored by: Klara, Inc. Reviewed by: kevans, markj Differential Revision: https://reviews.freebsd.org/D51126
show more ...
|
| #
8d02b719 |
| 02-Jul-2025 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
fts: Add test cases for unreadable directories.
Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D51098
|
|
Revision tags: release/14.3.0-p1, release/14.2.0-p4, release/13.5.0-p2 |
|
| #
deeebfde |
| 20-Jun-2025 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
libc: Add fscandir(), fscandir_b(), scandirat_b().
While here, clean up scandir() a bit and improve the documentation.
MFC after: never Sponsored by: Klara, Inc. Reviewed by: markj Differential Rev
libc: Add fscandir(), fscandir_b(), scandirat_b().
While here, clean up scandir() a bit and improve the documentation.
MFC after: never Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D50935
show more ...
|
|
Revision tags: release/14.3.0 |
|
| #
d580567d |
| 15-May-2025 |
Ricardo Branco <rbranco@suse.de> |
Add tests for sig2str() / str2sig()
Reviewed by: imp, kib, des, jilles Pull Request: https://github.com/freebsd/freebsd-src/pull/1696
|
| #
4d7c31bc |
| 23-May-2025 |
Bojan Novković <bnovkov@FreeBSD.org> |
glob2_test: Add tests for error callback functions and blocks
This change adds tests that check basic callback functionality for blocks and function pointers. The tests also make sure that GLOB_ERR
glob2_test: Add tests for error callback functions and blocks
This change adds tests that check basic callback functionality for blocks and function pointers. The tests also make sure that GLOB_ERR overrides the callback's return value.
Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50486
show more ...
|
| #
d30a84ab |
| 08-May-2025 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
fts: Rename fts_options to fts_options_test
Sponsored by: Klara, Inc.
|
| #
d2da6ed9 |
| 08-May-2025 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
fts: Add tests for most FTS options.
Sponsored by: Klara, Inc. Reviewed by: kevans, imp Differential Revision: https://reviews.freebsd.org/D50234
|
| #
12668ead |
| 22-Apr-2025 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
bsd.compiler.mk: Add a blocks compiler feature.
Sponsored by: Klara, Inc. Reviewed by: jrtc27 Differential Revision: https://reviews.freebsd.org/D49963
|
| #
f0ac5e91 |
| 22-Apr-2025 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
fts: Add blocks support.
This adds an `fts_open_b()` variant of `fts_open()` which takes a block instead of a function pointer.
This was inspired by, and is intended to be compatible with, Apple's
fts: Add blocks support.
This adds an `fts_open_b()` variant of `fts_open()` which takes a block instead of a function pointer.
This was inspired by, and is intended to be compatible with, Apple's implementation; however, although our FTS and theirs share a common ancestor, they have diverged significantly. That and the fact that we still target compilers which don't support blocks means Apple's implementation was not directly reusable.
This is the second use case for blocks in FreeBSD (the first being `qsort_b()`, which we use here). This suggest we might want to add a `COMPILER_FEATURE` for blocks to avoid hardcoding any further `COMPILER_TYPE` checks.
MFC after: never Relnotes: yes Sponsored by: Klara, Inc. Reviewed by: kevans, theraven, imp Differential Revision: https://reviews.freebsd.org/D49877
show more ...
|
|
Revision tags: release/13.4.0-p5, release/13.5.0-p1, release/14.2.0-p3, release/13.5.0, release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4, release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3, release/14.2.0, release/13.4.0 |
|
| #
e9ac4169 |
| 15-Jul-2024 |
Warner Losh <imp@FreeBSD.org> |
Remove residual blank line at start of Makefile
This is a residual of the $FreeBSD$ removal.
MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
|
|
Revision tags: release/14.1.0, release/13.3.0, release/14.0.0 |
|
| #
d0b2dbfa |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
|
|
Revision tags: release/13.2.0, release/12.4.0, release/13.1.0, release/12.3.0, release/13.0.0 |
|
| #
9e1281ea |
| 31-Dec-2020 |
Kyle Evans <kevans@FreeBSD.org> |
libc: tests: hook CPUSET(9) test up to the build
Add shims to map NetBSD's API to CPUSET(9). Obviously the invalid input parts of these tests are relatively useless since we're just testing the shim
libc: tests: hook CPUSET(9) test up to the build
Add shims to map NetBSD's API to CPUSET(9). Obviously the invalid input parts of these tests are relatively useless since we're just testing the shims that aren't used elsewhere, there's still some amount of value in the parts testing valid inputs.
Differential Revision: https://reviews.freebsd.org/D27307
show more ...
|
|
Revision tags: release/12.2.0 |
|
| #
2d143336 |
| 24-Jun-2020 |
Mitchell Horne <mhorne@FreeBSD.org> |
Enable long double tests on RISC-V
Some of the NetBSD contributed tests are gated behind the __HAVE_LONG_DOUBLE flag. This flag seems to be defined only for platforms whose long double is larger tha
Enable long double tests on RISC-V
Some of the NetBSD contributed tests are gated behind the __HAVE_LONG_DOUBLE flag. This flag seems to be defined only for platforms whose long double is larger than their double. I could not find this explicitly documented anywhere, but it is implied by the definitions in NetBSD's sys/arch/${arch}/include/math.h headers, and the following assertion from the UBSAN code:
#ifdef __HAVE_LONG_DOUBLE long double LD; ASSERT(sizeof(LD) > sizeof(uint64_t)); #endif
RISC-V has 128-bit long doubles, so enable the tests on this platform, and update the comments to better explain the purpose of this flag.
Reviewed by: ngie MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25419
show more ...
|
|
Revision tags: release/11.4.0 |
|
| #
301cb491 |
| 10-Jun-2020 |
Kyle Evans <kevans@FreeBSD.org> |
execvp: fix up the ENOEXEC fallback
If execve fails with ENOEXEC, execvp is expected to rebuild the command with /bin/sh instead and try again.
The previous version did this, but overlooked two det
execvp: fix up the ENOEXEC fallback
If execve fails with ENOEXEC, execvp is expected to rebuild the command with /bin/sh instead and try again.
The previous version did this, but overlooked two details:
argv[0] can conceivably be NULL, in which case memp would never get terminated. We must allocate no less than three * sizeof(char *) so we can properly terminate at all times. For the non-NULL argv standard case, we count all the non-NULL elements and actually skip the first argument, so we end up capturing the NULL terminator in our bcopy().
The second detail is that the spec is actually worded such that we should have been preserving argv[0] as passed to execvp:
"[...] executed command shall be as if the process invoked the sh utility using execl() as follows:
execl(<shell path>, arg0, file, arg1, ..., (char *)0);
where <shell path> is an unspecified pathname for the sh utility, file is the process image file, and for execvp(), where arg0, arg1, and so on correspond to the values passed to execvp() in argv[0], argv[1], and so on."
So we make this change at this time as well, while we're already touching it. We decidedly can't preserve a NULL argv[0] as this would be incredibly, incredibly fragile, so we retain our legacy behavior of using "sh" for argv[] in this specific instance.
Some light tests are added to try and detect some components of handling the ENOEXEC fallback; posix_spawnp_enoexec_fallback_null_argv0 is likely not 100% reliable, but it at least won't raise false-alarms and it did result in useful failures with pre-change libc on my machine.
This is a secondary change in D25038.
Reported by: Andrew Gierth <andrew_tao173.riddles.org.uk> Reviewed by: jilles, kib, Andrew Gierth MFC after: 1 week
show more ...
|
| #
7dc859a5 |
| 12-Dec-2019 |
Kyle Evans <kevans@FreeBSD.org> |
Add sigsetop extensions commonly found in musl libc and glibc
These functions (sigandset, sigisemptyset, sigorset) are commonly available in at least musl libc and glibc; sigorset, at least, has pro
Add sigsetop extensions commonly found in musl libc and glibc
These functions (sigandset, sigisemptyset, sigorset) are commonly available in at least musl libc and glibc; sigorset, at least, has proven quite useful in qemu-bsd-user work for tracking the current process signal mask in a more self-documenting/aesthetically pleasing manner.
Reviewed by: bapt, jilles, pfg MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22187
show more ...
|
|
Revision tags: release/12.1.0, release/11.3.0, release/12.0.0, release/11.2.0 |
|
| #
e9ac2743 |
| 21-Mar-2018 |
Conrad Meyer <cem@FreeBSD.org> |
Implement getrandom(2) and getentropy(3)
The general idea here is to provide userspace programs with well-defined sources of entropy, in a fashion that doesn't require opening a new file descriptor
Implement getrandom(2) and getentropy(3)
The general idea here is to provide userspace programs with well-defined sources of entropy, in a fashion that doesn't require opening a new file descriptor (ulimits) or accessing paths (/dev/urandom may be restricted by chroot or capsicum).
getrandom(2) is the more general API, and comes from the Linux world. Since our urandom and random devices are identical, the GRND_RANDOM flag is ignored.
getentropy(3) is added as a compatibility shim for the OpenBSD API.
truss(1) support is included.
Tests for both system calls are provided. Coverage is believed to be at least as comprehensive as LTP getrandom(2) test coverage. Additionally, instructions for running the LTP tests directly against FreeBSD are provided in the "Test Plan" section of the Differential revision linked below. (They pass, of course.)
PR: 194204 Reported by: David CARLIER <david.carlier AT hardenedbsd.org> Discussed with: cperciva, delphij, jhb, markj Relnotes: maybe Differential Revision: https://reviews.freebsd.org/D14500
show more ...
|
| #
acf1f710 |
| 31-Jan-2018 |
John Baldwin <jhb@FreeBSD.org> |
Add a new set of simple tests for makecontext().
In contrast to the existing NetBSD setcontext_link test, these tests verify that passing from 1 to 6 arguments through to the callback function work
Add a new set of simple tests for makecontext().
In contrast to the existing NetBSD setcontext_link test, these tests verify that passing from 1 to 6 arguments through to the callback function work correctly which can be useful for testing ABIs which split arguments between registers and the stack.
Sponsored by: DARPA / AFRL
show more ...
|
| #
82241ed5 |
| 06-Dec-2017 |
Alan Somers <asomers@FreeBSD.org> |
Optimize telldir(3)
Currently each call to telldir() requires a malloc and adds an entry to a linked list which must be traversed on future telldir(), seekdir(), closedir(), and readdir() calls. App
Optimize telldir(3)
Currently each call to telldir() requires a malloc and adds an entry to a linked list which must be traversed on future telldir(), seekdir(), closedir(), and readdir() calls. Applications that call telldir() for every directory entry incur O(n^2) behavior in readdir() and O(n) in telldir() and closedir().
This optimization eliminates the malloc() and linked list in most cases by packing the relevant information into a single long. On 64-bit architectures msdosfs, NFS, tmpfs, UFS, and ZFS can all use the packed representation. On 32-bit architectures msdosfs, NFS, and UFS can use the packed representation, but ZFS and tmpfs can only use it for about the first 128 files per directory. Memory savings is about 50 bytes per telldir(3) call. Speedup for telldir()-heavy directory traversals is about 20-30x for one million files per directory.
Reviewed by: kib, mav, mckusick MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D13385
show more ...
|
|
Revision tags: release/10.4.0 |
|
| #
b754c279 |
| 13-Sep-2017 |
Navdeep Parhar <np@FreeBSD.org> |
MFH @ r323558.
|
| #
05505b6c |
| 26-Aug-2017 |
Enji Cooper <ngie@FreeBSD.org> |
MFhead@r322921
|
| #
5a28df2e |
| 25-Aug-2017 |
Conrad Meyer <cem@FreeBSD.org> |
getmntinfo(3): Scale faster, and return sooner
getmntinfo(3) is designed around a relatively static or slow growing set of current mounts. It tried to detect a race with somewhat concurrent mount a
getmntinfo(3): Scale faster, and return sooner
getmntinfo(3) is designed around a relatively static or slow growing set of current mounts. It tried to detect a race with somewhat concurrent mount and re-call getfsstat(2) in that case, looping indefinitely. It also allocated space for a single extra mount as slop.
In the case where the user has a large number of mounts and is adding them at a rapid pace, it fell over.
This patch makes two functional changes:
1. Allocate even more slop. Double whatever the last getfsstat(2) returned.
2. Abort and return some known results after looping a few times (arbitrarily, 3). If the list is constantly changing, we can't guarantee we return a full result to the user at any point anyways.
While here, add very basic functional tests for getmntinfo(3) to the libc suite.
PR: 221743 Submitted by: Peter Eriksson <peter AT ifm.liu.se> (earlier version) Sponsored by: Dell EMC Isilon
show more ...
|
| #
531c2d7a |
| 24-Jul-2017 |
Enji Cooper <ngie@FreeBSD.org> |
MFhead@r320180
|
| #
bca9d05f |
| 23-Jul-2017 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Merge ^/head r319973 through 321382.
|
|
Revision tags: release/11.1.0 |
|
| #
d2043ca3 |
| 14-Jul-2017 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r320573 through r320970.
|