mirror of
https://github.com/opnsense/src.git
synced 2026-06-04 22:32:43 -04:00
sysctl kern.supported_archs: return correct value
in case COMPAT_FREEBSD32 was enabled in config but hardware does not support executing 32bit binaries. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D42641
This commit is contained in:
parent
5a2bbacea5
commit
26b36a64be
1 changed files with 16 additions and 7 deletions
|
|
@ -316,16 +316,25 @@ SYSCTL_PROC(_hw, HW_MACHINE_ARCH, machine_arch, CTLTYPE_STRING | CTLFLAG_RD |
|
|||
CTLFLAG_CAPRD | CTLFLAG_MPSAFE, NULL, 0, sysctl_hw_machine_arch, "A",
|
||||
"System architecture");
|
||||
|
||||
#ifndef MACHINE_ARCHES
|
||||
#ifdef COMPAT_FREEBSD32
|
||||
#define MACHINE_ARCHES MACHINE_ARCH " " MACHINE_ARCH32
|
||||
#else
|
||||
#define MACHINE_ARCHES MACHINE_ARCH
|
||||
#endif
|
||||
#include <compat/freebsd32/freebsd32_util.h>
|
||||
#endif
|
||||
|
||||
SYSCTL_STRING(_kern, OID_AUTO, supported_archs, CTLFLAG_RD | CTLFLAG_MPSAFE,
|
||||
MACHINE_ARCHES, 0, "Supported architectures for binaries");
|
||||
static int
|
||||
sysctl_kern_supported_archs(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
const char *supported_archs;
|
||||
|
||||
supported_archs =
|
||||
#ifdef COMPAT_FREEBSD32
|
||||
compat_freebsd_32bit ? MACHINE_ARCH " " MACHINE_ARCH32 :
|
||||
#endif
|
||||
MACHINE_ARCH;
|
||||
return (SYSCTL_OUT(req, supported_archs, strlen(supported_archs) + 1));
|
||||
}
|
||||
SYSCTL_PROC(_kern, OID_AUTO, supported_archs, CTLFLAG_RD | CTLFLAG_MPSAFE |
|
||||
CTLFLAG_CAPRD | CTLTYPE_STRING, NULL, 0, sysctl_kern_supported_archs, "A",
|
||||
"Supported architectures for binaries");
|
||||
|
||||
static int
|
||||
sysctl_hostname(SYSCTL_HANDLER_ARGS)
|
||||
|
|
|
|||
Loading…
Reference in a new issue