Last change
on this file since 373 was 352, checked in by coas-nagasima, 6 years ago |
arm向けASP3版ECNLを追加
|
-
Property svn:eol-style
set to
native
-
Property svn:mime-type
set to
text/x-csrc;charset=UTF-8
|
File size:
605 bytes
|
Rev | Line | |
---|
[352] | 1 | #include <sys/sem.h>
|
---|
| 2 | #include <stdarg.h>
|
---|
| 3 | #include "syscall.h"
|
---|
| 4 | #include "ipc.h"
|
---|
| 5 |
|
---|
| 6 | union semun {
|
---|
| 7 | int val;
|
---|
| 8 | struct semid_ds *buf;
|
---|
| 9 | unsigned short *array;
|
---|
| 10 | };
|
---|
| 11 |
|
---|
| 12 | int semctl(int id, int num, int cmd, ...)
|
---|
| 13 | {
|
---|
| 14 | union semun arg = {0};
|
---|
| 15 | va_list ap;
|
---|
| 16 | switch (cmd) {
|
---|
| 17 | case SETVAL: case GETALL: case SETALL: case IPC_STAT: case IPC_SET:
|
---|
| 18 | case IPC_INFO: case SEM_INFO: case SEM_STAT:
|
---|
| 19 | va_start(ap, cmd);
|
---|
| 20 | arg = va_arg(ap, union semun);
|
---|
| 21 | va_end(ap);
|
---|
| 22 | }
|
---|
| 23 | #ifdef SYS_semctl
|
---|
| 24 | return syscall(SYS_semctl, id, num, cmd | IPC_64, arg.buf);
|
---|
| 25 | #else
|
---|
| 26 | return syscall(SYS_ipc, IPCOP_semctl, id, num, cmd | IPC_64, &arg.buf);
|
---|
| 27 | #endif
|
---|
| 28 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.