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