xref: /aosp_15_r20/external/cronet/base/process/process_info_mac.cc (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2022 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "base/process/process_info.h"
6 
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <unistd.h>
10 
11 extern "C" {
12 pid_t responsibility_get_pid_responsible_for_pid(pid_t);
13 }
14 
15 namespace base {
16 
IsProcessSelfResponsible()17 bool IsProcessSelfResponsible() {
18   const pid_t pid = getpid();
19   return responsibility_get_pid_responsible_for_pid(pid) == pid;
20 }
21 
22 }  // namespace base
23