Commit graph

10034 commits

Author SHA1 Message Date
Christopher Davidson 96a2e036b7 Update manual page references and macros to align to mandoc syntax
xlocale.3: Comment out reference to atof_l(3), atoi_l(3), atol_l(3), atoll_l(3)
  These manual page references do not exist.

lagg.4: Change the reference for /etc/rc.conf from a reference link
  .Xr -> .Pa based on the context within the manual page it is used.

buf.9: Remove .Xr entries from the file
  The buf.9 manual page contains a commented out .Xr reference.
  The <filmmein> 9 entry is a placeholder and has been removed for
  clarity.

Reviewed by:	mhorne
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1114
2024-04-23 12:50:54 -03:00
rilysh bac2eea13a swab.c(libc): use a simplified version of byte swapping
This version of swab function simplifies the logic of swapping adjacent
bytes. Previous version of swab() used an arbitrary unrolling, which was
relevant back in the day but unnecessary for modern compilers, as if the
input size is known at compile time, they can do it automatically.

This version of swab() is inspired by musl.
A similar version can be found at: https://github.com/openbsd/src/blob/master/lib/libc/string/swab.c

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1086
2024-04-22 23:01:54 -06:00
Brooks Davis f0bd655a61 libc/quad: further narrow list of i386 symbols
It's unclear to me why lld didn't complain about these are they aren't
present and haven't been.  Instead ld.bfd complained.

Reviewed by:	dim
Fixes:		6e6cd03c91 libc/quad: narrow list of symbols exposed on i386
Differential Revision:	https://reviews.freebsd.org/D44879
2024-04-19 22:56:13 +01:00
Brooks Davis 6e83504c60 Revert "lib{c,sys}: normalize export of openat, setcontext, and swapcontext"
I put the symbols in the wrong file (should have been
lib/libc/sys/Symbol.map), added a duplicate pdfork entry due to a botch
rebase, and there seems to be a issue with gcc13/binutils not exposing
the symbols so revert the whole thing while I debug.

This reverts commit ee632fb9eb.
2024-04-19 22:25:04 +01:00
Brooks Davis ee632fb9eb lib{c,sys}: normalize export of openat, setcontext, and swapcontext
List them in the symbol map rather than using the __sym_default to
expose them.  This will allow later improvements in the stub
implementations in libc.so.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44113
2024-04-17 23:39:46 +01:00
Brooks Davis e0919a4bac libc/arm: export __signalcontext not _signalcontext
The former exists and architectures other than aarch64 and riscv provide
it.  The later does not exist.

Differential Revision:	https://reviews.freebsd.org/D44329
2024-04-16 22:14:21 +01:00
Brooks Davis 63b179b68d libc: don't try to export __sF
This symbol has been static since 2008 (commit 1e98f88776).

Differential Revision:	https://reviews.freebsd.org/D44188
2024-04-16 22:14:20 +01:00
Brooks Davis 88fcb61799 libc: don't try to export _nsdbtdump
It is only present when compiling nsdispatch.c with -D_NSS_DEBUG and we
provide no mechanism to do so.

Differential Revision:	https://reviews.freebsd.org/D44187
2024-04-16 22:14:20 +01:00
Brooks Davis 4d6722ec69 libc: don't try to export mexitcount
This requires that mcount.c be compiled with -DGUPROF and we provide no
mechanism to do so.

Differential Revision:	https://reviews.freebsd.org/D44186
2024-04-16 22:14:20 +01:00
Brooks Davis 1b10a30539 libc: don't try to export mpool_stat
This requires that mpool.c be compiled with -DSTATISTICS and we provide
no mechanism to do this.

Differential Revision:	https://reviews.freebsd.org/D44185
2024-04-16 22:14:20 +01:00
Brooks Davis 0dd2f4a0cc libc: only export hesiod symbols when enabled
Create a seperate symbol file for hesiod and conditionally include it.
This allows linkage with --no-undefined-version.

