1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
|
'\" te
.\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH DOOR_GETPARAM 3C "April 9, 2016"
.SH NAME
door_getparam, door_setparam \- retrieve and set door parameters
.SH SYNOPSIS
.LP
.nf
\fBcc\fR \fB-mt\fR [ \fIflag\fR... ] \fIfile\fR... [ \fIlibrary\fR... ]
#include <door.h>
\fBint\fR \fBdoor_getparam\fR(\fBint\fR \fId\fR, \fBint\fR \fIparam\fR, \fBsize_t *\fR\fIout\fR);
.fi
.LP
.nf
\fBint\fR \fBdoor_setparam\fR(\fBint\fR \fId\fR, \fBint\fR \fIparam\fR, \fBsize_t\fR \fIval\fR);
.fi
.SH DESCRIPTION
.LP
The \fBdoor_getparam()\fR function retrieves the value of \fIparam\fR for the
door descriptor \fId\fR and writes it through the pointer \fIout\fR. The
\fBdoor_setparam()\fR function sets the value of \fIparam\fR for the door
descriptor \fId\fR to \fIval\fR. The \fIparam\fR argument names the parameter
to view or change and can be one of the following values:
.sp
.ne 2
.na
\fB\fBDOOR_PARAM_DATA_MAX\fR\fR
.ad
.RS 23n
This parameter represents the maximum amount of data that can be passed to the
door routine. Any attempt to call \fBdoor_call\fR(3C) on a door with a
\fIdata_size\fR value larger than the door's \fBDOOR_PARAM_DATA_MAX\fR
parameter will fail with \fBENOBUFS\fR. At door creation time, this parameter
is initialized to \fBSIZE_MAX\fR and can be set to any value from 0 to
\fBSIZE_MAX\fR, inclusive. This parameter must be greater than or equal to the
\fBDOOR_PARAM_DATA_MIN\fR parameter.
.RE
.sp
.ne 2
.na
\fB\fBDOOR_PARAM_DATA_MIN\fR\fR
.ad
.RS 23n
This parameter represents the minimum amount of data that can be passed to
the door routine. Any attempt to call \fBdoor_call\fR(3C) on a door with a
\fIdata_size\fR value smaller than the door's \fBDOOR_PARAM_DATA_MIN\fR
parameter will fail with \fBENOBUFS\fR. At door creation time, this parameter
is initialized to 0, and can be set to any value from 0 to \fBSIZE_MAX\fR,
inclusive. This parameter must be less than or equal to the
\fBDOOR_PARAM_DATA_MAX\fR parameter.
.RE
.sp
.ne 2
.na
\fB\fBDOOR_PARAM_DESC_MAX\fR\fR
.ad
.RS 23n
This parameter represents the maximum number of argument descriptors that
can be passed to the door routine. Any attempt to call \fBdoor_call\fR(3C) on a
door with a \fIdesc_nu\fRm value larger than the door's
\fBDOOR_PARAM_DESC_MAX\fR parameter will fail with \fBENFILE\fR. If the door
was created with the \fBDOOR_REFUSE_DESC\fR flag, this parameter is initialized
to 0 and cannot be changed to any other value. Otherwise, it is initialized to
\fBINT_MAX\fR and can be set to any value from 0 to \fBINT_MAX\fR, inclusive.
.RE
.sp
.LP
The \fBdoor_setparam()\fR function can only affect doors that were created by
the current process.
.SH RETURN VALUES
.LP
Upon successful completion, 0 is returned. Otherwise, -1 is returned and
\fBerrno\fR is set to indicate the error.
.SH ERRORS
.LP
The \fBdoor_getparam()\fR function will fail if:
.sp
.ne 2
.na
\fB\fBEBADF\fR\fR
.ad
.RS 13n
The \fId\fR argument is not a door descriptor.
.RE
.sp
.ne 2
.na
\fB\fBEFAULT\fR\fR
.ad
.RS 13n
The \fIout\fR argument is not a valid address.
.RE
.sp
.ne 2
.na
\fB\fBEINVAL\fR\fR
.ad
.RS 13n
The \fIparam\fR argument is not a recognized parameter.
.RE
.sp
.ne 2
.na
\fB\fBEOVERFLOW\fR\fR
.ad
.RS 13n
The value of the parameter is larger than the \fBSIZE_MAX\fR. This condition
can occur only if the calling process is 32-bit and the door targets a 64-bit
process or the kernel.
.RE
.sp
.LP
The \fBdoor_setparam()\fR function will fail if:
.sp
.ne 2
.na
\fB\fBEBADF\fR\fR
.ad
.RS 11n
The \fId\fR argument is not a door descriptor or has been revoked.
.RE
.sp
.ne 2
.na
\fB\fBEINVAL\fR\fR
.ad
.RS 11n
The \fIparam\fR argument is not a recognized parameter, or the requested change
would make \fBDOOR_PARAM_DATA_MIN\fR greater than \fBDOOR_PARAM_DATA_MAX\fR.
.RE
.sp
.ne 2
.na
\fB\fBENOTSUP\fR\fR
.ad
.RS 11n
The \fIparam\fR argument is \fBDOOR_PARAM_DESC_MAX\fR, \fId\fR was created with
the \fBDOOR_REFUSE_DESC\fR flag, and \fIval\fR is not zero.
.RE
.sp
.ne 2
.na
\fB\fBEPERM\fR\fR
.ad
.RS 11n
The \fId\fR argument was not created by this process.
.RE
.sp
.ne 2
.na
\fB\fBERANGE\fR\fR
.ad
.RS 11n
The \fIval\fR argument is not in supported range of \fIparam\fR.
.RE
.SH EXAMPLES
.LP
\fBExample 1 \fRSet up a door with a fixed request size.
.sp
.in +2
.nf
typedef struct my_request {
int request;
ar buffer[4096];
} my_request_t;
fd = door_create(my_handler, DOOR_REFUSE_DESC);
if (fd < 0)
/* handle error */
if (door_setparam(fd, DOOR_PARAM_DATA_MIN,
sizeof (my_request_t)) < 0 ||
door_setparam(fd, DOOR_PARAM_DATA_MAX,
sizeof (my_request_t)) < 0)
/* handle error */
/*
* the door will only accept door_call(3C)s with a
* data_size which is exactly sizeof (my_request_t).
*/
.fi
.in -2
.SH ATTRIBUTES
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp
.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE
_
Interface Stability Stable
_
MT-Level MT-Safe
.TE
.SH SEE ALSO
.LP
.BR door_call (3C),
.BR door_create (3C),
.BR attributes (7)
.SH NOTES
.LP
The parameters that can be manipulated by \fBdoor_setparam()\fR are not the
only limitation on the size of requests. If the door server thread's stack size
is not large enough to hold all of the data requested plus room for processing
the request, the door call will fail with \fBE2BIG\fR.
.sp
.LP
The \fBDOOR_PARAM_DATA_MIN\fR parameter will not prevent \fBDOOR_UNREF_DATA\fR
notifications from being sent to the door.
|