JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
man pages section 3: Realtime Library Functions     Oracle Solaris 10 8/11 Information Library
search filter icon
search icon

Document Information

Preface

Realtime Library Functions

aiocancel(3AIO)

aio_cancel(3RT)

aio_error(3RT)

aio_fsync(3RT)

aioread(3AIO)

aio_read(3RT)

aio_return(3RT)

aio_suspend(3RT)

aiowait(3AIO)

aio_waitn(3RT)

aiowrite(3AIO)

aio_write(3RT)

clock_getres(3RT)

clock_gettime(3RT)

clock_nanosleep(3RT)

clock_settime(3RT)

door_bind(3DOOR)

door_call(3DOOR)

door_create(3DOOR)

door_cred(3DOOR)

door_info(3DOOR)

door_return(3DOOR)

door_revoke(3DOOR)

door_server_create(3DOOR)

door_ucred(3DOOR)

door_unbind(3DOOR)

door_xcreate(3DOOR)

fdatasync(3RT)

lio_listio(3RT)

mq_close(3RT)

mq_getattr(3RT)

mq_notify(3RT)

mq_open(3RT)

mq_receive(3RT)

mq_reltimedreceive_np(3RT)

mq_reltimedsend_np(3RT)

mq_send(3RT)

mq_setattr(3RT)

mq_timedreceive(3RT)

mq_timedsend(3RT)

mq_unlink(3RT)

nanosleep(3RT)

proc_service(3PROC)

ps_kill(3PROC)

ps_lcontinue(3PROC)

ps_lgetfpregs(3PROC)

ps_lgetregs(3PROC)

ps_lgetxregs(3PROC)

ps_lgetxregsize(3PROC)

ps_lrolltoaddr(3PROC)

ps_lsetfpregs(3PROC)

ps_lsetregs(3PROC)

ps_lsetxregs(3PROC)

ps_lstop(3PROC)

ps_pcontinue(3PROC)

ps_pdread(3PROC)

ps_pdwrite(3PROC)

ps_pglobal_lookup(3PROC)

ps_pglobal_sym(3PROC)

ps_pread(3PROC)

ps_pstop(3PROC)

ps_ptread(3PROC)

ps_ptwrite(3PROC)

ps_pwrite(3PROC)

sched_getparam(3RT)

sched_get_priority_max(3RT)

sched_get_priority_min(3RT)

sched_getscheduler(3RT)

sched_rr_get_interval(3RT)

sched_setparam(3RT)

sched_setscheduler(3RT)

sched_yield(3RT)

sem_close(3RT)

sem_destroy(3RT)

sem_getvalue(3RT)

sem_init(3RT)

sem_open(3RT)

sem_post(3RT)

sem_reltimedwait_np(3RT)

sem_timedwait(3RT)

sem_trywait(3RT)

sem_unlink(3RT)

sem_wait(3RT)

shm_open(3RT)

shm_unlink(3RT)

sigqueue(3RT)

sigtimedwait(3RT)

sigwaitinfo(3RT)

timer_create(3RT)

timer_delete(3RT)

timer_getoverrun(3RT)

timer_gettime(3RT)

timer_settime(3RT)

door_call

- invoke the function associated with a door descriptor

Synopsis

cc [ flag... ] file... -ldoor [ library... ]

#include <door.h>

typedef struct {
     char             *data_ptr;     /* Argument/result buf ptr*/
     size_t           data_size;     /* Argument/result buf size */
     door_desc_t      *desc_ptr;     /* Argument/result descriptors */
     uint_t           desc_num;      /* Argument/result num desc */
     char             *rbuf;         /* Result buffer */
     size_t           rsize;         /* Result buffer size */
} door_arg_t; 

int door_call(int d, door_arg_t *params);

Description

The door_call() function invokes the function associated with the door descriptor d, and passes the arguments (if any) specified in params. All of the params members are treated as in/out parameters during a door invocation and may be updated upon returning from a door call. Passing NULL for params indicates there are no arguments to be passed and no results expected.

