1 /* $NetBSD: linux_shm.h,v 1.11 2008/01/28 14:14:48 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 * shm segment control structure
40 struct linux_shmid_ds
{
41 struct linux_ipc_perm l_shm_perm
;
43 linux_time_t l_shm_atime
;
44 linux_time_t l_shm_dtime
;
45 linux_time_t l_shm_ctime
;
54 struct linux_shmid64_ds
{
55 struct linux_ipc64_perm l_shm_perm
;
57 linux_time_t l_shm_atime
;
61 linux_time_t l_shm_dtime
;
65 linux_time_t l_shm_ctime
;
76 struct linux_shminfo64
{
88 struct linux_shm_info
{
93 u_long l_swap_attempts
;
94 u_long l_swap_successes
;
97 #define LINUX_SHM_RDONLY 0x1000
98 #define LINUX_SHM_RND 0x2000
99 #define LINUX_SHM_REMAP 0x4000
101 #define LINUX_SHM_LOCK 11
102 #define LINUX_SHM_UNLOCK 12
103 #define LINUX_SHM_STAT 13
104 #define LINUX_SHM_INFO 14
107 /* Pretend the sys_shmat and sys_shmctl syscalls are defined */
108 struct linux_sys_shmat_args
{
109 syscallarg(int) shmid
;
110 syscallarg(void *) shmaddr
;
111 syscallarg(int) shmflg
;
112 syscallarg(u_long
*) raddr
;
115 struct linux_sys_shmctl_args
{
116 syscallarg(int) shmid
;
118 syscallarg(struct linux_shmid_ds
*) buf
;
121 struct linux_sys_shmget_args
{
122 syscallarg(key_t
) key
;
123 syscallarg(size_t) size
;
124 syscallarg(int) shmflg
;
130 int linux_sys_shmget(struct lwp
*, const struct linux_sys_shmget_args
*, register_t
*);
131 int linux_sys_shmat(struct lwp
*, const struct linux_sys_shmat_args
*, register_t
*);
132 int linux_sys_shmctl(struct lwp
*, const struct linux_sys_shmctl_args
*, register_t
*);
133 void linux_to_bsd_shmid_ds(struct linux_shmid_ds
*,
135 void linux_to_bsd_shmid64_ds(struct linux_shmid64_ds
*,
137 void bsd_to_linux_shmid_ds(struct shmid_ds
*,
138 struct linux_shmid_ds
*);
139 void bsd_to_linux_shmid64_ds(struct shmid_ds
*,
140 struct linux_shmid64_ds
*);
142 #endif /* !_KERNEL */
143 #endif /* !SYSVSHM */
145 #endif /* !_LINUX_SHM_H */