pidref: now that we have the cached pidfdid of our own process, use it
Note that this drops a lot of "const" qualifiers on PidRef arguments. That's because pidref_is_self() suddenly might end changing the PidRef because it acquires the pidfd ID. We had this previously already with pidfd_equal(), but this amplifies the problem. I guess we C's "const" doesn't really work for stuff that contains caches, that is just conceptually constant, but not actually.
This commit is contained in:
@@ -90,9 +90,9 @@ int getenv_for_pid(pid_t pid, const char *field, char **_value);
|
||||
int pid_is_alive(pid_t pid);
|
||||
int pidref_is_alive(const PidRef *pidref);
|
||||
int pid_is_unwaited(pid_t pid);
|
||||
int pidref_is_unwaited(const PidRef *pidref);
|
||||
int pidref_is_unwaited(PidRef *pidref);
|
||||
int pid_is_my_child(pid_t pid);
|
||||
int pidref_is_my_child(const PidRef *pidref);
|
||||
int pidref_is_my_child(PidRef *pidref);
|
||||
int pidref_from_same_root_fs(PidRef *a, PidRef *b);
|
||||
|
||||
bool is_main_thread(void);
|
||||
|
||||
Reference in New Issue
Block a user