1 /* $NetBSD: linux_sem.h,v 1.9 2008/04/24 16:42:54 njoly Exp $ */
4 * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Frank van der Linden and Eric Haszlakiewicz.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
38 * Operations for semctl(2), in addition to IPC_STAT and IPC_SET
40 #define LINUX_GETPID 11
41 #define LINUX_GETVAL 12
42 #define LINUX_GETALL 13
43 #define LINUX_GETNCNT 14
44 #define LINUX_GETZCNT 15
45 #define LINUX_SETVAL 16
46 #define LINUX_SETALL 17
49 * Linux semid_ds structure. Internally used pointer fields are not
50 * important to us and have been changed to void *
53 struct linux_semid_ds
{
54 struct linux_ipc_perm l_sem_perm
;
55 linux_time_t l_sem_otime
;
56 linux_time_t l_sem_ctime
;
64 struct linux_semid64_ds
{
65 struct linux_ipc64_perm l_sem_perm
;
66 linux_time_t l_sem_otime
;
67 unsigned long l___unused1
;
68 linux_time_t l_sem_ctime
;
69 unsigned long l___unused2
;
70 unsigned long l_sem_nsems
;
71 unsigned long l___unused3
;
72 unsigned long l___unused4
;
77 struct linux_semid_ds
*l_buf
;
79 void *l___buf
; /* For unsupported IPC_INFO */
83 /* Pretend the sys_semctl syscall is defined */
85 struct linux_sys_semctl_args
{
86 syscallarg(int) semid
;
87 syscallarg(int) semnum
;
89 syscallarg(union linux_semun
) arg
;
91 int linux_sys_semctl(struct lwp
*, const struct linux_sys_semctl_args
*, register_t
*);
98 void bsd_to_linux_semid_ds(struct semid_ds
*, struct linux_semid_ds
*);
99 void bsd_to_linux_semid64_ds(struct semid_ds
*, struct linux_semid64_ds
*);
100 void linux_to_bsd_semid_ds(struct linux_semid_ds
*, struct semid_ds
*);
101 void linux_to_bsd_semid64_ds(struct linux_semid64_ds
*, struct semid_ds
*);
103 #endif /* !_KERNEL */
104 #endif /* !SYSVSEM */
106 #endif /* !_LINUX_SEM_H */