diff options
author | 2020-07-16 17:47:09 +0000 | |
---|---|---|
committer | 2020-07-16 17:47:09 +0000 | |
commit | 22966de3a988c70385bf69a6fcbd81a93a044452 (patch) | |
tree | 1f68240c84241d4532ae0a9fa3206ad58503410b /lib/libc | |
parent | Remove unused assignment. (diff) | |
download | wireguard-openbsd-22966de3a988c70385bf69a6fcbd81a93a044452.tar.xz wireguard-openbsd-22966de3a988c70385bf69a6fcbd81a93a044452.zip |
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.c | 4 |
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; } } |