kvm_getproc man page on SmartOS

Man page or keyword search:  
man Server   16655 pages
apropos Keyword Search (all sections)
Output format
SmartOS logo
[printable version]


       kvm_nextproc, kvm_getproc, kvm_setproc - read system process structures

       cc [ flag... ] file... -lkvm [ library...]
       #include <kvm.h>
       #include <sys/param.h>
       #include <sys/time.h>
       #include <sys/proc.h>

       struct proc *kvm_nextproc(kvm_t *kd);

       int kvm_setproc(kvm_t *kd);

       struct proc *kvm_getproc(kvm_t *kd, pid_t pid);

       The  kvm_nextproc()  function  reads  sequentially  all	of  the system
       process	structures   from   the	  kernel   identified	by   kd	  (see
       kvm_open(3KVM)).	  Each call to kvm_nextproc() returns a pointer to the
       static memory area that contains a copy of the next valid process table
       entry.  There  is  no  guarantee that the data will remain valid across
       calls  to  kvm_nextproc(),  kvm_setproc(),  or  kvm_getproc().  If  the
       process	structure  must	 be saved, it should be copied to non-volatile

       For performance reasons, many implementations will cache a set of  sys‐
       tem  process  structures.  Since	 the  system state is liable to change
       between calls to kvm_nextproc(), and since the cache may contain	 obso‐
       lete  information,  there  is no guarantee that every process structure
       returned refers to an active process, nor is it certain that  all  pro‐
       cesses will be reported.

       The   kvm_setproc()   function	rewinds	 the  process  list,  enabling
       kvm_nextproc() to rescan from the beginning of the system  process  ta‐
       ble.   This  function  will  always  flush the process structure cache,
       allowing an application to re-scan the process table of a running  sys‐

       The  kvm_getproc()  function  locates the proc structure of the process
       specified by pid and returns a pointer to it.  Although	this  function
       does  not  interact  with  the  process	table  pointer	manipulated by
       kvm_nextproc(), the restrictions regarding the  validity	 of  the  data
       still apply.

       On  success,  kvm_nextproc()  returns  a	 pointer to a copy of the next
       valid process table entry. On failure, it returns NULL.

       On success, kvm_getproc() returns a pointer to the  proc	 structure  of
       the process specified by pid. On failure, it returns NULL.

       The kvm_setproc() function returns 0 on success and −1 on failure.

       See attributes(5) for descriptions of the following attributes:

       │Interface Stability │ Stable	      │
       │MT-Level	    │ Unsafe	      │

       kvm_getu(3KVM), kvm_open(3KVM), kvm_kread(3KVM), attributes(5)

				  May 2, 2002		    KVM_NEXTPROC(3KVM)

List of man pages available for SmartOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net