PLDT(3PROC) Process Control Library Functions PLDT(3PROC)
Pldt, proc_get_ldt - obtain local descriptor table of a process
Process Control Library (libproc, -lproc)
#include <libproc.h>
int
Pldt(struct ps_prochandle *P, struct ssd *pldt, int nldt);
int
proc_get_ldt(pid_t pid, struct ssd *pldt, int nldt);
The Pldt() function reads the local descriptor table (LDT) of the
process handle P into the buffer pldt. Up to nldt entries will be
read.
If either pldt is NULL or nldt is 0, then rather than filling in pldt,
only the number of entries currently in the LDT is returned.
The buffer pldt should contain sufficient space for nldt entries. For
example, callers could allocate space as:
pldt = malloc(sizeof (struct ssd) * nldt);
For more information on the LDT and the struct ssd, see proc(5).
The proc_get_ldt() function is similar to the Pldt() function; however,
rather than reading from a process handle, it reads the ldt file from
the /proc file system for the process pid.
Upon successful completion, the Pldt() and proc_get_ldt() functions
return the number of LDT entries written to pldt. If pldt is NULL or
nldt is zero, then no data will be written. Otherwise, -1 is returned.
The Pldt() function sets errno to indicate the error that occurred.
For a full list of possible errors see the DIAGNOSTICS section in
proc(5).
The Pldt() function will fail if:
ENODATA No LDT information is available in the process
handle P.
The Pldt() and proc_get_ldt() functions are only available on x86
platforms.
Uncommitted
MT-LEVEL
See LOCKING in libproc(3LIB).
libproc(3LIB), proc(5)
illumos May 11, 2016 illumos
NAME
Pldt, proc_get_ldt - obtain local descriptor table of a process
LIBRARY
Process Control Library (libproc, -lproc)
SYNOPSIS
#include <libproc.h>
int
Pldt(struct ps_prochandle *P, struct ssd *pldt, int nldt);
int
proc_get_ldt(pid_t pid, struct ssd *pldt, int nldt);
DESCRIPTION
The Pldt() function reads the local descriptor table (LDT) of the
process handle P into the buffer pldt. Up to nldt entries will be
read.
If either pldt is NULL or nldt is 0, then rather than filling in pldt,
only the number of entries currently in the LDT is returned.
The buffer pldt should contain sufficient space for nldt entries. For
example, callers could allocate space as:
pldt = malloc(sizeof (struct ssd) * nldt);
For more information on the LDT and the struct ssd, see proc(5).
The proc_get_ldt() function is similar to the Pldt() function; however,
rather than reading from a process handle, it reads the ldt file from
the /proc file system for the process pid.
RETURN VALUES
Upon successful completion, the Pldt() and proc_get_ldt() functions
return the number of LDT entries written to pldt. If pldt is NULL or
nldt is zero, then no data will be written. Otherwise, -1 is returned.
The Pldt() function sets errno to indicate the error that occurred.
ERRORS
For a full list of possible errors see the DIAGNOSTICS section in
proc(5).
The Pldt() function will fail if:
ENODATA No LDT information is available in the process
handle P.
ARCHITECTURE
The Pldt() and proc_get_ldt() functions are only available on x86
platforms.
INTERFACE STABILITY
Uncommitted
MT-LEVEL
See LOCKING in libproc(3LIB).
SEE ALSO
libproc(3LIB), proc(5)
illumos May 11, 2016 illumos