exp2l: Work around a NetBSD 10.0/i386 bug.
[gnulib.git] / lib / boot-time.h
blob99684323ec6d16f17deb8362ac3d88f369eb9ad6
1 /* Determine the time when the machine last booted.
2 Copyright (C) 2023-2024 Free Software Foundation, Inc.
4 This file is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published
6 by the Free Software Foundation, either version 3 of the License,
7 or (at your option) any later version.
9 This file is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <https://www.gnu.org/licenses/>. */
17 /* Written by Bruno Haible <bruno@clisp.org>. */
19 #ifndef _BOOT_TIME_H
20 #define _BOOT_TIME_H
22 #include <time.h>
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
29 /* Store the approximate time when the machine last booted in *P_BOOT_TIME,
30 and return 0. If it cannot be determined, return -1.
32 This function is not multithread-safe, since on many platforms it
33 invokes the functions setutxent, getutxent, endutxent. These
34 functions are needed because they may lock FILE (so that we don't
35 read garbage when a concurrent process writes to FILE), but their
36 drawback is that they have a common global state. */
37 extern int get_boot_time (struct timespec *p_boot_time);
40 #ifdef __cplusplus
42 #endif
44 #endif /* _BOOT_TIME_H */