Class PsInfo

java.lang.Object
oshi.driver.unix.aix.PsInfo

@ThreadSafe public final class PsInfo extends Object
Utility to query /proc/psinfo
  • Method Details

    • queryPsInfo

      public static AixLibc.AixPsInfo queryPsInfo(int pid)
      Reads /proc/pid/psinfo and returns data in a structure
      Parameters:
      pid - The process ID
      Returns:
      A structure containing information for the requested process
    • queryLwpsInfo

      public static AixLibc.AixLwpsInfo queryLwpsInfo(int pid, int tid)
      Reads /proc/pid/lwp/tid/lwpsinfo and returns data in a structure
      Parameters:
      pid - The process ID
      tid - The thread ID (lwpid)
      Returns:
      A structure containing information for the requested thread
    • queryArgsEnvAddrs

      public static Triplet<Integer,Long,Long> queryArgsEnvAddrs(int pid, AixLibc.AixPsInfo psinfo)
      Reads the pr_argc, pr_argv, and pr_envp fields from /proc/pid/psinfo
      Parameters:
      pid - The process ID
      psinfo - A populated AixLibc.AixPsInfo structure containing the offset pointers for these fields
      Returns:
      A triplet containing the argc, argv, and envp values, or null if unable to read
    • queryArgsEnv

      public static Pair<List<String>,Map<String,String>> queryArgsEnv(int pid, AixLibc.AixPsInfo psinfo)
      Read the argument and environment strings from process address space
      Parameters:
      pid - the process id
      psinfo - A populated AixLibc.AixPsInfo structure containing the offset pointers for these fields
      Returns:
      A pair containing a list of the arguments and a map of environment variables