Differential Revision:	https://reviews.freebsd.org/D44184
2024-04-16 22:14:20 +01:00
Brooks Davis 7dd9070e44 libc: INTERPOS_SYS macro for interposed syscalls
This macro makes uses the __sys_<foo>_t typedefs from libsys.h to
greatly simplify calling functions in the interposing table.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44389
2024-04-16 17:48:08 +01:00
Brooks Davis 792081a730 lib{c,rt}: use libsys.h for __sys_* declerations
Use the genreated source of truth for system call declerations.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44388
2024-04-16 17:48:07 +01:00
Brooks Davis 418b4c2a80 acl_to_text: include sys/param.h for MAXLOGNAME
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44474
2024-04-15 21:35:41 +01:00
rilysh f362c952a5 libc(bt_utils.c): fix "contiguous" spelling
From "contigous" to "contiguous".

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1119
2024-04-12 16:34:55 -06:00
rilysh 0fc1fb1491 libc(bt_seq.c): fix "uninitialized" spelling
From "unitialized" to "uninitialized".

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1119
2024-04-12 16:34:54 -06:00
rilysh bdf5675a49 libc(xdr_reference.c): fix "referenced" spelling
From "referneced" to referenced".

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1119
2024-04-12 16:34:53 -06:00
rilysh 84970eab6a libc(xdr.c): fix "discriminated" spelling
From "descriminated" to "discriminated".

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1119
2024-04-12 16:34:52 -06:00
rilysh 9a7f7b2480 libc(inet_net_pton.c): fix "Fiery" spelling
From "Firey" to "Fiery".

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1119
2024-04-12 16:34:51 -06:00
rilysh 2f1da80f21 libc(localeconv.c): fix "appropriate" spelling
From "approprate" to "appropriate".

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1119
2024-04-12 16:34:51 -06:00
Minsoo Choo 7c7299df76 libc: Remove support for pre-C99 C standards
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D43254
2024-04-12 12:05:09 -07:00
rilysh 2a3d453049 exit.3: add the comma after an empty space
exit(3) man page shows __cxa_atexit(3,) instead of __cxa_atexit(3), in a
particular section. It seems the comma gets inside the parenthesis and
with an extra space, it can be viewed as expected.

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1006
2024-04-09 21:38:01 -06:00
Dag-Erling Smørgrav 7534109d13 libc: Improve description of mktime() / timegm().
* Mention that mktime() and timegm() set errno on failure.
* Correctly determining whether mktime() / timegm() succeeded with
  arbitrary input (where -1 can be a valid result) is non-trivial.
  Document the recommended procedure.

PR:		277863
MFC after:	1 week
Reviewed by:	pauamma_gundo.com, gbe
Differential Revision:	https://reviews.freebsd.org/D44503
2024-03-27 11:03:37 +01:00
Gordon Bergling 577a721d05 xdr(3): Fix a few typos in source code comments
- s/reoutines/routines/
- s/paraemters/parameters/

Obtained from:	NetBSD
MFC after:	3 days
2024-03-23 08:43:41 +01:00
Brooks Davis 312a05c39e riscv: remove more riscv64sf support
Remove a few more bits of riscv64sf support in libc and libm.

Reduce floating point ABI checks to requiring double hard float.

Reviewed by:	imp, jhb
Fixes:		1ca12bd927 Remove the riscv64sf architecture.
Differential Revision:	https://reviews.freebsd.org/D44334
2024-03-21 23:48:37 +00:00
Andrew Turner 5202ca77aa libc/aarch64: Add a non-trivial getcontextx
Add support for extra registers to the arm64 getcontextx. As no
registers are defined this just adds the extra register list and an end
context.

Reviewed by:	kib
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D44255
2024-03-21 10:13:24 +00:00
Andrew Turner fd6b1cc34e libc/aarch64: Copy the trivial getcontextx
This will be used as the base of a non-trivial implementation.

Reviewed by:	kib
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D44254
2024-03-21 10:13:24 +00:00
Konstantin Belousov 69d5783ae8 wmemchr(3): fix prototypes for wcpcpy() and wcpncpy()
PR:	277855
Reported by:	Paul Floyd <pjfloyd@wanadoo.fr>
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2024-03-21 10:40:08 +02:00
Baptiste Daroussin 3a9ddfa1ab pkgbase: install all libc test files into the tests package 2024-03-20 17:13:56 +01:00
Brooks Davis d0efabdf15 syscalls.master: make __sys_fcntl take an intptr_t
The (optional) third argument of fcntl is sometimes a pointer so change
the type to intptr_t.  Update the libc-internal defintion (actually used
by libthr) to take a fixed intptr_t argument rather than pretending it's
a variadic function.  (That worked because all supported architectures
pass variadic arguments as though the function was declared with those
types.  In CheriBSD that changes because variadic arguments are passed
via a bounded array.)

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44381
2024-03-19 23:13:26 +00:00
Brooks Davis b12090676c lib{c,sys}: correctly expose sched_getcpu
When moving the implementation, I failed to move the symbol entry.

Reviewed by:	kib
Fixes:		84dd0c080b libc: libc/gen/sched_getcpu_gen.c -> libsys/
Differential Revision:	https://reviews.freebsd.org/D44112
2024-03-15 22:52:07 +00:00
David E. O'Brien c4ff9276a9 strnlen(3): add HISTORY
Complete 4b7f35db's HISTORY's train of thought
2024-03-15 14:52:47 -07:00
Brooks Davis bf8a3a816d libc/softfloat: we don't export _fp[gs]et* symbols
Remove attempts to use NetBSD __weak_alias macros to export _-prefixed
versions of various fp[sg]et* symbols under softfloat.  __weak_alias
isn't defined so we didn't export them and thus the Symbol.map entries
were wrong.

Reviewed by:	jhibbits
Differential Revision:	https://reviews.freebsd.org/D44327
2024-03-13 20:35:41 +00:00
Brooks Davis d7847a8d35 lib{c,sys}: return wrapped syscall APIs to libc
These provide standard APIs, but are implemented using another system
call (e.g., pipe implemented in terms of pipe2) or are interposed by the
threading library to support cancelation.

