diff --git a/lib/libprocstat/libprocstat.c b/lib/libprocstat/libprocstat.c index f0542587cbdb..936bf867328a 100644 --- a/lib/libprocstat/libprocstat.c +++ b/lib/libprocstat/libprocstat.c @@ -2384,7 +2384,7 @@ procstat_getosrel(struct procstat *procstat, struct kinfo_proc *kp, int *osrelp) #define PROC_AUXV_MAX 256 -#if __ELF_WORD_SIZE == 64 +#ifdef PS_ARCH_HAS_FREEBSD32 static const char *elf32_sv_names[] = { "Linux ELF32", "FreeBSD ELF32", @@ -2467,7 +2467,7 @@ out: free(auxv32); return (auxv); } -#endif /* __ELF_WORD_SIZE == 64 */ +#endif /* PS_ARCH_HAS_FREEBSD32 */ static Elf_Auxinfo * procstat_getauxv_sysctl(pid_t pid, unsigned int *cntp) @@ -2476,7 +2476,7 @@ procstat_getauxv_sysctl(pid_t pid, unsigned int *cntp) int name[4]; size_t len; -#if __ELF_WORD_SIZE == 64 +#ifdef PS_ARCH_HAS_FREEBSD32 if (is_elf32_sysctl(pid)) return (procstat_getauxv32_sysctl(pid, cntp)); #endif diff --git a/lib/libprocstat/libprocstat.h b/lib/libprocstat/libprocstat.h index 0df01817663e..3d30b4db4018 100644 --- a/lib/libprocstat/libprocstat.h +++ b/lib/libprocstat/libprocstat.h @@ -102,6 +102,11 @@ #define PS_FST_FFLAG_EXEC 0x2000 #define PS_FST_FFLAG_HASLOCK 0x4000 +#if !defined(__ILP32__) && !defined(__riscv) +/* Target architecture supports 32-bit compat */ +#define PS_ARCH_HAS_FREEBSD32 1 +#endif + struct kinfo_kstack; struct kinfo_proc; struct kinfo_vmentry;