]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/utmp-wtmp.h
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / shared / utmp-wtmp.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
c2f1db8f 2#pragma once
e537352b
LP
3
4/***
5 This file is part of systemd.
6
7 Copyright 2010 Lennart Poettering
8
9 systemd is free software; you can redistribute it and/or modify it
5430f7f2
LP
10 under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation; either version 2.1 of the License, or
e537352b
LP
12 (at your option) any later version.
13
14 systemd is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5430f7f2 17 Lesser General Public License for more details.
e537352b 18
5430f7f2 19 You should have received a copy of the GNU Lesser General Public License
e537352b
LP
20 along with systemd; If not, see <http://www.gnu.org/licenses/>.
21***/
22
a8fbdf54
TA
23#include <stdbool.h>
24#include <sys/types.h>
25
26#include "time-util.h"
e537352b
LP
27#include "util.h"
28
3211da4b 29#if ENABLE_UTMP
e537352b
LP
30int utmp_get_runlevel(int *runlevel, int *previous);
31
0ad26e09 32int utmp_put_shutdown(void);
e537352b 33int utmp_put_reboot(usec_t timestamp);
0ad26e09 34int utmp_put_runlevel(int runlevel, int previous);
e537352b 35
169c1bda 36int utmp_put_dead_process(const char *id, pid_t pid, int code, int status);
023a4f67 37int utmp_put_init_process(const char *id, pid_t pid, pid_t sid, const char *line, int ut_type, const char *user);
169c1bda 38
99f710dd
DM
39int utmp_wall(
40 const char *message,
41 const char *username,
42 const char *origin_tty,
43 bool (*match_tty)(const char *tty, void *userdata),
44 void *userdata);
37161c51 45
3211da4b 46#else /* ENABLE_UTMP */
37161c51
ERB
47
48static inline int utmp_get_runlevel(int *runlevel, int *previous) {
49 return -ESRCH;
50}
51static inline int utmp_put_shutdown(void) {
52 return 0;
53}
54static inline int utmp_put_reboot(usec_t timestamp) {
55 return 0;
56}
57static inline int utmp_put_runlevel(int runlevel, int previous) {
58 return 0;
59}
60static inline int utmp_put_dead_process(const char *id, pid_t pid, int code, int status) {
61 return 0;
62}
023a4f67 63static inline int utmp_put_init_process(const char *id, pid_t pid, pid_t sid, const char *line, int ut_type, const char *user) {
37161c51
ERB
64 return 0;
65}
99f710dd
DM
66static inline int utmp_wall(
67 const char *message,
68 const char *username,
69 const char *origin_tty,
70 bool (*match_tty)(const char *tty, void *userdata),
3e7f33ad 71 void *userdata) {
37161c51
ERB
72 return 0;
73}
74
3211da4b 75#endif /* ENABLE_UTMP */