#include "missing_syscall.h"
#include "missing_threads.h"
#include "parse-util.h"
+#include "process-util.h"
#include "random-util.h"
#include "sha256.h"
#include "time-util.h"
.call_id = fallback_counter++,
.stamp_mono = now(CLOCK_MONOTONIC),
.stamp_real = now(CLOCK_REALTIME),
- .pid = getpid(),
+ .pid = getpid_cached(),
.tid = gettid(),
};
zero(plain_si);
plain_si.si_signo = SIGUSR2;
plain_si.si_code = SI_QUEUE;
- plain_si.si_pid = getpid();
+ plain_si.si_pid = getpid_cached();
plain_si.si_uid = getuid();
plain_si.si_value.sival_int = 4711;
#include "journal-send.h"
#include "memfd-util.h"
#include "missing_syscall.h"
+#include "process-util.h"
#include "socket-util.h"
#include "stdio-util.h"
#include "string-util.h"
if (!RUNNING_ON_VALGRIND)
return;
- if (getpid() != gettid())
+ if (getpid_cached() != gettid())
return;
if (fd_plus_one <= 0)
#include "main-func.h"
#include "parse-util.h"
#include "pretty-print.h"
+#include "process-util.h"
#include "string-util.h"
#include "strv.h"
#include "terminal-util.h"
* manager's PID (which might be distinct from
* 1, if we are a --user instance), that'd just
* be confusing for the service manager */
- arg_pid = getpid();
+ arg_pid = getpid_cached();
} else if (streq(optarg, "parent"))
arg_pid = getppid();
else if (streq(optarg, "self"))
- arg_pid = getpid();
+ arg_pid = getpid_cached();
else {
r = parse_pid(optarg, &arg_pid);
if (r < 0)
if (r == 0) {
_cleanup_close_ int parent_netns_fd = -EBADF;
- r = namespace_open(getpid(), NULL, NULL, &parent_netns_fd, NULL, NULL);
+ r = namespace_open(getpid_cached(), NULL, NULL, &parent_netns_fd, NULL, NULL);
if (r < 0) {
log_error_errno(r, "Failed to open parent network namespace: %m");
_exit(EXIT_FAILURE);
return log_error_errno(r, "Failed to fork() worker: %m");
}
if (r == 0) {
- DEVICE_TRACE_POINT(worker_spawned, event->dev, getpid());
+ DEVICE_TRACE_POINT(worker_spawned, event->dev, getpid_cached());
/* Worker process */
r = worker_main(manager, worker_monitor, sd_device_ref(event->dev));