Class MacOSProcessJNA

All Implemented Interfaces:
OSProcess

@ThreadSafe public class MacOSProcessJNA extends MacOSProcess
JNA-backed macOS OSProcess.
  • Constructor Details

    • MacOSProcessJNA

      public MacOSProcessJNA(int pid, int major, int minor, MacOperatingSystem os)
  • Method Details

    • queryArgsAndEnvironment

      protected Pair<List<String>, Map<String,String>> queryArgsAndEnvironment()
      Description copied from class: MacOSProcess
      Queries this process's arguments and environment via the backend-specific KERN_PROCARGS2 sysctl.
      Specified by:
      queryArgsAndEnvironment in class MacOSProcess
      Returns:
      a pair of the argument list and the environment map
    • queryLogicalProcessorCount

      protected int queryLogicalProcessorCount()
      Description copied from class: MacOSProcess
      Returns the number of logical processors via the backend-specific hw.logicalcpu sysctl.
      Specified by:
      queryLogicalProcessorCount in class MacOSProcess
      Returns:
      the logical processor count
    • getSoftOpenFileLimit

      public long getSoftOpenFileLimit()
      Description copied from interface: OSProcess
      Gets the soft limit for open file handles (or network connections) of the given process.

      Retrieving the soft limit for processes other than the calling process is only supported on Linux, FreeBsd and Solaris.

      Returns:
      the soft open file limit for the process if available. Returns -1 if the calling process is not the same as this OSProcess instance and the underlying operating system does not support retrieving the soft limit for other processes.
    • getHardOpenFileLimit

      public long getHardOpenFileLimit()
      Description copied from interface: OSProcess
      Gets the hard limit for open file handles (or network connections) that belong to the given process.

      Retrieving the hard limit for processes other than the calling process is only supported on Linux, FreeBsd and Solaris.

      Returns:
      the hard open file limit for the process if available. Returns -1 if the calling process is not the same as this OSProcess instance and the underlying operating system does not support retrieving the hard limit for other processes.
    • updateAttributes

      public boolean updateAttributes()
      Description copied from interface: OSProcess
      Attempts to update process attributes. Returns false if the update fails, which will occur if the process no longer exists.
      Returns:
      true if the update was successful, false if the update failed. In addition, on a failed update the process state will be changed to OSProcess.State.INVALID.