1 /* $NetBSD: linux_shm.h,v 1.10 2007/12/20 23:02:56 dsl 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.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the NetBSD
21 * Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 * contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
45 * shm segment control structure
47 struct linux_shmid_ds
{
48 struct linux_ipc_perm l_shm_perm
;
50 linux_time_t l_shm_atime
;
51 linux_time_t l_shm_dtime
;
52 linux_time_t l_shm_ctime
;
61 struct linux_shmid64_ds
{
62 struct linux_ipc64_perm l_shm_perm
;
64 linux_time_t l_shm_atime
;
68 linux_time_t l_shm_dtime
;
72 linux_time_t l_shm_ctime
;
83 struct linux_shminfo64
{
95 struct linux_shm_info
{
100 u_long l_swap_attempts
;
101 u_long l_swap_successes
;
104 #define LINUX_SHM_RDONLY 0x1000
105 #define LINUX_SHM_RND 0x2000
106 #define LINUX_SHM_REMAP 0x4000
108 #define LINUX_SHM_LOCK 11
109 #define LINUX_SHM_UNLOCK 12
110 #define LINUX_SHM_STAT 13
111 #define LINUX_SHM_INFO 14
114 /* Pretend the sys_shmat and sys_shmctl syscalls are defined */
115 struct linux_sys_shmat_args
{
116 syscallarg(int) shmid
;
117 syscallarg(void *) shmaddr
;
118 syscallarg(int) shmflg
;
119 syscallarg(u_long
*) raddr
;
122 struct linux_sys_shmctl_args
{
123 syscallarg(int) shmid
;
125 syscallarg(struct linux_shmid_ds
*) buf
;
128 struct linux_sys_shmget_args
{
129 syscallarg(key_t
) key
;
130 syscallarg(size_t) size
;
131 syscallarg(int) shmflg
;
137 int linux_sys_shmget(struct lwp
*, const struct linux_sys_shmget_args
*, register_t
*);
138 int linux_sys_shmat(struct lwp
*, const struct linux_sys_shmat_args
*, register_t
*);
139 int linux_sys_shmctl(struct lwp
*, const struct linux_sys_shmctl_args
*, register_t
*);
140 void linux_to_bsd_shmid_ds(struct linux_shmid_ds
*,
142 void linux_to_bsd_shmid64_ds(struct linux_shmid64_ds
*,
144 void bsd_to_linux_shmid_ds(struct shmid_ds
*,
145 struct linux_shmid_ds
*);
146 void bsd_to_linux_shmid64_ds(struct shmid_ds
*,
147 struct linux_shmid64_ds
*);
149 #endif /* !_KERNEL */
150 #endif /* !SYSVSHM */
152 #endif /* !_LINUX_SHM_H */