History log of /src/lib/libc/gen/sysconf.c (Results 1 – 25 of 213)
Revision Date Author Comments
# d617806a 29-Oct-2025 Kyle Evans <kevans@FreeBSD.org>

libc: report _SC_NPROCESSORS_ONLN more accurately in cpu-limited jails

We don't support CPU hotplug, but we do support cpuset(8) restrictions
on jails (including prison0, which uses cpuset 1). The

libc: report _SC_NPROCESSORS_ONLN more accurately in cpu-limited jails

We don't support CPU hotplug, but we do support cpuset(8) restrictions
on jails (including prison0, which uses cpuset 1). The process cannot
widen its cpuset beyond its root set, so it makes sense to instead
report the number of cpus enabled there rather than the total number
in the system.

This change is effectively a nop for the majority of systems and jails
in the wild, though it does reduce the performance of this query now
that we can't take advantage of AT_NCPUS being provided in the auxinfo.

The implementation here is notably different than Linux, which would not
take cgroups into account. They do, however, take CPU hotplug into
account, so the possibility for it to diverge from (and be lower than)
the # configured count to reflect what the process can actually be
scheduled on doesn't really diverge in semantics.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D52295

show more ...


# df8bc705 27-Sep-2025 Dag-Erling Smørgrav <des@FreeBSD.org>

tzcode: Fix issues when TZ is an absolute path

* If TZ starts with TZDIR, strip any additional slashes so relname
does not end up looking like an absolute path. For instance,
TZ=/usr/share/zone

tzcode: Fix issues when TZ is an absolute path

* If TZ starts with TZDIR, strip any additional slashes so relname
does not end up looking like an absolute path. For instance,
TZ=/usr/share/zoneinfo//UTC should result in UTC, not /UTC.

* In the setugid case, we were incorrectly passing name rather than
relname to fstatat().

* Modify the tz_env and tz_env_setugid test cases to exercise both
of these scenarios.

* Also add test cases for invalid values of TZ, which I wrote
earlier but forgot to include in a5f14e4f9069.

Reported by: Paul Eggert <eggert@cs.ucla.edu>
MFC after: 3 days
Fixes: 967a49a21a27 ("Update tzcode to 2025b")
Fixes: a5f14e4f9069 ("tzcode: Use -00 only for invalid time zones")
Reviewed by: philip
Differential Revision: https://reviews.freebsd.org/D52753

show more ...


# 86f06e61 25-May-2025 Ricardo Branco <rbranco@suse.de>

Add POSIX NSIG_MAX & _SC_NSIG

Signed-off-by: Ricardo Branco <rbranco@suse.de>
Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1710
Closes: https://github.com/freebsd/

Add POSIX NSIG_MAX & _SC_NSIG

Signed-off-by: Ricardo Branco <rbranco@suse.de>
Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1710
Closes: https://github.com/freebsd/freebsd-src/pull/1710

show more ...


# 98af94ca 24-May-2025 Konstantin Belousov <kib@FreeBSD.org>

sysconf(3): add _SC_UEXTERR_LEN, the max length of the extended error string

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebs

sysconf(3): add _SC_UEXTERR_LEN, the max length of the extended error string

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D50483

show more ...


# eba40392 24-May-2025 Konstantin Belousov <kib@FreeBSD.org>

libc: set close-on-exec for temp socket used to detect IPv6 support

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D50509


# 46c59934 13-Feb-2024 Dag-Erling Smørgrav <des@FreeBSD.org>

Update tzcode to 2024a.

MFC after: 3 weeks
Sponsored by: Klara, Inc.


# dc36d6f9 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

lib: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl s

lib: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix

show more ...


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 3d5db455 24-Nov-2018 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r340427 through r340868.


# 3a9cdc51 19-Nov-2018 Edward Tomasz Napierala <trasz@FreeBSD.org>

Make sysconf(_SC_PAGESIZE) return the value from getpagesize(3).
That avoids a syscall - getpagesize(3) gets the value from the ELF
aux strings.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: DAR

Make sysconf(_SC_PAGESIZE) return the value from getpagesize(3).
That avoids a syscall - getpagesize(3) gets the value from the ELF
aux strings.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17989

show more ...


# d617806a 29-Oct-2025 Kyle Evans <kevans@FreeBSD.org>

libc: report _SC_NPROCESSORS_ONLN more accurately in cpu-limited jails

We don't support CPU hotplug, but we do support cpuset(8) restrictions
on jails (including prison0, which uses cpuset 1). The

libc: report _SC_NPROCESSORS_ONLN more accurately in cpu-limited jails

We don't support CPU hotplug, but we do support cpuset(8) restrictions
on jails (including prison0, which uses cpuset 1). The process cannot
widen its cpuset beyond its root set, so it makes sense to instead
report the number of cpus enabled there rather than the total number
in the system.

This change is effectively a nop for the majority of systems and jails
in the wild, though it does reduce the performance of this query now
that we can't take advantage of AT_NCPUS being provided in the auxinfo.

