PLDT(3PROC) Process Control Library Functions PLDT(3PROC)

Pldt, proc_get_ldtobtain 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 () 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 , see proc(5).

The () function is similar to the Pldt() function; however, rather than reading from a process handle, it reads the 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, is returned. The Pldt() function sets to indicate the error that occurred.

For a full list of possible errors see the section in proc(5).

The Pldt() function will fail if:

No LDT information is available in the process handle P.

The () and proc_get_ldt() functions are only available on platforms.

See in libproc(3LIB).

libproc(3LIB), proc(5)

May 11, 2016 OmniOS