mirror of
https://git.musl-libc.org/git/musl
synced 2025-01-25 07:32:06 +03:00
add sysv ipc message queues (completely untested)
This commit is contained in:
parent
0438e9fd63
commit
8bb82b4e58
12
src/ipc/msgctl.c
Normal file
12
src/ipc/msgctl.c
Normal file
@ -0,0 +1,12 @@
|
||||
#include <sys/msg.h>
|
||||
#include "syscall.h"
|
||||
#include "ipc.h"
|
||||
|
||||
int msgctl(int q, int cmd, struct msqid_ds *buf)
|
||||
{
|
||||
#ifdef __NR_msgctl
|
||||
return syscall(SYS_msgctl, q, cmd, buf);
|
||||
#else
|
||||
return syscall(SYS_ipc, IPCOP_msgctl, q, cmd, buf);
|
||||
#endif
|
||||
}
|
12
src/ipc/msgget.c
Normal file
12
src/ipc/msgget.c
Normal file
@ -0,0 +1,12 @@
|
||||
#include <sys/msg.h>
|
||||
#include "syscall.h"
|
||||
#include "ipc.h"
|
||||
|
||||
int msgget(key_t k, int flag)
|
||||
{
|
||||
#ifdef __NR_msgget
|
||||
return syscall(SYS_msgget, k, flag);
|
||||
#else
|
||||
return syscall(SYS_ipc, IPCOP_msgget, k, flag);
|
||||
#endif
|
||||
}
|
17
src/ipc/msgrcv.c
Normal file
17
src/ipc/msgrcv.c
Normal file
@ -0,0 +1,17 @@
|
||||
#include <sys/msg.h>
|
||||
#include "syscall.h"
|
||||
#include "ipc.h"
|
||||
#include "libc.h"
|
||||
|
||||
ssize_t msgrcv(int q, void *m, size_t len, long type, int flag)
|
||||
{
|
||||
ssize_t r;
|
||||
CANCELPT_BEGIN;
|
||||
#ifdef __NR_msgrcv
|
||||
r = syscall(SYS_msgrcv, q, m, len, type, flag);
|
||||
#else
|
||||
r = syscall(SYS_ipc, IPCOP_msgrcv, q, len, flag, ((long[]){ (long)m, type }));
|
||||
#endif
|
||||
CANCELPT_END;
|
||||
return r;
|
||||
}
|
17
src/ipc/msgsnd.c
Normal file
17
src/ipc/msgsnd.c
Normal file
@ -0,0 +1,17 @@
|
||||
#include <sys/msg.h>
|
||||
#include "syscall.h"
|
||||
#include "ipc.h"
|
||||
#include "libc.h"
|
||||
|
||||
ssize_t msgsnd(int q, const void *m, size_t len, int flag)
|
||||
{
|
||||
ssize_t r;
|
||||
CANCELPT_BEGIN;
|
||||
#ifdef __NR_msgsnd
|
||||
r = syscall(SYS_msgsnd, q, m, len, flag);
|
||||
#else
|
||||
r = syscall(SYS_ipc, IPCOP_msgsnd, q, len, flag, m);
|
||||
#endif
|
||||
CANCELPT_END;
|
||||
return r;
|
||||
}
|
Loading…
Reference in New Issue
Block a user