chiark / gitweb /
raw-clone: beef up raw_clone() wrapper a bit
authorLennart Poettering <lennart@poettering.net>
Fri, 29 Dec 2017 15:45:04 +0000 (16:45 +0100)
committerSven Eden <yamakuzure@gmx.net>
Wed, 30 May 2018 05:49:50 +0000 (07:49 +0200)
First of all, let's return pid_t, which appears to be the correct type
given that we return PIDs, and it#s what fork() uses too.

Most importantly though, flush out our PID cache, so that the call
becomes compatible with our getpid_cached() logic.

src/basic/process-util.c
src/basic/process-util.h

index 940302e6feb25629d56712db8dbbfee7a010628e..ca0d4426b4893d55cd4a8fc80ec77432d4e5749a 100644 (file)
@@ -1095,7 +1095,7 @@ int ioprio_parse_priority(const char *s, int *ret) {
 
 static pid_t cached_pid = CACHED_PID_UNSET;
 
-static void reset_cached_pid(void) {
+void reset_cached_pid(void) {
         /* Invoked in the child after a fork(), i.e. at the first moment the PID changed */
         cached_pid = CACHED_PID_UNSET;
 }
index efefbee4ad91738a6fd75c961e98de4bea576208..1609c48df1c17214db55902589b2763151010dd7 100644 (file)
@@ -161,6 +161,7 @@ int ioprio_parse_priority(const char *s, int *ret);
 #endif // 0
 
 pid_t getpid_cached(void);
+void reset_cached_pid(void);
 
 int must_be_root(void);