The PS_STRINGS constant can easily be incorrect with mismatched kernel/userland - e.g. when building i386 sanitizers on FreeBSD/amd64 with -m32. The kern.ps_strings sysctl exists on all supported versions of FreeBSD and is the supported way to get the environment and argument strings, so we never use the PS_STRINGS fallback. Just remove it.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
I'm hoping to eventually move PS_STRINGS to be for the FreeBSD kernel only, and have started removing uses from the FreeBSD base system: https://svnweb.freebsd.org/changeset/base/297888
This seems to be in line with the rest of your commits in FreeBSD's base system, so LGTM.
Well, there's another point of view. Do we care about keeping the
PS_STRINGS for FreeBSD < 11? (Possibly <10.4 or <10.3)
Thank you,
Filipe
No, there's no need. I made a mistake in my FreeBSD commit message when I said kern.ps_strings is available in any FreeBSD release supported within the last decade -- it's actually much longer.
kern.ps_strings was actually introduced in r14235 over 20 years ago: https://svnweb.freebsd.org/changeset/base/14235
And in 1998 it was understood that "applications should use the kern.ps_strings sysctl instead of PS_STRINGS": https://svnweb.freebsd.org/changeset/base/41871