svn commit: r340641 - head/lib/libc/gen

Edward Tomasz Napierala trasz at FreeBSD.org
Mon Nov 19 18:23:20 UTC 2018


Author: trasz
Date: Mon Nov 19 18:23:17 2018
New Revision: 340641
URL: https://svnweb.freebsd.org/changeset/base/340641

Log:
  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

Modified:
  head/lib/libc/gen/sysconf.c

Modified: head/lib/libc/gen/sysconf.c
==============================================================================
--- head/lib/libc/gen/sysconf.c	Mon Nov 19 18:12:39 2018	(r340640)
+++ head/lib/libc/gen/sysconf.c	Mon Nov 19 18:23:17 2018	(r340641)
@@ -291,10 +291,7 @@ do_NAME_MAX:
 		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;


More information about the svn-src-head mailing list