kvm_nextproc(3kvm) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

kvm_nextproc(3kvm)

kvm_nextproc(3KVM)        Kernel VM Library Functions       kvm_nextproc(3KVM)

NAME
       kvm_nextproc, kvm_getproc, kvm_setproc - read system process structures

SYNOPSIS
       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);

DESCRIPTION
       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
       storage.


       For  performance reasons, many implementations will cache a set of sys‐
       tem process structures. Since the system state is liable to change  be‐
       tween calls to kvm_nextproc(), and since the cache may contain obsolete
       information,  there  is  no  guarantee that every process structure re‐
       turned refers to  an  active  process,  nor  is  it  certain  that  all
       processes 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, al‐
       lowing an application to re-scan the process table of a running system.


       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.

RETURN VALUES
       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.

ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:

       tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE  TYPEAT‐
       TRIBUTE VALUE _ Interface StabilityCommitted _ MT-LevelUnsafe


SEE ALSO
       kvm_getu(3KVM), kvm_kread(3KVM), kvm_open(3KVM), attributes(7)

Oracle Solaris 11.4               2 May 2002                kvm_nextproc(3KVM)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3