What is the difference between sema_init and sem_init ? Are there any specific usage scenarios and other dependencies for the respective APIs ?
Asked
Active
Viewed 3,298 times
2 Answers
4
Since you tagged this with "linux" I'll ignore other Unixes.
sema_init is the Linux kernel's counting semaphore implementation initialization function.
sem_init is the initializer from the Posix thread library (and is therefore used by userspace code).

CliffJumper
- 41
- 1
3
- sema_init is from the Solaris thread library.
- sem_init is from the Posix pthread library.

Sjoerd
- 74,049
- 16
- 131
- 175