pacemaker  2.0.2-debe490
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ipc_internal.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 the Pacemaker project contributors
3  *
4  * The version control history for this file may have further details.
5  *
6  * This source code is licensed under the GNU Lesser General Public License
7  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8  */
9 
10 #ifndef PCMK__IPC_INTERNAL_H
11 #define PCMK__IPC_INTERNAL_H
12 
13 #include <sys/types.h>
14 
15 #include <crm_config.h> /* US_AUTH_GETPEEREID */
16 
17 
18 /* denotes "non yieldable PID" on FreeBSD, or actual PID1 in scenarios that
19  require a delicate handling anyway (socket-based activation with systemd);
20  we can be reasonably sure that this PID is never possessed by the actual
21  child daemon, as it gets taken either by the proper init, or by pacemakerd
22  itself (i.e. this precludes anything else); note that value of zero
23  is meant to carry "unset" meaning, and better not to bet on/conditionalize
24  over signedness of pid_t */
25 #define PCMK__SPECIAL_PID 1
26 
27 #if defined(US_AUTH_GETPEEREID)
28 /* on FreeBSD, we don't want to expose "non-yieldable PID" (leading to
29  "IPC liveness check only") as its nominal representation, which could
30  cause confusion -- this is unambiguous as long as there's no
31  socket-based activation like with systemd (very improbable) */
32 #define PCMK__SPECIAL_PID_AS_0(p) (((p) == PCMK__SPECIAL_PID) ? 0 : (p))
33 #else
34 #define PCMK__SPECIAL_PID_AS_0(p) (p)
35 #endif
36 
66 int pcmk__ipc_is_authentic_process_active(const char *name, uid_t refuid,
67  gid_t refgid, pid_t *gotpid);
68 
69 #endif
int pcmk__ipc_is_authentic_process_active(const char *name, uid_t refuid, gid_t refgid, pid_t *gotpid)
Definition: ipc.c:1514