| 1 | /* $NetBSD: linux32_shm.h,v 1.1 2008/05/20 17:31:56 njoly Exp $ */ |
| 2 | |
| 3 | /* |
| 4 | * Copyright (c) 2008 Nicolas Joly |
| 5 | * All rights reserved. |
| 6 | * |
| 7 | * Redistribution and use in source and binary forms, with or without |
| 8 | * modification, are permitted provided that the following conditions |
| 9 | * are met: |
| 10 | * 1. Redistributions of source code must retain the above copyright |
| 11 | * notice, this list of conditions and the following disclaimer. |
| 12 | * 2. Redistributions in binary form must reproduce the above copyright |
| 13 | * notice, this list of conditions and the following disclaimer in the |
| 14 | * documentation and/or other materials provided with the distribution. |
| 15 | * |
| 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS |
| 17 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
| 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
| 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 26 | * POSSIBILITY OF SUCH DAMAGE. |
| 27 | */ |
| 28 | |
| 29 | #ifndef _LINUX32_SHM_H |
| 30 | #define _LINUX32_SHM_H |
| 31 | |
| 32 | struct linux32_shmid_ds { |
| 33 | struct linux32_ipc_perm l_shm_perm; |
| 34 | int l_shm_segsz; |
| 35 | linux32_time_t l_shm_atime; |
| 36 | linux32_time_t l_shm_dtime; |
| 37 | linux32_time_t l_shm_ctime; |
| 38 | ushort l_shm_cpid; |
| 39 | ushort l_shm_lpid; |
| 40 | short l_shm_nattch; |
| 41 | ushort l_private1; |
| 42 | netbsd32_voidp l_private2; |
| 43 | netbsd32_voidp l_private3; |
| 44 | }; |
| 45 | |
| 46 | struct linux32_shmid64_ds { |
| 47 | struct linux32_ipc64_perm l_shm_perm; |
| 48 | netbsd32_size_t l_shm_segsz; |
| 49 | linux32_time_t l_shm_atime; |
| 50 | netbsd32_u_long l____unused1; |
| 51 | linux32_time_t l_shm_dtime; |
| 52 | netbsd32_u_long l____unused2; |
| 53 | linux32_time_t l_shm_ctime; |
| 54 | netbsd32_u_long l____unused3; |
| 55 | int l_shm_cpid; |
| 56 | int l_shm_lpid; |
| 57 | netbsd32_u_long l_shm_nattch; |
| 58 | netbsd32_u_long l___unused4; |
| 59 | netbsd32_u_long l___unused5; |
| 60 | }; |
| 61 | |
| 62 | struct linux32_shminfo64 { |
| 63 | netbsd32_u_long l_shmmax; |
| 64 | netbsd32_u_long l_shmmin; |
| 65 | netbsd32_u_long l_shmmni; |
| 66 | netbsd32_u_long l_shmseg; |
| 67 | netbsd32_u_long l_shmall; |
| 68 | netbsd32_u_long l___unused1; |
| 69 | netbsd32_u_long l___unused2; |
| 70 | netbsd32_u_long l___unused3; |
| 71 | netbsd32_u_long l___unused4; |
| 72 | }; |
| 73 | |
| 74 | struct linux32_shm_info { |
| 75 | int l_used_ids; |
| 76 | netbsd32_u_long l_shm_tot; |
| 77 | netbsd32_u_long ; |
| 78 | netbsd32_u_long l_shm_swp; |
| 79 | netbsd32_u_long l_swap_attempts; |
| 80 | netbsd32_u_long l_swap_successes; |
| 81 | }; |
| 82 | |
| 83 | #define LINUX32_SHM_RDONLY 0x1000 |
| 84 | #define LINUX32_SHM_RND 0x2000 |
| 85 | #define LINUX32_SHM_REMAP 0x4000 |
| 86 | |
| 87 | #define LINUX32_SHM_LOCK 11 |
| 88 | #define LINUX32_SHM_UNLOCK 12 |
| 89 | #define LINUX32_SHM_STAT 13 |
| 90 | #define LINUX32_SHM_INFO 14 |
| 91 | |
| 92 | #endif /* _LINUX32_SHM_H */ |
| 93 | |