bsd-user: Add target_semid_ds and target_msqid_ds structures
Add the target ABI definitions for System V semaphore and message queue data structures, needed for semctl() and msgctl() syscall emulation. Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Mikael Urankar <mikael.urankar@gmail.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
Warner Losh committed
Feb 5, 2026 at 09:29 UTC
e17d8c0044056d55f54485e146693f9da6c6b1cc
1 file changed
+36
bsd-user/syscall_defs.h
+36
@@ -90,6 +90,42 @@ struct bsd_shm_regions {
90
abi_long size;
91
};
92
93
+/*
94
+ * sys/sem.h
95
+ */
96
+struct target_semid_ds {
97
+ struct target_ipc_perm sem_perm; /* operation permission struct */
98
+ abi_ptr sem_base; /* pointer to first semaphore in set */
99
+ abi_ushort sem_nsems; /* number of sems in set */
100
+ target_time_t sem_otime; /* last operation time */
101
+ target_time_t sem_ctime; /* times measured in secs */
102
+};
103
+
104
+/*
105
+ * sys/msg.h
106
+ */
107
+struct target_msqid_ds {
108
+ struct target_ipc_perm msg_perm; /* msg queue permission bits */
109
+ abi_ptr msg_first; /* first message in the queue */
110
+ abi_ptr msg_last; /* last message in the queue */
111
+ abi_ulong msg_cbytes; /* # of bytes in use on the queue */
112
+ abi_ulong msg_qnum; /* number of msgs in the queue */
113
+ abi_ulong msg_qbytes; /* max # of bytes on the queue */
114
+ int32_t msg_lspid; /* pid of last msgsnd() */
115
+ int32_t msg_lrpid; /* pid of last msgrcv() */
116
+ target_time_t msg_stime; /* time of last msgsnd() */
117
+ target_time_t msg_rtime; /* time of last msgrcv() */
118
+ target_time_t msg_ctime; /* time of last msgctl() */
119
+};
120
+
121
+/*
122
+ * sys/msgbuf.h
123
+ */
124
+struct target_msgbuf {
125
+ abi_long mtype; /* message type */
126
+ char mtext[1]; /* body of message */
127
+};
128
+
129
/*
130
* sys/mman.h
131
*/