#include <semaphore.h>
|
|
int
sem_init (sem_t *sem, int pshared, unsigned int value); |
Following a successful call to
sem_init,
sem
can be used as an argument in subsequent calls to
sem_wait,
sem_trywait,
sem_post,
and
sem_destroy.
The
sem
argument is no longer valid after a successful call to
sem_destroy.
sem_t psem;
if (sem_init(&psem, 0, 1) < 0) {
perror("sem_init");
return -1;
}
| [ENOSYS] | |
| the value of the pshared is not 0. | |
| [EINVAL] | |
| The value argument exceeds SEM_VALUE_MAX. | |
| [ENOSPC] | |
| Memory allocation error. | |
|
© 2008-2009 Nokia Corporation. All rights reserved. This documentation can be used in the connection with this Product to help and support the user. |