DOOR_GETPARAM(3C) | Standard C Library Functions | DOOR_GETPARAM(3C) |
door_getparam, door_setparam - retrieve and set door parameters
cc -mt [ flag... ] file... [ library... ] #include <door.h> int door_getparam(int d, int param, size_t *out);
int door_setparam(int d, int param, size_t val);
The door_getparam() function retrieves the value of param for the door descriptor d and writes it through the pointer out. The door_setparam() function sets the value of param for the door descriptor d to val. The param argument names the parameter to view or change and can be one of the following values:
DOOR_PARAM_DATA_MAX
DOOR_PARAM_DATA_MIN
DOOR_PARAM_DESC_MAX
The door_setparam() function can only affect doors that were created by the current process.
Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error.
The door_getparam() function will fail if:
EBADF
EFAULT
EINVAL
EOVERFLOW
The door_setparam() function will fail if:
EBADF
EINVAL
ENOTSUP
EPERM
ERANGE
Example 1 Set up a door with a fixed request size.
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).
*/
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Interface Stability | Stable |
MT-Level | MT-Safe |
The parameters that can be manipulated by door_setparam() 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 E2BIG.
The DOOR_PARAM_DATA_MIN parameter will not prevent DOOR_UNREF_DATA notifications from being sent to the door.
April 9, 2016 | OmniOS |