MPD  0.20.6
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
37 #else
38 static inline void
40 { /* nop */ }
41 #endif
42 
47 #ifndef WIN32
48 void
50 #else
51 #include "system/FatalError.hxx"
52 static inline void
54 {
55  FatalError("--kill is not available on WIN32");
56 }
57 #endif
58 
62 #ifndef WIN32
63 void
65 #else
66 static inline void
68 #endif
69 
73 #ifndef WIN32
74 void
76 #else
77 static inline void
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
94 #else
95 static inline void
97 #endif
98 
99 #endif
A path name in the native file system character set.
void daemonize_begin(bool detach)
void daemonize_close_stdin()
Close stdin (fd 0) and re-open it as /dev/null.
void daemonize_finish()
void daemonize_commit()
void daemonize_set_user()
Change to the configured Unix user.
void daemonize_init(const char *user, const char *group, AllocatedPath &&pidfile)
void daemonize_kill()
Kill the MPD which is currently running, pid determined from the pid file.
const Partition const char const SongFilter TagType group
Definition: Count.hxx:34
gcc_noreturn void FatalError(const char *msg)
Log the specified message and abort the process.