Print this page
8158 Want named threads API
9857 proc manpages should have LIBRARY section
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man3proc/Pldt.3proc
+++ new/usr/src/man/man3proc/Pldt.3proc
1 1 .\"
2 2 .\" This file and its contents are supplied under the terms of the
3 3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
4 4 .\" You may only use this file in accordance with the terms of version
5 5 .\" 1.0 of the CDDL.
6 6 .\"
7 7 .\" A full copy of the text of the CDDL should have accompanied this
8 8 .\" source. A copy of the CDDL is also available via the Internet at
9 9 .\" http://www.illumos.org/license/CDDL.
10 10 .\"
↓ open down ↓ |
10 lines elided |
↑ open up ↑ |
11 11 .\"
12 12 .\" Copyright 2015 Joyent, Inc.
13 13 .\"
14 14 .Dd May 11, 2016
15 15 .Dt PLDT 3PROC
16 16 .Os
17 17 .Sh NAME
18 18 .Nm Pldt ,
19 19 .Nm proc_get_ldt
20 20 .Nd obtain local descriptor table of a process
21 -.Sh SYNOPSIS
21 +.Sh LIBRARY
22 22 .Lb libproc
23 +.Sh SYNOPSIS
23 24 .In libproc.h
24 25 .Ft int
25 26 .Fo Pldt
26 27 .Fa "struct ps_prochandle *P"
27 28 .Fa "struct ssd *pldt"
28 29 .Fa "int nldt"
29 30 .Fc
30 31 .Ft int
31 32 .Fo proc_get_ldt
32 33 .Fa "pid_t pid"
33 34 .Fa "struct ssd *pldt"
34 35 .Fa "int nldt"
35 36 .Fc
36 37 .Sh DESCRIPTION
37 38 The
38 39 .Fn Pldt
39 40 function reads the local descriptor table (LDT) of the process handle
40 41 .Fa P
41 42 into the buffer
42 43 .Fa pldt .
43 44 Up to
44 45 .Fa nldt
45 46 entries will be read.
46 47 .Pp
47 48 If either
48 49 .Fa pldt
49 50 is
50 51 .Dv NULL
51 52 or
52 53 .Fa nldt
53 54 is
54 55 .Fa 0 ,
55 56 then rather than filling in
56 57 .Fa pldt ,
57 58 only the number of entries currently in the LDT is returned.
58 59 .Pp
59 60 The buffer
60 61 .Fa pldt
61 62 should contain sufficient space for
62 63 .Fa nldt
63 64 entries.
64 65 For example, callers could allocate space as:
65 66 .Pp
66 67 .Dl pldt = malloc(sizeof (struct ssd) * nldt);
67 68 .Pp
68 69 For more information on the LDT and the
69 70 .Sy struct ssd ,
70 71 see
71 72 .Xr proc 4 .
72 73 .Pp
73 74 The
74 75 .Fn proc_get_ldt
75 76 function is similar to the
76 77 .Fn Pldt
77 78 function; however, rather than reading from a process handle, it reads
78 79 the
79 80 .Sy ldt
80 81 file from the /proc file system for the process
81 82 .Fa pid .
82 83 .Sh RETURN VALUES
83 84 Upon successful completion, the
84 85 .Fn Pldt
85 86 and
86 87 .Fn proc_get_ldt
87 88 functions return the number of LDT entries written to
88 89 .Fa pldt .
89 90 If
90 91 .Fa pldt
91 92 is
92 93 .Dv NULL
93 94 or
94 95 .Fa nldt
95 96 is zero, then no data will be written.
96 97 Otherwise,
97 98 .Sy -1
98 99 is returned.
99 100 The
100 101 .Fn Pldt
101 102 function sets
102 103 .Sy errno
103 104 to indicate the error that occurred.
104 105 .Sh ERRORS
105 106 For a full list of possible errors see the
106 107 .Sy DIAGNOSTICS
107 108 section in
108 109 .Xr proc 4 .
109 110 .Pp
110 111 The
111 112 .Fn Pldt
112 113 function will fail if:
113 114 .Bl -tag -width Er
114 115 .It Er ENODATA
115 116 No LDT information is available in the process handle
116 117 .Fa P .
117 118 .El
118 119 .Sh ARCHITECTURE
119 120 The
120 121 .Fn Pldt
121 122 and
122 123 .Fn proc_get_ldt
123 124 functions are only available on
124 125 .Sy x86
125 126 platforms.
126 127 .Sh INTERFACE STABILITY
127 128 .Sy Uncommitted
128 129 .Sh MT-LEVEL
129 130 See
130 131 .Sy LOCKING
131 132 in
132 133 .Xr libproc 3LIB .
133 134 .Sh SEE ALSO
134 135 .Xr libproc 3LIB ,
135 136 .Xr proc 4
↓ open down ↓ |
103 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX