Module Procfs


module Procfs: sig .. end
Process and system stats

type bigint = Big_int.big_int 
Process and system stats

type stat = {
   comm : string; (*Process and system stats*)
   state : char; (*Process and system stats*)
   ppid : int; (*Process and system stats*)
   pgrp : int; (*Process and system stats*)
   session : int; (*Process and system stats*)
   tty_nr : int; (*Process and system stats*)
   tpgid : int; (*Process and system stats*)
   flags : bigint; (*Process and system stats*)
   minflt : bigint; (*Process and system stats*)
   cminflt : bigint; (*Process and system stats*)
   majflt : bigint; (*Process and system stats*)
   cmajflt : bigint; (*Process and system stats*)
   utime : bigint; (*Process and system stats*)
   stime : bigint; (*Process and system stats*)
   cutime : bigint; (*Process and system stats*)
   cstime : bigint; (*Process and system stats*)
   priority : bigint; (*Process and system stats*)
   nice : bigint; (*Process and system stats*)
   unused : bigint; (*Process and system stats*)
   itrealvalue : bigint; (*Process and system stats*)
   starttime : bigint; (*Process and system stats*)
   vsize : bigint; (*Process and system stats*)
   rss : bigint; (*Process and system stats*)
   rlim : bigint; (*Process and system stats*)
   startcode : bigint; (*Process and system stats*)
   endcode : bigint; (*Process and system stats*)
   startstack : bigint; (*Process and system stats*)
   kstkesp : bigint; (*Process and system stats*)
   signal : bigint; (*Process and system stats*)
   blocked : bigint; (*Process and system stats*)
   sigignore : bigint; (*Process and system stats*)
   sigcatch : bigint; (*Process and system stats*)
   wchan : bigint; (*Process and system stats*)
   nswap : bigint; (*Process and system stats*)
   cnswap : bigint; (*Process and system stats*)
   exit_signal : int; (*Process and system stats*)
   processor : int; (*Process and system stats*)
   rt_priority : bigint; (*Process and system stats*)
   policy : bigint; (*Process and system stats*)
}
type statm = {
   size : bigint; (*Process and system stats*)
   resident : bigint; (*Process and system stats*)
   share : bigint; (*Process and system stats*)
   text : bigint; (*Process and system stats*)
   lib : bigint; (*Process and system stats*)
   data : bigint; (*Process and system stats*)
   dt : bigint; (*Process and system stats*)
}
type status = {
   uid : int; (*Process and system stats*)
   euid : int; (*Process and system stats*)
   suid : int; (*Process and system stats*)
   fsuid : int; (*Process and system stats*)
}
type process = {
   pid : int; (*Process and system stats*)
   cmdline : string; (*Process and system stats*)
   cwd : string option; (*Process and system stats*)
   environ : string option; (*Process and system stats*)
   exe : string option; (*Process and system stats*)
   root : string option; (*Process and system stats*)
   stat : stat; (*Process and system stats*)
   statm : statm; (*Process and system stats*)
   status : status; (*Process and system stats*)
   top_command : string; (*Process and system stats*)
}
val get_all_procs : unit -> process list
get_all_procs returns a process list
val with_pid : int -> process
with_pid pid returns a single process that matches pid
val with_uid : int -> process list
with_uid uid returns all processes which belong to uid
val with_username : string -> process list
with_username user calls with_uid after looking up the user's uid
val hertz : float
hertz is the number of jiffies per second
val memtotal : int
memtotal is the amount of physical memory in the system, in kB