target_to_host_bitmask(target_flags, ipc_flags_tbl)));
}
+/* semop(2) */
+static inline abi_long do_bsd_semop(int semid, abi_long ptr, unsigned nsops)
+{
+ g_autofree struct sembuf *sops = g_malloc(nsops * sizeof(struct sembuf));
+ struct target_sembuf *target_sembuf;
+ int i;
+
+ target_sembuf = lock_user(VERIFY_READ, ptr,
+ nsops * sizeof(struct target_sembuf), 1);
+ if (target_sembuf == NULL) {
+ return -TARGET_EFAULT;
+ }
+ for (i = 0; i < nsops; i++) {
+ __get_user(sops[i].sem_num, &target_sembuf[i].sem_num);
+ __get_user(sops[i].sem_op, &target_sembuf[i].sem_op);
+ __get_user(sops[i].sem_flg, &target_sembuf[i].sem_flg);
+ }
+ unlock_user(target_sembuf, ptr, 0);
+
+ return semop(semid, sops, nsops);
+}
+
/* getdtablesize(2) */
static inline abi_long do_bsd_getdtablesize(void)
{