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