Linux 3.9-rc4
[linux-2.6/cjktty.git] / include / linux / sem.h
blob53d42650b1935f255feac8bc88401240057068c6
1 #ifndef _LINUX_SEM_H
2 #define _LINUX_SEM_H
4 #include <linux/atomic.h>
5 #include <linux/rcupdate.h>
6 #include <linux/cache.h>
7 #include <uapi/linux/sem.h>
9 struct task_struct;
11 /* One sem_array data structure for each set of semaphores in the system. */
12 struct sem_array {
13 struct kern_ipc_perm ____cacheline_aligned_in_smp
14 sem_perm; /* permissions .. see ipc.h */
15 time_t sem_otime; /* last semop time */
16 time_t sem_ctime; /* last change time */
17 struct sem *sem_base; /* ptr to first semaphore in array */
18 struct list_head sem_pending; /* pending operations to be processed */
19 struct list_head list_id; /* undo requests on this array */
20 int sem_nsems; /* no. of semaphores in array */
21 int complex_count; /* pending complex operations */
24 #ifdef CONFIG_SYSVIPC
26 struct sysv_sem {
27 struct sem_undo_list *undo_list;
30 extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk);
31 extern void exit_sem(struct task_struct *tsk);
33 #else
35 struct sysv_sem {
36 /* empty */
39 static inline int copy_semundo(unsigned long clone_flags, struct task_struct *tsk)
41 return 0;
44 static inline void exit_sem(struct task_struct *tsk)
46 return;
48 #endif
50 #endif /* _LINUX_SEM_H */