serenity
serenity copied to clipboard
LibJS+LibCore: Some BSD Compatibility updates
trafficstars
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
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.