From 3a9cdc513257af5364923bd027aec0fa27a337cd Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Mon, 19 Nov 2018 18:23:17 +0000 Subject: [PATCH] Make sysconf(_SC_PAGESIZE) return the value from getpagesize(3). That avoids a syscall - getpagesize(3) gets the value from the ELF aux strings. Reviewed by: kib MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17989 --- lib/libc/gen/sysconf.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c index c33c73dfb27a..26bb9043ed3c 100644 --- a/lib/libc/gen/sysconf.c +++ b/lib/libc/gen/sysconf.c @@ -291,10 +291,7 @@ sysconf(int name) mib[1] = CTL_P1003_1B_MQ_OPEN_MAX; goto yesno; case _SC_PAGESIZE: - defaultresult = getpagesize(); - mib[0] = CTL_P1003_1B; - mib[1] = CTL_P1003_1B_PAGESIZE; - goto yesno; + return (getpagesize()); case _SC_RTSIG_MAX: mib[0] = CTL_P1003_1B; mib[1] = CTL_P1003_1B_RTSIG_MAX;