Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibJS+LibCore: Some BSD Compatibility updates #24273

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ADKaster
Copy link
Member

@ADKaster ADKaster commented May 9, 2024

NetBSD and FreeBSD get upset when we don't set the fd to an invalid
value when using a non-shared mapping.

FreeBSD and NetBSD don't have secure_getenv(3), same as macOS.
FreeBSD 13 and lower also don't allow setting environ pointers to null.

Ref: #23375

cc @0-wiz-0
cc @clausecker

ADKaster and others added 2 commits May 9, 2024 12:18
NetBSD and FreeBSD get upset when we don't set the fd to an invalid
value when using a non-shared mapping.

Reported-By: Thomas Klausner <wiz@gatalith.at>
FreeBSD and NetBSD don't have secure_getenv(3), same as macOS.
FreeBSD 13 and lower also don't allow setting environ pointers to null.

Co-Authored-By: Robert Clausecker <fuz@FreeBSD.org>
@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label May 9, 2024
@ADKaster ADKaster changed the title LibJS+LibCore: Some BSD Compatability updates LibJS+LibCore: Some BSD Compatibility updates May 9, 2024
We were already linking librt to LibCore for shm_open and friends.
Now that we build the code that uses POSIX shm into LibCoreMinimal, we
need to link librt into that as well.
On some C libraries, like NetBSD and musl-libc, this under-specified
edge case results in a crash rather than silently ignoring the null
pointer.
@clausecker
Copy link

Correction: FreeBSD 14 and above do have secure_getenv. All FreeBSD versions allow clearing the environment by setting environ to NULL, but only FreeBSD 14 and above have clearenv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 pr-needs-review PR needs review from a maintainer or community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants