File: sd-daemon.c

package info (click to toggle)
remctl 3.18-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,612 kB
  • sloc: ansic: 19,504; sh: 5,386; perl: 1,778; java: 740; makefile: 715; xml: 502; python: 430
file content (40 lines) | stat: -rw-r--r-- 1,129 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
 * Stubs for systemd library functions.
 *
 * Provides empty stubs for sd_notify and sd_notifyf that do nothing and
 * return 0, similar to the behavior of the proper library functions if not
 * run under systemd.  Unsetting the environment (the first argument) is not
 * supported.
 *
 * The canonical version of this file is maintained in the rra-c-util package,
 * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
 *
 * Copyright 2021 Russ Allbery <eagle@eyrie.org>
 *
 * Copying and distribution of this file, with or without modification, are
 * permitted in any medium without royalty provided the copyright notice and
 * this notice are preserved.  This file is offered as-is, without any
 * warranty.
 *
 * SPDX-License-Identifier: FSFAP
 */

#include <portable/macros.h>
#include <portable/sd-daemon.h>

/* Used for unused parameters to silence gcc warnings. */
#define UNUSED __attribute__((__unused__))


int
sd_notify(int unset_environment UNUSED, const char *state UNUSED)
{
    return 0;
}


int
sd_notifyf(int unset_environment UNUSED, const char *state UNUSED, ...)
{
    return 0;
}