1door_getparam(3C)        Standard C Library Functions        door_getparam(3C)
2
3
4

NAME

6       door_getparam, door_setparam - retrieve and set door parameters
7

SYNOPSIS

9       cc -mt [ flag... ] file... [ library... ]
10       #include <door.h>
11
12       int door_getparam(int d, int param, size_t *out);
13
14
15       int door_setparam(int d, int param, size_t val);
16
17

DESCRIPTION

19       The  door_getparam() function retrieves the value of param for the door
20       descriptor d and writes it through the pointer out. The door_setparam()
21       function  sets the value of param for the door descriptor d to val. The
22       param argument names the parameter to view or change and can be one  of
23       the following values:
24
25       DOOR_PARAM_DATA_MAX    This  parameter represents the maximum amount of
26                              data that can be passed to the door routine. Any
27                              attempt  to  call door_call(3C) on a door with a
28                              data_size   value   larger   than   the   door's
29                              DOOR_PARAM_DATA_MAX  parameter  will  fail  with
30                              ENOBUFS. At door creation time,  this  parameter
31                              is initialized to SIZE_MAX and can be set to any
32                              value from 0 to SIZE_MAX, inclusive. This param‐
33                              eter  must  be  greater  than  or  equal  to the
34                              DOOR_PARAM_DATA_MIN parameter.
35
36
37       DOOR_PARAM_DATA_MIN    This parameter represents the the minimum amount
38                              of  data that can be passed to the door routine.
39                              Any attempt to call door_call(3C) on a door with
40                              a   data_size  value  smaller  than  the  door's
41                              DOOR_PARAM_DATA_MIN  parameter  will  fail  with
42                              ENOBUFS.  At  door creation time, this parameter
43                              is initialized to 0, and can be set to any value
44                              from  0  to  SIZE_MAX, inclusive. This parameter
45                              must   be   less   than   or   equal   to    the
46                              DOOR_PARAM_DATA_MAX parameter.
47
48
49       DOOR_PARAM_DESC_MAX    This parameter represents the the maximum number
50                              of argument descriptors that can  be  passed  to
51                              the   door   routine.   Any   attempt   to  call
52                              door_call(3C) on a door with  a  desc_num  value
53                              larger   than   the  door's  DOOR_PARAM_DESC_MAX
54                              parameter will fail with ENFILE. If the door was
55                              created  with  the  DOOR_REFUSE_DESC  flag, this
56                              parameter is initialized  to  0  and  cannot  be
57                              changed  to  any  other  value. Otherwise, it is
58                              initialized to INT_MAX and can  be  set  to  any
59                              value from 0 to INT_MAX, inclusive.
60
61
62
63       The door_setparam() function can only affect doors that were created by
64       the current process.
65

RETURN VALUES

67       Upon successful completion, 0 is returned.  Otherwise, -1  is  returned
68       and errno is set to indicate the error.
69

ERRORS

71       The door_getparam() function will fail if:
72
73       EBADF        The d argument is not a door descriptor.
74
75
76       EFAULT       The out argument is not a valid address.
77
78
79       EINVAL       The param argument is not a recognized parameter.
80
81
82       EOVERFLOW    The  value  of  the parameter is larger than the SIZE_MAX.
83                    This condition can occur only if the  calling  process  is
84                    32-bit  and  the door targets a 64-bit process or the ker‐
85                    nel.
86
87
88
89       The door_setparam() function will fail if:
90
91       EBADF      The d argument is not a door descriptor or has been revoked.
92
93
94       EINVAL     The param argument is not a  recognized  parameter,  or  the
95                  requested change would make DOOR_PARAM_DATA_MIN greater than
96                  DOOR_PARAM_DATA_MAX.
97
98
99       ENOTSUP    The param argument is  DOOR_PARAM_DESC_MAX,  d  was  created
100                  with the DOOR_REFUSE_DESC flag, and val is not zero.
101
102
103       EPERM      The d argument was not created by this process.
104
105
106       ERANGE     The val argument is not in supported range of param.
107
108

EXAMPLES

110       Example 1 Set up a door with a fixed request size.
111
112         typedef struct my_request {
113              int request;
114         ar buffer[4096];
115         } my_request_t;
116
117         fd = door_create(my_handler, DOOR_REFUSE_DESC);
118         if (fd < 0)
119              /* handle error */
120
121         if (door_setparam(fd, DOOR_PARAM_DATA_MIN,
122             sizeof (my_request_t)) < 0 ||
123             door_setparam(fd, DOOR_PARAM_DATA_MAX,
124             sizeof (my_request_t)) < 0)
125          /* handle error */
126
127         /*
128          * the door will only accept door_call(3DOOR)s with a
129          * data_size which is exactly sizeof (my_request_t).
130          */
131
132

ATTRIBUTES

134       See attributes(5) for descriptions of the following attributes:
135
136
137
138
139       ┌─────────────────────────────┬─────────────────────────────┐
140       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
141       ├─────────────────────────────┼─────────────────────────────┤
142       │Interface Stability          │Stable                       │
143       ├─────────────────────────────┼─────────────────────────────┤
144       │MT-Level                     │MT-Safe                      │
145       └─────────────────────────────┴─────────────────────────────┘
146

SEE ALSO

148       door_call(3C), door_create(3C), attributes(5)
149

NOTES

151       The  parameters  that can be manipulated by door_setparam() are not the
152       only limitation on the size of requests. If the  door  server  thread's
153       stack  size  is not large enough to hold all of the data requested plus
154       room for processing the request, the door call will fail with E2BIG.
155
156
157       The DOOR_PARAM_DATA_MIN  parameter  will  not  prevent  DOOR_UNREF_DATA
158       notifications from being sent to the door.
159
160
161
162SunOS 5.11                        22 Mar 2005                door_getparam(3C)
Impressum