| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
- s/reimplemeted/reimplemented/
MFC after: 3 days
|
| |
|
|
|
|
|
| |
Reviewed by: dim
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D56222
|
| |
|
|
|
|
|
|
|
| |
Drop the _np suffix.
Reviewed by: dim
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D56222
|
| |
|
|
|
| |
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a specially formatted path is passed to dlopen(), of the form
#number/path
and the number is the valid dirfd file descriptor listed in the
LD_LIBRARY_FDS, interpret it as a relative path name against dirfd
number.
This complements the result returned from dladdr() for such objects
in dli_fname.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D56152
|
| |
|
|
|
|
|
|
|
| |
atexit(3) is one of the cases when _exit(2) must be used instead of
exit(3).
MFC after: 3 days
Reviewed by: mhorne, ziaee
Differential Revision: https://reviews.freebsd.org/D54467
|
| |
|
|
|
|
|
| |
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D56121
|
| |
|
|
|
|
| |
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D56055
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Wordsmith mentions throughout the manual of syslog and dmesg, to clearly
differentiate them in an externally consisteny way, increasing operator
onboarding speed and elegance.
The daemon that handles general system messages, syslog, describes them
as "system messages", and "messages" is the standard filename. Rewrite
syslog related manual titles to align search results with this, and hier
entries to align the index. Use care to maintain keywords and not add
extra lines. Newsyslog trades "maintain" with "rotate" for visibility.
MFC after: 3 days
Reviewed by: markj
Closes: https://github.com/freebsd/freebsd-src/pull/2067
|
| |
|
|
|
|
|
|
|
| |
I accidentally dropped a part of the patch on squash rebase.
Should be fine now.
Fixes: 253f15c016ca699906f78b8e522a3f7ed675929b
PR: 293915
MFC after: 1 week
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The original scalar implementation of strrchr() had incorrect
logic that failed if the character searched for was the NUL
character. It was also possibly affected by the issue fixed
in 3d8ef251a for strchrnul().
Rewrite the function with logic that actually works. We defer
checking for the character until after we have checked for NUL.
When we encounter the final NUL byte, we mask out the characters
beyond the tail before checking for a match.
This bug only affects users running on amd64 with ARCHLEVEL=scalar
(cf. simd(7)). The default configuration is not affected.
The bug was unfortunately not caught by the unit test inherited
from NetBSD. An extended unit test catching the issue is proposed
in D56037.
PR: 293915
Reported by: safonov.paul@gmail.com
Tested by: safonov.paul@gmail.com
Fixes: 2ed514a220edbac6ca5ec9f40a3e0b3f2804796d
See also: https://reviews.freebsd.org/D56037
MFC after: 1 week
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Prune unused code hidden behind 'notdef', bringing us in sync with
the changes in OpenBSD. Despite the `__default_hash` function pointer
having external linkage, no ABI change is expected since it was
never exported.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D55842
Reviewed by: allanjude, des
MFC after: 2 weeks
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
After patch 9d26b82, we don't provide recursive call protection anymore.
Therefore, to pass the test, we adjust the testcase by protecting on
caller and the testcase is to make sure the dtors is properly handled.
Reported by: siva
Reviewed by: kib
Approved by: markj (mentor)
Fixes: 9d26b82826d9 ("libc: Fix dtor order in __cxa_thread_atexit")
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55893
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Try to make the RETURN VALUES section flow better.
* Add basename(3), dirname(3), free(3) to the SEE ALSO section.
* Drop the CAVEATS section, which was obsolete the moment realpath(3)
was added to the Single Unix Specification in 1994.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D55928
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Save prev_len after having checked for and appended a trailing slash,
not before. This requires us to back up if we end up returning a
partial result, but previously we would sometimes return a partial
result with a trailing slash and sometimes without.
* Replace strlcat() with a faster strlcpy() since we know exactly how
far into the buffer we are.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D55914
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The thread_local variable may creates another thread_local variable
inside its dtor. This new object is immediately be registered in
__cxa_thread_atexit() and need to be freed before processing another
variable.
This fixes the libcxx test thread_local_destruction_order.pass.cpp.
Reported by: kib
Approved by: lwhsu (mentor)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55826
|
| |
|
|
|
|
|
|
|
|
| |
These features are available in all supported linkers, and we can expect
that they'll be supported by any GNU-compatible linker that we'd use to
link FreeBSD.
Reviewed by: imp, kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55676
|
| |
|
|
|
|
|
|
|
|
|
|
| |
We were saving SIGINT twice instead of SIGINT and SIGQUIT.
Also restore original order of operations (SIGINT then SIGQUIT), which
matches the order in which they're discussed in the POSIX description
of system(3).
MFC after: 1 week
Sponsored by: Klara, Inc.
Fixes: 48368f702423 ("system(3): Address test robustness issue")
|
| |
|
|
|
|
|
|
|
|
|
| |
Don't assume that SIGINT and SIGQUIT are set to SIG_DFL at the start
of the test. Instead, retrieve their current dispositions and verify
that they are restored at the end of the test.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D55709
|
| |
|
|
|
|
|
|
|
|
|
|
| |
developed
strnlen() doesn't seem to cope well with a length argument such that
string pointer plus length overflows past the end of the address space.
Reviewed by: fuz
MFC after: 1 week
PR: 293353, 293296
Differential Revision: https://reviews.freebsd.org/D55714
|
| |
|
|
|
| |
Without this lib32 libc.so.7 would be missing critical symbols,
including malloc / free and all syscall wrappers.
|
| |
|
|
|
|
|
|
| |
This more closely mirrors libc/quad/Makefile.inc and is easier to
read.
Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D55658
|
| |
|
|
|
|
|
| |
lld doesn't notice, but ld.bfd complains.
Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D55657
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The alloca() interface has been a macro expanding to __builtin_alloca()
since 2003 (commit 79806b4cdce0, included in FreeBSD 5.2). Even before
that virtually every compiler version I was able to test replaced
alloca() with compiler generated code when targeting C.
Hide it to prevent future (mis)use.
Reviewed by: imp, kib
Differential Revision: https://reviews.freebsd.org/D51858
|
| |
|
|
|
|
|
|
|
| |
Remove a bunch of complexity at the cost of 4 bytes of storage per
thread.
Reviewed by: jhb
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D55310
|
| |
|
|
|
|
|
|
|
|
|
| |
There is no need to call execl(), which will allocate an array and copy
our arguments into it, when we can use a static array and call execve()
directly.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D55648
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When kernel external errors are available they are included in the
err(3) library function messages. In addition to the extended error
itself, the kernel also tracks the kernel file and line number at
which the error was generated. This additional information is not
included in the err(3) messages unless the EXTERROR_VERBOSE environment
variable is present. Currently, when EXTERROR_VERBOSE is present,
all the internal extended error information associated with the
error is printed most of which is redundant with the formatted error
message printed by err(3). This change will add only the kernel
file and line number to the err(3) message when EXTERROR_VERBOSE
is present and set to "brief".
Sample output with bad protection bits to mmap:
guest_16 % ./Example bigfile
Example: mmap bigfile: Invalid argument (unknown PROT bits 0x8)
guest_16 % setenv EXTERROR_VERBOSE
guest_16 % ./Example bigfile
Example: mmap bigfile: Invalid argument (unknown PROT bits 0x8 errno 22 category 1 (src sys/vm/vm_mmap.c:200) p1 0x8 p2 0)
guest_16 % setenv EXTERROR_VERBOSE brief
guest_16 % ./Example bigfile
Example: mmap bigfile: Invalid argument (unknown PROT bits 0x8 (src sys/vm/vm_mmap.c:200))
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D55494
MFC-after: 1 week
Sponsored-by: Netflix
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Our manual page states that if given a null pointer, system() returns
non-zero if the shell is available and zero if it is not. This is
consistent with the C standard's description of system(), but it is not
what we actually do. What we actually do is always return non-zero, as
required by POSIX.
As the POSIX rationale explains, implementing the logic required by the
C standard does not violate POSIX, since a conforming system always has
a shell, therefore the logic will always return non-zero.
Since our libc is commonly used in non-conforming situations such as
chroots or thin jails, we should implement the full logic required by
the C standard.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: obiwac, bnovkov, kevans
Differential Revision: https://reviews.freebsd.org/D55484
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Our manual page currently states that system() will return 127 if it
fails to execute the shell. The actual return value is, to quote POSIX,
“as if the command language interpreter had terminated using exit(127)
or _exit(127)”.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: bnovkov, kevans
Differential Revision: https://reviews.freebsd.org/D55483
|
| |
|
|
|
|
|
|
|
| |
Replace the somewhat perfunctory NetBSD tests with our own.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: bnovkov, kevans
Differential Revision: https://reviews.freebsd.org/D55482
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ignore SIGINT and SIGQUIT and block SIGCHLD, as POSIX requires.
To deal with the concurrency problem described in POSIX, we keep track
of the count of concurrent invocations. We ignore and block signals
only when the counter was zero before we incremented it, and restore
them only when the counter reaches zero after we decrement it.
Note that this does not address the issue of thread cancellation.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: bnovkov, sef, kevans
Differential Revision: https://reviews.freebsd.org/D55471
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
POSIX.1-2024 states that the 'free' function "shall not modify errno if
ptr is a null pointer or a pointer previously returned as if by malloc()
and not yet deallocated". However this is a fairly recent addition
and non-compliant allocators might still clobber 'errno', causing
'mpool_get' to return the wrong error code. Fix this by saving
and restoring 'errno' after calling 'free'.
Sponsored by: Klara, Inc.
Reviewed by: obiwac
Differential Revision: https://reviews.freebsd.org/D55463
MFC after: 1 week
|
| |
|
|
|
|
|
|
|
|
|
|
| |
No need to have 4 separate manpages for these functions. Use opportunity
to change parameter names in the source from j -> i to reflect the name
used in POSIX. (The ISO C standard uses j but i is a better name
anyway.)
Reviewed by: des, rpokala
Approved by: rpokala
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D55361
|
| |
|
|
|
|
|
|
|
| |
No need to have 4 separate manpages for these functions.
Reviewed by: ziaee, rpokala, des
Approved by: rpokala, des
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D55360
|
| |
|
|
|
|
|
|
|
|
|
| |
For now, just describe the error where an unprivileged user attempts to
run a VM without DESTROY_ON_CLOSE semantics, i.e., monitor mode.
Reviewed by: bnovkov
MFC after: 2 months
Sponsored by: The FreeBSD Foundation
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D54743
|
| |
|
|
|
|
|
|
|
|
|
| |
Include sys/types.h by exterr.h, since size_t is used.
Drop include of sys/exterr_cat.h, it is useless for the only prototype
provided.
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D55337
|
| |
|
|
|
|
|
| |
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D55336
|
| |
|
|
|
|
|
| |
Noted and reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D55327
|
| |
|
|
|
|
|
|
|
|
| |
This avoids a dependency on the abort symbol in libsys.
PR: 292539
Reviewed by: mmel
Approved by: markj (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D55255
|
| |
|
|
|
|
| |
Approved by: markj (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D55249
|
| |
|
|
|
|
|
|
|
|
| |
Mainly rename numerator parameter of div(3) and ldiv(3) from num to
numer, and explicitly specify what "numer", "denom", and "rem" mean in
the manpages.
MFC after: 3 days
Obtained from: https://github.com/apple-oss-distributions/libc (partially)
Sponsored by: Klara, Inc.
|
| |
|
|
|
|
|
| |
These comments refer to a comment in div.c which doesn't exist anymore.
Fixes: 7c7299df76e2 ("libc: Remove support for pre-C99 C standards")
Sponsored by: Klara, Inc.
|
| |
|
|
|
|
| |
PR: 293072
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
|
| |
This changes STACKALIGN to be type-preserving when operating on
pointers.
Reviewed by: brooks, kib
Effort: CHERI upstreaming
Sponsored by: AFRL, DARPA
Differential Revision: https://reviews.freebsd.org/D54920
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On arm64 we can use the "dc zva" instruction to zero memory. The CPU
tells software if the instruction is implemented, and if so the size
and alignment it will use.
When the size is 64-bytes the Arm Optimized Routines implementation of
memset can use dc zva to zero memory, and has a build flag to skip
checking.
Use this flag to build a version of memset that will be used when this
assumption is true.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D54776
|
| |
|
|
|
|
|
|
|
| |
This allows static binaries to only include the functions they
reference.
Reviewed by: imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D54775
|
| |
|
|
|
|
|
|
|
| |
If we update Makefile.inc it may be to change the contents of these
files.
Reviewed by: imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D54774
|
| |
|
|
|
|
|
|
|
| |
Mainly, avoid reusing the name of one of the functions we should be
testing (but aren't) for local variables.
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D55054
|
| |
|
|
|
|
|
|
|
|
|
|
| |
It takes exactly three arguments of known type.
Tweak the types of various resultproc_t functions to match the type (mostly
added const to struct pointers) allowing us to drop casts.
Effort: CHERI upstreaming
Reviewed by: vangyzen, glebius
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D54941
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `eachresult` argument is documented to take a function pointer of
type:
bool_t (*)(caddr_t, struct sockaddr_in *)
It was declared to take a resultproc_t which has historically been
declared to be:
bool_t (*resultproc_t)(caddr_t, ...);
This overlapped well enough for currently supported ABIs where variadic
arguments are passed in registers, but this declaration is misaligned
with the documentation (resultproc_t takes three arguments) and will be
fixed in a followup commit.
Fix the type to be non-variadic, matching callbacks, and define a
convenience type of as most callbacks take something other than a char *
as their first argument and need to be cast.
Effort: CHERI upstreaming
Reviewed by: ngie, glebius, jhb
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D54940
|