]>
Commit | Line | Data |
---|---|---|
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 |
11 | int utmp_get_runlevel(int *runlevel, int *previous); |
12 | ||
0ad26e09 | 13 | int utmp_put_shutdown(void); |
e537352b | 14 | int utmp_put_reboot(usec_t timestamp); |
0ad26e09 | 15 | int utmp_put_runlevel(int runlevel, int previous); |
e537352b | 16 | |
169c1bda | 17 | int utmp_put_dead_process(const char *id, pid_t pid, int code, int status); |
023a4f67 | 18 | int 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 |
20 | int 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 | |
29 | static inline int utmp_get_runlevel(int *runlevel, int *previous) { | |
30 | return -ESRCH; | |
31 | } | |
32 | static inline int utmp_put_shutdown(void) { | |
33 | return 0; | |
34 | } | |
35 | static inline int utmp_put_reboot(usec_t timestamp) { | |
36 | return 0; | |
37 | } | |
38 | static inline int utmp_put_runlevel(int runlevel, int previous) { | |
39 | return 0; | |
40 | } | |
41 | static inline int utmp_put_dead_process(const char *id, pid_t pid, int code, int status) { | |
42 | return 0; | |
43 | } | |
023a4f67 | 44 | static 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 |
47 | static 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 */ |