On Sat, 1 Aug 2026, Robert Swindells wrote:
Edgar Fu?? <[email protected]> wrote:
Didn't we have -o linux for things like that?
We do, the implementation of the emulated linux procfs is mingled in
with the NetBSD native stuff.
Indeed. -o linux is the default now, so the question is
what happens with -o nolinux (-o linux is no longer documented)
/proc/self/maps is documented as being for Linux compatibility,
but is explicitly excluded from the 'what happens if you specific -o
linux' list of files (which is itself wrong given the same man page only
documented -o nolinux).
The 'width' variable being modified by the patch is only used when
'-o linux' has been specified when mounting the filesystem.
If you don't give any options, you get what was historically enabled with
-o linux.
One review question could be whether it would be better to modify the
call to snprintf(3) to not use 'width' at all.
I think that /proc/self/maps should be implementation-compatible with
Linux. Not using width at all would not be compatible as Linux zero-pads
to 8 (but no more).
Henrique's question really is, does anything actually care about the
layout of maps outside of Linux apps (and Linuxy apps being built for
NetBSD)? If there are no counter-arguments, I'll commit his patch.
--
Stephen