1 /* 2 * Copyright 2008, Haiku Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef KERNEL_XSI_SEMAPHORE_H 6 #define KERNEL_XSI_SEMAPHORE_H 7 8 #include <sys/sem.h> 9 #include <sys/cdefs.h> 10 11 #include <OS.h> 12 13 #include <kernel.h> 14 #include <posix/xsi_semaphore_defs.h> 15 16 17 namespace BKernel { 18 struct Team; 19 } 20 21 using BKernel::Team; 22 23 24 __BEGIN_DECLS 25 26 extern void xsi_sem_init(); 27 extern void xsi_sem_undo(Team *team); 28 29 /* user calls */ 30 int _user_xsi_semget(key_t key, int numberOfSemaphores, int flags); 31 int _user_xsi_semctl(int semaphoreID, int semaphoreNumber, int command, 32 union semun* args); 33 status_t _user_xsi_semop(int semaphoreID, struct sembuf *semOps, 34 size_t numSemOps); 35 36 __END_DECLS 37 38 #endif /* KERNEL_XSI_SEMAPHORE_H */ 39