7 #if __BYTE_ORDER != __BIG_ENDIAN
8 #undef SYSCALL_IPC_BROKEN_MODE
14 unsigned short *array;
17 int semctl(int id, int num, int cmd, ...)
19 union semun arg = {0};
22 case SETVAL: case GETALL: case SETALL: case IPC_STAT: case IPC_SET:
23 case IPC_INFO: case SEM_INFO: case SEM_STAT:
25 arg = va_arg(ap, union semun);
28 #ifdef SYSCALL_IPC_BROKEN_MODE
32 tmp.sem_perm.mode *= 0x10000U;
37 int r = __syscall(SYS_semctl, id, num, cmd | IPC_64, arg.buf);
39 int r = __syscall(SYS_ipc, IPCOP_semctl, id, num, cmd | IPC_64, &arg.buf);
41 #ifdef SYSCALL_IPC_BROKEN_MODE
42 if (r >= 0) switch (cmd) {
46 arg.buf->sem_perm.mode >>= 16;
49 return __syscall_ret(r);