Module: OS::Mac::FFI::LibProc Private

Extended by:
NativeLibrary
Defined in:
os/mac/ffi/libproc.rb

Overview

This module is part of a private API. This module may only be used in the Homebrew/brew repository. Third parties should avoid using this module if possible, as it may be removed or changed without warning.

libproc wrapper

Constant Summary collapse

PROC_PIDT_SHORTBSDINFO =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

sys/proc_info.h:

#define PROC_PIDT_SHORTBSDINFO 13
13

Class Method Summary collapse

Class Method Details

.parent_pid(pid) ⇒ Integer?

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns nil if the process does not exist or cannot be inspected. Returns 0 for launchd, which has no parent.

Parameters:

Returns:



34
35
36
# File 'os/mac/ffi/libproc.rb', line 34

def self.parent_pid(pid)
  short_bsd_info_field(pid, PROC_BSDSHORTINFO_PPID_OFFSET)
end

.real_uid(pid) ⇒ Integer?

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

The real user ID, which decides whether the current user may signal the process.

Returns nil if the process does not exist or cannot be inspected.

Parameters:

Returns:



43
44
45
# File 'os/mac/ffi/libproc.rb', line 43

def self.real_uid(pid)
  short_bsd_info_field(pid, PROC_BSDSHORTINFO_RUID_OFFSET)
end