1 /*
2  * Stubs for systemd library functions.
3  *
4  * Provides empty stubs for sd_notify and sd_notifyf that do nothing and
5  * return 0, similar to the behavior of the proper library functions if not
6  * run under systemd.  Unsetting the environment (the first argument) is not
7  * supported.
8  *
9  * The canonical version of this file is maintained in the rra-c-util package,
10  * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
11  *
12  * Copyright 2021 Russ Allbery <eagle@eyrie.org>
13  *
14  * Copying and distribution of this file, with or without modification, are
15  * permitted in any medium without royalty provided the copyright notice and
16  * this notice are preserved.  This file is offered as-is, without any
17  * warranty.
18  *
19  * SPDX-License-Identifier: FSFAP
20  */
21 
22 #include "portable/sd-daemon.h"
23 #include "portable/macros.h"
24 
25 /* Used for unused parameters to silence gcc warnings. */
26 #define UNUSED __attribute__((__unused__))
27 
28 
29 int
sd_notify(int unset_environment UNUSED,const char * state UNUSED)30 sd_notify(int unset_environment UNUSED, const char *state UNUSED)
31 {
32     return 0;
33 }
34 
35 
36 int
sd_notifyf(int unset_environment UNUSED,const char * state UNUSED,...)37 sd_notifyf(int unset_environment UNUSED, const char *state UNUSED, ...)
38 {
39     return 0;
40 }
41