]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/utmp-wtmp.h
tree-wide: drop license boilerplate
[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
e537352b
LP
8***/
9
a8fbdf54
TA
10#include <stdbool.h>
11#include <sys/types.h>
12
13#include "time-util.h"
e537352b
LP
14#include "util.h"
15
3211da4b 16#if ENABLE_UTMP
e537352b
LP
17int utmp_get_runlevel(int *runlevel, int *previous);
18
0ad26e09 19int utmp_put_shutdown(void);
e537352b 20int utmp_put_reboot(usec_t timestamp);
0ad26e09 21int utmp_put_runlevel(int runlevel, int previous);
e537352b 22
169c1bda 23int utmp_put_dead_process(const char *id, pid_t pid, int code, int status);
023a4f67 24int utmp_put_init_process(const char *id, pid_t pid, pid_t sid, const char *line, int ut_type, const char *user);
169c1bda 25
99f710dd
DM
26int utmp_wall(
27 const char *message,
28 const char *username,
29 const char *origin_tty,
30 bool (*match_tty)(const char *tty, void *userdata),
31 void *userdata);
37161c51 32
3211da4b 33#else /* ENABLE_UTMP */
37161c51
ERB
34
35static inline int utmp_get_runlevel(int *runlevel, int *previous) {
36 return -ESRCH;
37}
38static inline int utmp_put_shutdown(void) {
39 return 0;
40}
41static inline int utmp_put_reboot(usec_t timestamp) {
42 return 0;
43}
44static inline int utmp_put_runlevel(int runlevel, int previous) {
45 return 0;
46}
47static inline int utmp_put_dead_process(const char *id, pid_t pid, int code, int status) {
48 return 0;
49}
023a4f67 50static 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
51 return 0;
52}
99f710dd
DM
53static inline int utmp_wall(
54 const char *message,
55 const char *username,
56 const char *origin_tty,
57 bool (*match_tty)(const char *tty, void *userdata),
3e7f33ad 58 void *userdata) {
37161c51
ERB
59 return 0;
60}
61
3211da4b 62#endif /* ENABLE_UTMP */