1 #ifndef _LINUX_SEM_H 2 #define _LINUX_SEM_H 3 4 #include <linux/atomic.h> 5 #include <linux/rcupdate.h> 6 #include <linux/cache.h> 7 #include <uapi/linux/sem.h> 8 9 struct task_struct; 10 11 /* One sem_array data structure for each set of semaphores in the system. */ 12 struct sem_array { 13 struct kern_ipc_perm sem_perm; /* permissions .. see ipc.h */ 14 time_t sem_ctime; /* last change time */ 15 struct sem *sem_base; /* ptr to first semaphore in array */ 16 struct list_head pending_alter; /* pending operations */ 17 /* that alter the array */ 18 struct list_head pending_const; /* pending complex operations */ 19 /* that do not alter semvals */ 20 struct list_head list_id; /* undo requests on this array */ 21 int sem_nsems; /* no. of semaphores in array */ 22 int complex_count; /* pending complex operations */ 23 unsigned int use_global_lock;/* >0: global lock required */ 24 }; 25 26 #ifdef CONFIG_SYSVIPC 27 28 struct sysv_sem { 29 struct sem_undo_list *undo_list; 30 }; 31 32 extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk); 33 extern void exit_sem(struct task_struct *tsk); 34 35 #else 36 37 struct sysv_sem { 38 /* empty */ 39 }; 40 41 static inline int copy_semundo(unsigned long clone_flags, struct task_struct *tsk) 42 { 43 return 0; 44 } 45 46 static inline void exit_sem(struct task_struct *tsk) 47 { 48 return; 49 } 50 #endif 51 52 #endif /* _LINUX_SEM_H */ 53