Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Side by Side Diff: fusl/src/ipc/semctl.c

Issue 1573973002: Add a "fork" of musl as //fusl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fusl/src/ipc/msgsnd.c ('k') | fusl/src/ipc/semget.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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 }
OLDNEW
« no previous file with comments | « fusl/src/ipc/msgsnd.c ('k') | fusl/src/ipc/semget.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698