summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/sysconf.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2016-03-20 02:32:39 +0000
committerguenther <guenther@openbsd.org>2016-03-20 02:32:39 +0000
commit5af055cd66b5450a4935ae30e5716331ca3b13d5 (patch)
tree6fa66dcb9c9653fb1659c185234178493d593968 /lib/libc/gen/sysconf.c
parentPrepare for future ld.so/libc bump: update <tib.h> with the definitions (diff)
downloadwireguard-openbsd-5af055cd66b5450a4935ae30e5716331ca3b13d5.tar.xz
wireguard-openbsd-5af055cd66b5450a4935ae30e5716331ca3b13d5.zip
Rearrange C runtime bits: now that ld.so exports environ and __progname,
move their definitions and initialization in static links to libc.a Make crt0 always invoke a new func _csu_finish() in libc to process the auxv and to either register the ld.so cleanup function (in dynamic links) or initialize environ and __progname and do MC_DISABLE_KBIND (in static links). In libc, get pagesize from auxv; cache that between getpagesize() and sysconf(_SC_PAGESIZE) ok mpi@ "good time" deraadt@
Diffstat (limited to 'lib/libc/gen/sysconf.c')
-rw-r--r--lib/libc/gen/sysconf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c
index 3f39418f026..03becb59eec 100644
--- a/lib/libc/gen/sysconf.c
+++ b/lib/libc/gen/sysconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysconf.c,v 1.23 2015/09/12 14:56:50 guenther Exp $ */
+/* $OpenBSD: sysconf.c,v 1.24 2016/03/20 02:32:40 guenther Exp $ */
/*-
* Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
@@ -131,6 +131,8 @@ sysconf(int name)
/* 1003.1b */
case _SC_PAGESIZE:
+ if (_pagesize != 0)
+ return (_pagesize);
mib[0] = CTL_HW;
mib[1] = HW_PAGESIZE;
break;