NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/57875: getconf: Suggested enhancement for portability



>Number:         57875
>Category:       bin
>Synopsis:       getconf: Suggested enhancement for portability
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 24 14:10:00 +0000 2024
>Originator:     Jason Bacon
>Release:        NetBSD 10
>Organization:
NA
>Environment:
NetBSD netbsd10.local 10.0_RC1 NetBSD 10.0_RC1 (GENERIC) #0: Sun Nov  5 18:30:08 UTC 2023  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC amd64

>Description:
NetBSD's getconf command currently does not tolerate a leading '_' in the variable name.

Linux requires an '_' and FreeBSD accepts variables with or without.

I'd suggest following FreeBSD's example, to make it easier to port scripts to NetBSD from other platforms.

NetBSD netbsd10.local  bacon ~ 12: getconf NPROCESSORS_CONF
2
NetBSD netbsd10.local  bacon ~ 13: getconf _NPROCESSORS_CONF
getconf: _NPROCESSORS_CONF: unknown variable

Linux alma8.local  bacon ~ 589: (pkgsrc): getconf NPROCESSORS_CONF
getconf: Unrecognized variable `NPROCESSORS_CONF'
Linux alma8.local  bacon ~ 589: (pkgsrc): getconf _NPROCESSORS_CONF
2

FreeBSD coral.acadix  bacon ~ 1004: getconf NPROCESSORS_CONF
4
FreeBSD coral.acadix  bacon ~ 1005: getconf _NPROCESSORS_CONF
4

>How-To-Repeat:
NetBSD netbsd10.local  bacon ~ 12: getconf NPROCESSORS_CONF
2
NetBSD netbsd10.local  bacon ~ 13: getconf _NPROCESSORS_CONF
getconf: _NPROCESSORS_CONF: unknown variable

>Fix:



Home | Main Index | Thread Index | Old Index