MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- File List
- Globals

Daemon.hxx
Go to the documentation of this file.
1 /*
2 * Copyright 2003-2017 The Music Player Daemon Project
3 * http://www.musicpd.org
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #ifndef MPD_DAEMON_HXX
21 #define MPD_DAEMON_HXX
22
23 class AllocatedPath;
24
25 #ifndef WIN32
26 void
27 daemonize_init(const char *user, const char *group, AllocatedPath &&pidfile);
28 #else
29 static inline void
30 daemonize_init(const char *user, const char *group, AllocatedPath &&pidfile)
31 { (void)user; (void)group; (void)pidfile; }
32 #endif
33
34 #ifndef WIN32
35 void
36 daemonize_finish();
37 #else
38 static inline void
39 daemonize_finish()
40 { /* nop */ }
41 #endif
42
47 #ifndef WIN32
48 void
49 daemonize_kill();
50 #else
51 #include "system/FatalError.hxx"
52 static inline void
53 daemonize_kill()
54 {
55 FatalError("--kill is not available on WIN32");
56 }
57 #endif
58
62 #ifndef WIN32
63 void
64 daemonize_close_stdin();
65 #else
66 static inline void
67 daemonize_close_stdin() {}
68 #endif
69
73 #ifndef WIN32
74 void
75 daemonize_set_user();
76 #else
77 static inline void
78 daemonize_set_user()
79 { /* nop */ }
80 #endif
81
82 #ifndef WIN32
83 void
84 daemonize_begin(bool detach);
85 #else
86 static inline void
87 daemonize_begin(bool detach)
88 { (void)detach; }
89 #endif
90
91 #ifndef WIN32
92 void
93 daemonize_commit();
94 #else
95 static inline void
96 daemonize_commit() {}
97 #endif
98
99 #endif
AllocatedPath
A path name in the native file system character set.
Definition: AllocatedPath.hxx:38
daemonize_begin
void daemonize_begin(bool detach)
daemonize_close_stdin
void daemonize_close_stdin()
Close stdin (fd 0) and re-open it as /dev/null.
daemonize_finish
void daemonize_finish()
daemonize_commit
void daemonize_commit()
daemonize_set_user
void daemonize_set_user()
Change to the configured Unix user.
daemonize_init
void daemonize_init(const char *user, const char *group, AllocatedPath &&pidfile)
daemonize_kill
void daemonize_kill()
Kill the MPD which is currently running, pid determined from the pid file.
group
const Partition const char const SongFilter TagType group
Definition: Count.hxx:34
FatalError.hxx
FatalError
gcc_noreturn void FatalError(const char *msg)
Log the specified message and abort the process.