The implementation here is notably different than Linux, which would not
take cgroups into account. They do, however, take CPU hotplug into
account, so the possibility for it to diverge from (and be lower than)
the # configured count to reflect what the process can actually be
scheduled on doesn't really diverge in semantics.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D52295

show more ...


# df8bc705 27-Sep-2025 Dag-Erling Smørgrav <des@FreeBSD.org>

tzcode: Fix issues when TZ is an absolute path

* If TZ starts with TZDIR, strip any additional slashes so relname
does not end up looking like an absolute path. For instance,
TZ=/usr/share/zone

tzcode: Fix issues when TZ is an absolute path

* If TZ starts with TZDIR, strip any additional slashes so relname
does not end up looking like an absolute path. For instance,
TZ=/usr/share/zoneinfo//UTC should result in UTC, not /UTC.

* In the setugid case, we were incorrectly passing name rather than
relname to fstatat().

* Modify the tz_env and tz_env_setugid test cases to exercise both
of these scenarios.

* Also add test cases for invalid values of TZ, which I wrote
earlier but forgot to include in a5f14e4f9069.

Reported by: Paul Eggert <eggert@cs.ucla.edu>
MFC after: 3 days
Fixes: 967a49a21a27 ("Update tzcode to 2025b")
Fixes: a5f14e4f9069 ("tzcode: Use -00 only for invalid time zones")
Reviewed by: philip
Differential Revision: https://reviews.freebsd.org/D52753

show more ...


# 86f06e61 25-May-2025 Ricardo Branco <rbranco@suse.de>

Add POSIX NSIG_MAX & _SC_NSIG

Signed-off-by: Ricardo Branco <rbranco@suse.de>
Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1710
Closes: https://github.com/freebsd/

Add POSIX NSIG_MAX & _SC_NSIG

Signed-off-by: Ricardo Branco <rbranco@suse.de>
Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1710
Closes: https://github.com/freebsd/freebsd-src/pull/1710

show more ...


# 98af94ca 24-May-2025 Konstantin Belousov <kib@FreeBSD.org>

sysconf(3): add _SC_UEXTERR_LEN, the max length of the extended error string

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebs

sysconf(3): add _SC_UEXTERR_LEN, the max length of the extended error string

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D50483

show more ...


# eba40392 24-May-2025 Konstantin Belousov <kib@FreeBSD.org>

libc: set close-on-exec for temp socket used to detect IPv6 support

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D50509


# 46c59934 13-Feb-2024 Dag-Erling Smørgrav <des@FreeBSD.org>

Update tzcode to 2024a.

MFC after: 3 weeks
Sponsored by: Klara, Inc.


# dc36d6f9 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

lib: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl s

lib: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix

show more ...


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 3d5db455 24-Nov-2018 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r340427 through r340868.


# 3a9cdc51 19-Nov-2018 Edward Tomasz Napierala <trasz@FreeBSD.org>

Make sysconf(_SC_PAGESIZE) return the value from getpagesize(3).
That avoids a syscall - getpagesize(3) gets the value from the ELF
aux strings.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: DAR

Make sysconf(_SC_PAGESIZE) return the value from getpagesize(3).
That avoids a syscall - getpagesize(3) gets the value from the ELF
aux strings.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17989

show more ...


# c1920558 03-Jul-2018 John Baldwin <jhb@FreeBSD.org>

Clean up the vcs ID strings in libc's gen/ directory.

- Move CSRG IDs into __SCCSID().
- When a file has been copied, consistently use 'From: <tag>' for strings
referencing the version of the sour

Clean up the vcs ID strings in libc's gen/ directory.

- Move CSRG IDs into __SCCSID().
- When a file has been copied, consistently use 'From: <tag>' for strings
referencing the version of the source file copied from in the license
block comment.
- Some of the 'From:' tags were using $FreeBSD$ that was being expanded on
each checkout. Fix those to hardcode the FreeBSD tag from the file that
was copied at the time of the copy.
- When multiple strings are present list them in "chronological" order,
so CSRG (__SCCSID) before FreeBSD (__FBSDID). If a file came from
OtherBSD and contains a CSRG ID from the OtherBSD file, use the order
CSRG -> OtherBSD -> FreeBSD.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D15831

show more ...


# 82725ba9 23-Nov-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Merge ^/head r325999 through r326131.


# 8a16b7a1 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier f

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.

show more ...


# f6ef11cc 12-Apr-2017 Konstantin Belousov <kib@FreeBSD.org>

Report _SC_SEM_NSEMS_MAX and _SC_SEM_VALUE_MAX which show parameters
of the current usermode implementation of the POSIX semaphores.

For NSEMS_MAX, return -1 without changing errno, which indicates

Report _SC_SEM_NSEMS_MAX and _SC_SEM_VALUE_MAX which show parameters
of the current usermode implementation of the POSIX semaphores.

For NSEMS_MAX, return -1 without changing errno, which indicates that
the variable has no limit. Before, sysconf(3) returned parameters
queried from the ksem(9) legacy implementation, which apparently has
low defaults for NSEMS_MAX.

Reported and tested by: jbeich
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

show more ...


# 348238db 01-Mar-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r314420 through r314481.


123456789