summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2020-07-16 17:47:10 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2020-07-16 17:47:10 +0000
commit97c46584575c23fb060b72f3a32c31e216886756 (patch)
tree22c8b02645976efc0fe4e3c6f65c57226b0cdf35 /lib/libc
parent9be5d82efd70d5c0ac67a96946167f028d872781 (diff)
allow setenv LIBC_NOUSERTC to disable userland timekeeping, for ktrace.
ok deraadt pirofti
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/dlfcn/init.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/dlfcn/init.c b/lib/libc/dlfcn/init.c
index 3df61076dff..c8e0542995c 100644
--- a/lib/libc/dlfcn/init.c
+++ b/lib/libc/dlfcn/init.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init.c,v 1.8 2020/07/06 13:33:05 pirofti Exp $ */
+/* $OpenBSD: init.c,v 1.9 2020/07/16 17:47:09 tedu Exp $ */
/*
* Copyright (c) 2014,2015 Philip Guenther <guenther@openbsd.org>
*
@@ -114,6 +114,8 @@ _libc_preinit(int argc, char **argv, char **envp, dl_cb_cb *cb)
_timekeep->tk_version != TK_VERSION)
_timekeep = NULL;
}
+ if (issetugid() == 0 && getenv("LIBC_NOUSERTC"))
+ _timekeep = NULL;
break;
}
}