blob: 5608a500c43ea9090835d0bee34b1dbb548444f3 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#ifndef _LINUX_SEM_H
3#define _LINUX_SEM_H
4
David Howells607ca462012-10-13 10:46:48 +01005#include <uapi/linux/sem.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07006
Tim Schmielau8c65b4a2005-11-07 00:59:43 -08007struct task_struct;
Eric W. Biederman1a5c1342018-03-22 21:30:56 -05008struct sem_undo_list;
Linus Torvalds1da177e2005-04-16 15:20:36 -07009
Manfred Spraulf567a182011-11-02 13:38:56 -070010#ifdef CONFIG_SYSVIPC
11
Linus Torvalds1da177e2005-04-16 15:20:36 -070012struct sysv_sem {
13 struct sem_undo_list *undo_list;
14};
15
Linus Torvalds1da177e2005-04-16 15:20:36 -070016extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk);
17extern void exit_sem(struct task_struct *tsk);
18
19#else
Manfred Spraulf567a182011-11-02 13:38:56 -070020
21struct sysv_sem {
22 /* empty */
23};
24
Linus Torvalds1da177e2005-04-16 15:20:36 -070025static inline int copy_semundo(unsigned long clone_flags, struct task_struct *tsk)
26{
27 return 0;
28}
29
30static inline void exit_sem(struct task_struct *tsk)
31{
32 return;
33}
34#endif
35
Linus Torvalds1da177e2005-04-16 15:20:36 -070036#endif /* _LINUX_SEM_H */