This has the greatest impact on makewhatis, which used to make
thousands of calls to issetugid(2) via localtime(3) and strftime(3).
Inspired by a different diff from miod@. OK miod@
-/* $OpenBSD: main.c,v 1.263 2023/09/04 13:08:11 schwarze Exp $ */
+/* $OpenBSD: main.c,v 1.264 2024/03/29 01:01:00 millert Exp $ */
/*
* Copyright (c) 2010-2012, 2014-2021 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
argv += optind;
}
+ /* Avoid repeated TZ lookups, especially for makewhatis. */
+ tzset();
+
/*
* Quirks for help(1) and man(1),
* in particular for a section argument without -s.