| Skip Navigation Links | |
| Exit Print View | |
![]() | man pages section 3: Basic Library Functions Oracle Solaris 11 Information Library |
enable_extended_FILE_stdio(3C)
posix_spawnattr_getschedparam(3C)
posix_spawnattr_getschedpolicy(3C)
posix_spawnattr_getsigdefault(3C)
posix_spawnattr_getsigignore_np(3C)
posix_spawnattr_getsigmask(3C)
posix_spawnattr_setschedparam(3C)
posix_spawnattr_setschedpolicy(3C)
posix_spawnattr_setsigdefault(3C)
posix_spawnattr_setsigignore_np(3C)
posix_spawnattr_setsigmask(3C)
posix_spawn_file_actions_addclose(3C)
posix_spawn_file_actions_addclosefrom_np(3C)
posix_spawn_file_actions_adddup2(3C)
posix_spawn_file_actions_addopen(3C)
posix_spawn_file_actions_destroy(3C)
posix_spawn_file_actions_init(3C)
pthread_attr_getdetachstate(3C)
pthread_attr_getinheritsched(3C)
pthread_attr_getschedparam(3C)
pthread_attr_getschedpolicy(3C)
pthread_attr_setdetachstate(3C)
pthread_attr_setinheritsched(3C)
pthread_attr_setschedparam(3C)
pthread_attr_setschedpolicy(3C)
pthread_barrierattr_destroy(3C)
pthread_barrierattr_getpshared(3C)
pthread_barrierattr_setpshared(3C)
pthread_condattr_getpshared(3C)
pthread_condattr_setpshared(3C)
pthread_cond_reltimedwait_np(3C)
pthread_key_create_once_np(3C)
pthread_mutexattr_getprioceiling(3C)
pthread_mutexattr_getprotocol(3C)
pthread_mutexattr_getpshared(3C)
pthread_mutexattr_getrobust(3C)
pthread_mutexattr_setprioceiling(3C)
pthread_mutexattr_setprotocol(3C)
pthread_mutexattr_setpshared(3C)
pthread_mutexattr_setrobust(3C)
pthread_mutex_getprioceiling(3C)
pthread_mutex_reltimedlock_np(3C)
pthread_mutex_setprioceiling(3C)
pthread_rwlockattr_destroy(3C)
pthread_rwlockattr_getpshared(3C)
pthread_rwlockattr_setpshared(3C)
pthread_rwlock_reltimedrdlock_np(3C)
pthread_rwlock_reltimedwrlock_np(3C)
pthread_rwlock_timedrdlock(3C)
pthread_rwlock_timedwrlock(3C)
rctlblk_get_enforced_value(3C)
- create a door descriptor
cc-mt [flag... ]file... [library... ]#include <door.h>intdoor_create(void (*server_procedure) (void *cookie,char *argp,size_targ_size,door_desc_t *dp,uint_tn_desc),void *cookie,uint_tattributes);
Thedoor_create() function creates a door descriptor that describes the procedure specifiedby the functionserver_procedure. The data item,cookie, is associated withthe door descriptor, and is passed as an argument to the invokedfunctionserver_procedure duringdoor_call(3C) invocations. Other arguments passed toserver_procedure from anassociateddoor_call() are placed on the stack and includeargp anddp.Theargp argument points toarg_size bytes of data and thedpargument points ton_descdoor_desc_t structures. Theattributes argument specifies attributes associated with the newly created door. Valid values forattributes are constructedby OR-ing one or more of the following values:
Delivers a special invocation on the door when the number of descriptors that refer to this door drops to one. In order to trigger this condition, more than one descriptor must have referred to this door at some time.DOOR_UNREF_DATA designates an unreferenced invocation, as theargp argument passed toserver_procedure. In the case of an unreferenced invocation, the values forarg_size,dp andn_did are0. Only one unreferenced invocation is delivered on behalf of a door.
Similar toDOOR_UNREF, except multiple unreferenced invocations can be delivered on the same door if the number of descriptors referring to the door drops to one more than once. Since an additional reference may have been passed by the time an unreferenced invocation arrives, theDOOR_IS_UNREF attribute returned by thedoor_info(3C) call can be used to determine if the door is still unreferenced.
Maintains a separate pool of server threads on behalf of the door. Server threads are associated with a door's private server pool usingdoor_bind(3C).
Any attempt to calldoor_call(3C) on this door with argument descriptors will fail withENOTSUP. When this flag is set, the door's server procedure will always be invoked with ann_desc argument of 0.
Clients which abort calls todoor_call() on this door will not cause the cancellation of the server thread handling the request. Seecancellation(5).
The descriptor returned fromdoor_create() will be marked as close on exec(FD_CLOEXEC). Information about a door is available for all clients of adoor usingdoor_info(). Applications concerned with security should not place secure information indoor data that is accessible bydoor_info(). In particular, secure data shouldnot be stored in the data itemcookie.
By default, additional threads are created as needed to handle concurrentdoor_call()invocations. Seedoor_server_create(3C) for information on how to change this behavior.
A process can advertise a door in the file system name spaceusingfattach(3C).
After creation,door_setparam(3C) can be used to set limits on the amountof data and descriptors clients can send over the door.
Upon successful completion,door_create() returns a non-negative value. Otherwise,door_create returns-1and setserrno to indicate the error.
Thedoor_create() function will fail if:
Invalid attributes are passed.
The process has too many open descriptors.
Example 1 Create a door and usefattach() to advertise the door in the file system namespace.
The following example creates a door and usesfattach() to advertise thedoor in the file system namespace.
voidserver(void *cookie, char *argp, size_t arg_size, door_desc_t *dp, uint_t n_desc){ door_return(NULL, 0, NULL, 0); /* NOTREACHED */}intmain(int argc, char *argv[]){ int did; struct stat buf; if ((did = door_create(server, 0, 0)) < 0) { perror("door_create"); exit(1); } /* make sure file system location exists */ if (stat("/tmp/door", &buf) < 0) { int newfd; if ((newfd = creat("/tmp/door", 0444)) < 0) { perror("creat"); exit(1); } (void) close(newfd); } /* make sure nothing else is attached */ (void) fdetach("/tmp/door"); /* attach to file system */ if (fattach(did, "/tmp/door") < 0) { perror("fattach"); exit(2); } [...]}Seeattributes(5) for descriptions of the following attributes:
|
door_bind(3C),door_call(3C),door_info(3C),door_revoke(3C),door_setparam(3C),door_server_create(3C),fattach(3C),libdoor(3LIB),attributes(5),cancellation(5)
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |