Path: blob/main/sys/compat/freebsd32/freebsd32_ipc.h
39478 views
/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2002 Doug Rabson4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14*15* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND16* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE17* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE18* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE19* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL20* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS21* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)22* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT23* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY24* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF25* SUCH DAMAGE.26*/2728#ifndef _COMPAT_FREEBSD32_FREEBSD32_IPC_H_29#define _COMPAT_FREEBSD32_FREEBSD32_IPC_H_3031struct ipc_perm32 {32uid_t cuid;33gid_t cgid;34uid_t uid;35gid_t gid;36mode_t mode;37uint16_t seq;38uint32_t key;39};4041struct semid_ds32 {42struct ipc_perm32 sem_perm;43uint32_t __sem_base;44unsigned short sem_nsems;45time32_t sem_otime;46time32_t sem_ctime;47};4849#ifdef _KERNEL50struct semid_kernel32 {51/* Data structure exposed to user space. */52struct semid_ds32 u;5354/* Kernel-private components of the semaphore. */55int32_t label;56int32_t cred;57};58#endif /* _KERNEL */5960union semun32 {61int val;62uint32_t buf;63uint32_t array;64};6566struct msqid_ds32 {67struct ipc_perm32 msg_perm;68uint32_t __msg_first;69uint32_t __msg_last;70uint32_t msg_cbytes;71uint32_t msg_qnum;72uint32_t msg_qbytes;73pid_t msg_lspid;74pid_t msg_lrpid;75time32_t msg_stime;76time32_t msg_rtime;77time32_t msg_ctime;78};7980#ifdef _KERNEL81struct msqid_kernel32 {82/* Data structure exposed to user space. */83struct msqid_ds32 u;8485/* Kernel-private components of the message queue. */86uint32_t label;87uint32_t cred;88};89#endif9091struct shmid_ds32 {92struct ipc_perm32 shm_perm;93int32_t shm_segsz;94pid_t shm_lpid;95pid_t shm_cpid;96unsigned int shm_nattch;97time32_t shm_atime;98time32_t shm_dtime;99time32_t shm_ctime;100};101102#ifdef _KERNEL103struct shmid_kernel32 {104struct shmid_ds32 u;105int32_t object;106int32_t label;107int32_t cred;108};109#endif110111struct shm_info32 {112int32_t used_ids;113uint32_t shm_tot;114uint32_t shm_rss;115uint32_t shm_swp;116uint32_t swap_attempts;117uint32_t swap_successes;118};119120struct shminfo32 {121uint32_t shmmax;122uint32_t shmmin;123uint32_t shmmni;124uint32_t shmseg;125uint32_t shmall;126};127128#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \129defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)130struct ipc_perm_old32 {131uint16_t cuid;132uint16_t cgid;133uint16_t uid;134uint16_t gid;135uint16_t mode;136uint16_t seq;137uint32_t key;138};139140struct semid_ds_old32 {141struct ipc_perm_old32 sem_perm;142uint32_t __sem_base;143unsigned short sem_nsems;144time32_t sem_otime;145int32_t sem_pad1;146time32_t sem_ctime;147int32_t sem_pad2;148int32_t sem_pad3[4];149};150151struct msqid_ds_old32 {152struct ipc_perm_old32 msg_perm;153uint32_t __msg_first;154uint32_t __msg_last;155uint32_t msg_cbytes;156uint32_t msg_qnum;157uint32_t msg_qbytes;158pid_t msg_lspid;159pid_t msg_lrpid;160time32_t msg_stime;161int32_t msg_pad1;162time32_t msg_rtime;163int32_t msg_pad2;164time32_t msg_ctime;165int32_t msg_pad3;166int32_t msg_pad4[4];167};168169struct shmid_ds_old32 {170struct ipc_perm_old32 shm_perm;171int32_t shm_segsz;172pid_t shm_lpid;173pid_t shm_cpid;174int16_t shm_nattch;175time32_t shm_atime;176time32_t shm_dtime;177time32_t shm_ctime;178uint32_t shm_internal;179};180181union semun_old32 {182int val;183uint32_t buf;184uint32_t array;185};186187void freebsd32_ipcperm_old_in(struct ipc_perm_old32 *ip32,188struct ipc_perm *ip);189void freebsd32_ipcperm_old_out(struct ipc_perm *ip,190struct ipc_perm_old32 *ip32);191#endif192193void freebsd32_ipcperm_in(struct ipc_perm32 *ip32, struct ipc_perm *ip);194void freebsd32_ipcperm_out(struct ipc_perm *ip, struct ipc_perm32 *ip32);195196#endif /* !_COMPAT_FREEBSD32_FREEBSD32_IPC_H_ */197198199