usfreepollsema - free a pollable semaphore
int usfreepollsema (usema_t *sema, usptr_t *handle);
usfreepollsema frees the previously allocated pollable semaphore (via
usnewpollsema(3P)) specified by sema. Before freeing a pollable semaphore
all the file descriptors acquired for the semaphore must be closed. For
processes in a single share group, all of which are sharing file
descriptors, if one process calls usclospollsema(3P), all the file
descriptors for all processes will be closed. If there are processes in
the share group that are not sharing file descriptors, then each process
that acquired a file descriptor via a call to usopenpollsema(3P) should
call usclosepollsema(3P). Semaphores allocated via usnewsema(3P) should
be freed using usfreesema(3P).
usclosepollsema(3P), usfreesema(3P), usinitsema(3P), usinit(3P),
usnewsema(3P), usnewpollsema(3P), usopenpollsema(3P).
Upon successful completion 0 is returned. Otherwise, a value of -1 is
returned and errno is set to indicate the error.
PPPPaaaaggggeeee 1111 [ Back ]