After discussion with kib (see D44111), I've concluded that it is
better to keep most public interfaces in libc with as little
as possible in libsys.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44241
2024-03-13 18:36:02 +00:00
Brooks Davis ef5fddd344 libsys: make __libsys_interposing static
Access __libsys_interposing with __libc_interposing_slot() in all
cases to support a move of these wrappers back to libc.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44239
2024-03-13 17:31:48 +00:00
Brooks Davis f7dbbbd176 libsys: don't expose sigwait wrapper
Long ago (e129c18a83) __sys_sigwait was wrapped to prevent sigwait()
from returning with EINTR.  Through a series of changes this wrapper
become __libc_sigwait which was internal to libc and used solely in the
interposing table.  To support a move of sigwait back to libc, move this
wrapper into libsys and rename it with an __libsys_ prefix.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44238
2024-03-13 17:04:07 +00:00
Brooks Davis a3a4bea49c libc: remove remnants of __fcntl_compat
Reviewed by:	kib
Fixes:		60b2e2d3ee libc: stop exposing __fcntl_compat
Differential Revision:	https://reviews.freebsd.org/D44326
2024-03-13 16:52:49 +00:00
Warner Losh 7a0a6b276c libc: Move tzset.3 to stdtime
This really belongs in stddime, since it documents interfaces
implemented in stdtime.

Suggested by:	brooks
Sponsored by:	Netflix
2024-03-11 22:19:31 -06:00
Warner Losh a34940a975 timezone: Move to the XSI/POSIX definition for timezone.
The old timezone(3) function has long since been obsolete and has a
fatally flawed interface. Retain this function for compatibility
purposes, but shift to providing the offset from UTC in the timezone
variable, whether or not the timezone observes summer time in the
'daylight' variable. Document the tzname variable that's already been
set. Also make _tztab() static. It's not used in libc (or anywhere in
the tree) and it's not exported as a public dynamic symbol.

Sponsored by:		Netflix
Reviewed by:		brooks, kib
Differential Revision:	https://reviews.freebsd.org/D44281
2024-03-11 22:19:31 -06:00
Brooks Davis 32c7350beb libc/i386: don't attempt to export alloca
The assembly implementation was removed in 2006 (commit 3c03c7095e).

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44242
2024-03-07 20:14:55 +00:00
Brooks Davis 6e6cd03c91 libc/quad: narrow list of symbols exposed on i386
These symbols aren't present on i386 so don't try to expose them.

Given the structure of quad/Makefile.inc, it might make more sense to
have per-arch symbol maps here, but this is sufficent to build with
WITHOUT_UNDEFINED_VERSION on i386.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44243
2024-03-07 20:12:22 +00:00
Brooks Davis 8c8882ce96 libc/iconv: don't export nonexistant symbols
It's unclear to me that any of these symbols ever existed.  The ones
I've spot checked are only mentioned in the initial Citrus iconv import
(commit ad30f8e79b) and this code hasn't changed much over time.

Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D44183
2024-03-07 20:12:22 +00:00
Brooks Davis 8c94ed9927 bsearch_b: fix compilation with gcc
Reported by:	rscheff
Differential Revision:	https://reviews.freebsd.org/D44256
2024-03-06 19:46:12 +00:00
Konstantin Belousov 2ce23b1f76 libc posix_spawn(): explain why rtld can be used after fork
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-03-06 09:25:14 +02:00
Konstantin Belousov ebaf907114 posix_spawn.c: fix typo in comment
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-03-06 09:25:02 +02:00
Brooks Davis 7e8e73fed5 libc: actually build bsearch_b
Fixes:		46cdc14062 Add support for some block functions ...

Reviewed by:	theraven
Differential Revision:	https://reviews.freebsd.org/D44189
2024-03-05 01:01:56 +00:00
Brooks Davis ec911a4f10 libc/locale: don't expose nonexistant __collate_load_error
The private symbol __collate_load_error was removed in 2015 in commit
2a6abeebef.  While it had previously been accidently removed in 2011
(commit 3c87aa1d3dc1a) and restored in 2012 (commit bb4317bf3c) I
think it's time to write it off after four major releases without it.

Fixes:		2a6abeebef The collate functions within libc have...

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D44182
2024-03-05 01:00:50 +00:00
Konstantin Belousov a725a7a24d posix_spawn(3): document POSIX_SPAWN_DISABLE_ASLR_NP
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-03-04 03:00:39 +02:00
Konstantin Belousov 822042fdfc posix_spawn(3): add POSIX_SPAWN_DISABLE_ASLR_NP
similar to Apple _POSIX_SPAWN_DISABLE_ASLR

Reviewed by:	emaste, kevans
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44195
2024-03-04 03:00:38 +02:00
Konstantin Belousov 80ac36c3a2 posix_spawnattr_setflags(3): validate argument
Reviewed by:	emaste, kevans
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44195
2024-03-04 03:00:38 +02:00