Arguments are specified using the data_ptr and desc_ptr members of params. The size of the argument data in bytes is passed in data_size and the number of argument descriptors is passed in desc_num.

Results from the door invocation are placed in the buffer, rbuf. See door_return(3DOOR). The data_ptr and desc_ptr members of params are updated to reflect the location of the results within the rbuf buffer. The size of the data results and number of descriptors returned are updated in the data_size and desc_num members. It is acceptable to use the same buffer for input argument data and results, so door_call() may be called with data_ptr and desc_ptr pointing to the buffer rbuf.

If the results of a door invocation exceed the size of the buffer specified by rsize, the system automatically allocates a new buffer in the caller's address space and updates the rbuf and rsize members to reflect this location. In this case, the caller is responsible for reclaiming this area using munmap(rbuf, rsize) when the buffer is no longer required. See munmap(2).

Descriptors passed in a door_desc_t structure are identified by the d_attributes member. The client marks the d_attributes member with the type of object being passed by logically OR-ing the value of object type. Currently, the only object type that can be passed or returned is a file descriptor, denoted by the DOOR_DESCRIPTOR attribute. Additionally, the DOOR_RELEASE attribute can be set, causing the descriptor to be closed in the caller's address space after it is passed to the target. The descriptor will be closed even if door_call() returns an error, unless that error is EFAULT or EBADF.

The door_desc_t structure includes the following members:

typedef struct {
         door_attr_t d_attributes;   /* Describes the parameter */
         union {
                 struct {
                         int d_descriptor;   /* Descriptor */
                         door_id_t d_id;    /* Unique door id */
                         } d_desc;
                 } d_data;
         } door_desc_t;

When file descriptors are passed or returned, a new descriptor is created in the target address space and the d_descriptor member in the target argument is updated to reflect the new descriptor. In addition, the system passes a system-wide unique number associated with each door in the door_id member and marks the d_attributes member with other attributes associated with a door including the following:

DOOR_LOCAL

The door received was created by this process using door_create(). See door_create(3DOOR).

DOOR_PRIVATE

The door received has a private pool of server threads associated with the door.

DOOR_UNREF

The door received is expecting an unreferenced notification.

DOOR_UNREF_MULTI

Similar to DOOR_UNREF, except multiple unreferenced notifications may be delivered for the same door.

DOOR_REFUSE_DESC

This door does not accept argument descriptors.

DOOR_REVOKED

The door received has been revoked by the server.

The door_call() function is not a restartable system call. It returns EINTR if a signal was caught and handled by this thread. If the door invocation is not idempotent the caller should mask any signals that may be generated during a door_call() operation. If the client aborts in the middle of a door_call(), the server thread is notified using the POSIX (see standards(5)) thread cancellation mechanism. See cancellation(5).

The descriptor returned from door_create() is marked as close on exec (FD_CLOEXEC). Information about a door is available for all clients of a door using door_info(). Applications concerned with security should not place secure information in door data that is accessible by door_info(). In particular, secure data should not be stored in the data item cookie. See door_info(3DOOR).

Return Values

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

Errors

The door_call() function will fail if:

E2BIG

Arguments were too big for server thread stack.

EAGAIN

Server was out of available resources.

EBADF

Invalid door descriptor was passed.

EFAULT

Argument pointers pointed outside the allocated address space.

EINTR

A signal was caught in the client, the client called fork(2), or the server exited during invocation.

EINVAL

Bad arguments were passed.

EMFILE

The client or server has too many open descriptors.

ENOTSUP

The desc_num argument is non-zero and the door has the DOOR_REFUSE_DESC flag set.

EOVERFLOW

System could not create overflow area in caller for results.

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Architecture
all
Availability
SUNWcsu
Interface Stability
Evolving
MT-Level
Safe

See Also

munmap(2), door_create(3DOOR), door_info(3DOOR), door_return(3DOOR), libdoor(3LIB), attributes(5), cancellation(5), standards(5)