| KVM_GETLWPS(3) | Library Functions Manual | KVM_GETLWPS(3) | 
kvm_getlwps —
#include <kvm.h>
#include <sys/param.h>
#include <sys/sysctl.h>
struct kinfo_lwp *
  
  kvm_getlwps(kvm_t
    *kd, int pid,
    unsigned long procaddr,
    size_t elemsize,
    int *cnt);
kvm_getlwps() returns the set of LWPs belonging to the
  process specified by pid or
  procaddr in the kernel indicated by
  kd. The number of LWPs found is returned in the
  reference parameter cnt. The LWPs are returned as a
  contiguous array of kinfo_lwp structures. This memory is
  locally allocated, and subsequent calls to
  kvm_getlwps() and kvm_close()
  will overwrite this storage.
Only the first elemsize bytes of each array
    entry are returned. If the size of the kinfo_lwp structure
    increases in size in a future release of NetBSD the
    kernel will only return the requested amount of data for each array entry
    and programs that use kvm_getlwps() will continue to
    function without the need for recompilation.
If called against an active kernel, the
    kvm_getlwps() function will use the
    sysctl(3) interface and return
    information about the process identified by pid;
    otherwise the kernel memory device file or swap device will be accessed and
    the process is identified by the location passed in
    paddr.
kvm_getlwps() returns NULL on
  failure.
| January 9, 2018 | NetBSD 9.4 |