1 PLDT(3PROC)            Process Control Library Functions           PLDT(3PROC)
   2 
   3 NAME
   4      Pldt, proc_get_ldt - obtain local descriptor table of a process
   5 
   6 LIBRARY
   7      Process Control Library (libproc, -lproc)
   8 
   9 SYNOPSIS
  10      #include <libproc.h>
  11 
  12      int
  13      Pldt(struct ps_prochandle *P, struct ssd *pldt, int nldt);
  14 
  15      int
  16      proc_get_ldt(pid_t pid, struct ssd *pldt, int nldt);
  17 
  18 DESCRIPTION
  19      The Pldt() function reads the local descriptor table (LDT) of the process
  20      handle P into the buffer pldt.  Up to nldt entries will be read.
  21 
  22      If either pldt is NULL or nldt is 0, then rather than filling in pldt,
  23      only the number of entries currently in the LDT is returned.
  24 
  25      The buffer pldt should contain sufficient space for nldt entries.  For
  26      example, callers could allocate space as:
  27 
  28            pldt = malloc(sizeof (struct ssd) * nldt);
  29 
  30      For more information on the LDT and the struct ssd, see proc(4).
  31 
  32      The proc_get_ldt() function is similar to the Pldt() function; however,
  33      rather than reading from a process handle, it reads the ldt file from the
  34      /proc file system for the process pid.
  35 
  36 RETURN VALUES
  37      Upon successful completion, the Pldt() and proc_get_ldt() functions
  38      return the number of LDT entries written to pldt.  If pldt is NULL or
  39      nldt is zero, then no data will be written.  Otherwise, -1 is returned.
  40      The Pldt() function sets errno to indicate the error that occurred.
  41 
  42 ERRORS
  43      For a full list of possible errors see the DIAGNOSTICS section in
  44      proc(4).
  45 
  46      The Pldt() function will fail if:
  47 
  48      ENODATA            No LDT information is available in the process handle
  49                         P.
  50 
  51 ARCHITECTURE
  52      The Pldt() and proc_get_ldt() functions are only available on x86
  53      platforms.
  54 
  55 INTERFACE STABILITY
  56      Uncommitted
  57 
  58 MT-LEVEL
  59      See LOCKING in libproc(3LIB).
  60 
  61 SEE ALSO
  62      libproc(3LIB), proc(4)
  63 
  64 illumos                          May 11, 2016                          illumos