1 /*- 2 * Copyright (c) 2002 Maxim Sobolev <sobomax@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer 10 * in this position and unchanged. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 3. The name of the author may not be used to endorse or promote products 15 * derived from this software without specific prior written permission 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29 #ifndef _LINUX_IPC64_H_ 30 #define _LINUX_IPC64_H_ 31 32 /* 33 * The generic ipc64_perm structure. 34 * Note extra padding because this structure is passed back and forth 35 * between kernel and user space. 36 * 37 * Pad space is left for: 38 * - 32-bit mode_t on architectures that only had 16 bit 39 * - 32-bit seq 40 * - 2 miscellaneous 32-bit values 41 */ 42 struct l_ipc64_perm 43 { 44 l_key_t key; 45 l_uid_t uid; 46 l_gid_t gid; 47 l_uid_t cuid; 48 l_gid_t cgid; 49 l_mode_t mode; 50 /* pad if mode_t is ushort: */ 51 unsigned char __pad1[sizeof(l_int) - sizeof(l_mode_t)]; 52 l_ushort seq; 53 l_ushort __pad2; 54 l_ulong __unused1; 55 l_ulong __unused2; 56 }; 57 58 /* 59 * The generic msqid64_ds structure fro x86 architecture. 60 * Note extra padding because this structure is passed back and forth 61 * between kernel and user space. 62 * 63 * Pad space is left for: 64 * - 64-bit time_t to solve y2038 problem 65 * - 2 miscellaneous 32-bit values 66 */ 67 68 struct l_msqid64_ds { 69 struct l_ipc64_perm msg_perm; 70 l_time_t msg_stime; /* last msgsnd time */ 71 #if !defined(__LP64__) || defined(COMPAT_LINUX32) 72 l_ulong __unused1; 73 #endif 74 l_time_t msg_rtime; /* last msgrcv time */ 75 #if !defined(__LP64__) || defined(COMPAT_LINUX32) 76 l_ulong __unused2; 77 #endif 78 l_time_t msg_ctime; /* last change time */ 79 #if !defined(__LP64__) || defined(COMPAT_LINUX32) 80 l_ulong __unused3; 81 #endif 82 l_ulong msg_cbytes; /* current number of bytes on queue */ 83 l_ulong msg_qnum; /* number of messages in queue */ 84 l_ulong msg_qbytes; /* max number of bytes on queue */ 85 l_pid_t msg_lspid; /* pid of last msgsnd */ 86 l_pid_t msg_lrpid; /* last receive pid */ 87 l_ulong __unused4; 88 l_ulong __unused5; 89 }; 90 91 /* 92 * The generic semid64_ds structure for x86 architecture. 93 * Note extra padding because this structure is passed back and forth 94 * between kernel and user space. 95 * 96 * Pad space is left for: 97 * - 64-bit time_t to solve y2038 problem 98 * - 2 miscellaneous 32-bit values 99 */ 100 101 struct l_semid64_ds { 102 struct l_ipc64_perm sem_perm; /* permissions */ 103 l_time_t sem_otime; /* last semop time */ 104 l_ulong __unused1; 105 l_time_t sem_ctime; /* last change time */ 106 l_ulong __unused2; 107 l_ulong sem_nsems; /* no. of semaphores in array */ 108 l_ulong __unused3; 109 l_ulong __unused4; 110 }; 111 112 /* 113 * The generic shmid64_ds structure for x86 architecture. 114 * Note extra padding because this structure is passed back and forth 115 * between kernel and user space. 116 * 117 * Pad space is left for: 118 * - 64-bit time_t to solve y2038 problem 119 * - 2 miscellaneous 32-bit values 120 */ 121 122 struct l_shmid64_ds { 123 struct l_ipc64_perm shm_perm; /* operation perms */ 124 l_size_t shm_segsz; /* size of segment (bytes) */ 125 l_time_t shm_atime; /* last attach time */ 126 #if !defined(__LP64__) || defined(COMPAT_LINUX32) 127 l_ulong __unused1; 128 #endif 129 l_time_t shm_dtime; /* last detach time */ 130 #if !defined(__LP64__) || defined(COMPAT_LINUX32) 131 l_ulong __unused2; 132 #endif 133 l_time_t shm_ctime; /* last change time */ 134 #if !defined(__LP64__) || defined(COMPAT_LINUX32) 135 l_ulong __unused3; 136 #endif 137 l_pid_t shm_cpid; /* pid of creator */ 138 l_pid_t shm_lpid; /* pid of last operator */ 139 l_ulong shm_nattch; /* no. of current attaches */ 140 l_ulong __unused4; 141 l_ulong __unused5; 142 }; 143 144 struct l_shminfo64 { 145 l_ulong shmmax; 146 l_ulong shmmin; 147 l_ulong shmmni; 148 l_ulong shmseg; 149 l_ulong shmall; 150 l_ulong __unused1; 151 l_ulong __unused2; 152 l_ulong __unused3; 153 l_ulong __unused4; 154 }; 155 156 #endif /* !LINUX_IPC64_H_ */ 157