/* * Copy timeout to local variable and call the syscall. */ int __semctl13(int semid, int semnum, int cmd, ...) { va_list ap; union __semun semun; struct semid_ds13 *ds13; struct semid_ds ds; int error; va_start(ap, cmd); switch (cmd) { case IPC_SET: case IPC_STAT: case GETALL: case SETVAL: case SETALL: #ifdef __lint__ memcpy(&semun, &ap, sizeof(semun)); #else semun = va_arg(ap, union __semun); #endif break; default: break; } va_end(ap); switch (cmd) { case IPC_SET: case IPC_STAT: ds13 = (void *)semun.buf; semun.buf = &ds; if (cmd == IPC_SET) __semid_ds13_to_native(ds13, &ds); break; default: ds13 = NULL; break; } error = ____semctl50(semid, semnum, cmd, &semun); if (error) return error; if (cmd == IPC_STAT) __native_to_semid_ds13(&ds, ds13); return 0; }
int semctl(int semid, int semnum, int cmd, ...) { va_list ap; union __semun semun; va_start(ap, cmd); switch (cmd) { case IPC_SET: case IPC_STAT: case GETALL: case SETVAL: case SETALL: #ifdef __lint__ memcpy(&semun, &ap, sizeof(semun)); #else semun = va_arg(ap, union __semun); #endif } va_end(ap); return ____semctl50(semid, semnum, cmd, &semun); }