usclosepollsema - detach a file descriptor from a pollable semaphore
int usclosepollsema (usema_t *sema);
usclosepollsema detaches the file descriptor associated with sema. In
addition to closing the caller's file descriptor, it invalidates and
closes any file descriptors used by other processes using the same
semaphore and in the same share group as the caller (assuming of course
that the share group is sharing file descriptors).
usclosepollsema will fail if one or more of the following are true:
[EBADF] The file descriptor for the semaphore has somehow been
already invalidated. This implies a corruption of the
semaphore data structure.
[EINVAL] The caller isn't a registered member of the arena that
sema was allocated from.
chmod(2), open(2), sproc(2), amalloc(3P), usopenpollsema(3P),
usconfig(3P), uscpsema(3P), usctlsema(3P), usdumpsema(3P),
usfreesema(3P), usfreepollsema(3P), usinit(3P), usnewsema(3P),
usnewpollsema(3P), uspsema(3P), usvsema(3P), usema(7M).
Upon successful completion, 0 is returned. Otherwise, a value of -1 is
returned and errno is set to indicate the error.
PPPPaaaaggggeeee 1111 [ Back ]