]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/utmp-wtmp.h
resolved: rework parsing of /etc/hosts
[thirdparty/systemd.git] / src / shared / utmp-wtmp.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 #include <stdbool.h>
5 #include <sys/types.h>
6
7 #include "time-util.h"
8 #include "util.h"
9
10 #if ENABLE_UTMP
11 int utmp_get_runlevel(int *runlevel, int *previous);
12
13 int utmp_put_shutdown(void);
14 int utmp_put_reboot(usec_t timestamp);
15 int utmp_put_runlevel(int runlevel, int previous);
16
17 int utmp_put_dead_process(const char *id, pid_t pid, int code, int status);
18 int utmp_put_init_process(const char *id, pid_t pid, pid_t sid, const char *line, int ut_type, const char *user);
19
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);
26
27 #else /* ENABLE_UTMP */
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 }
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) {
45 return 0;
46 }
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),
52 void *userdata) {
53 return 0;
54 }
55
56 #endif /* ENABLE_UTMP */