RTEMS Logo

RTEMS 4.6.99.3 On-Line Library


Semaphore Manager sem_init - Initialize an unnamed semaphore

PREV UP NEXT Bookshelf RTEMS POSIX API User's Guide

9.4.1: sem_init - Initialize an unnamed semaphore

CALLING SEQUENCE:

int sem_init(
  sem_t        *sem,
  int           pshared,
  unsigned int  value
);

STATUS CODES:

EINVAL
The value argument exceeds SEM_VALUE_MAX
ENOSPC
A resource required to initialize the semaphore has been exhausted The limit on semaphores (SEM_VALUE_MAX) has been reached
ENOSYS
The function sem_init is not supported by this implementation
EPERM
The process lacks appropriate privileges to initialize the semaphore

DESCRIPTION:

The sem_init function is used to initialize the unnamed semaphore referred to by "sem". The value of the initialized semaphore is the parameter "value". The semaphore remains valid until it is destroyed.

ADD MORE HERE XXX

NOTES:

If the functions completes successfully, it shall return a value of zero. Otherwise, it shall return a value of -1 and set "errno" to specify the error that occurred.

Multiprocessing is currently not supported in this implementation.


PREV UP NEXT Bookshelf RTEMS POSIX API User's Guide

Copyright © 1988-2004 OAR Corporation