OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [uClibc/] [libc/] [misc/] [sysvipc/] [msgq.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1325 phoenix
#include <errno.h>
2
#include <sys/msg.h>
3
#include "ipc.h"
4
 
5
 
6
#ifdef L_msgctl
7
 
8
#ifdef __NR_msgctl
9
_syscall3(int, msgctl, int, msqid, int, cmd, struct msqid_ds *, buf);
10
#else
11
/* Message queue control operation.  */
12
int msgctl (int msqid, int cmd, struct msqid_ds *buf)
13
{
14
    return __ipc(IPCOP_msgctl ,msqid ,cmd ,0 ,buf);
15
}
16
#endif
17
#endif
18
 
19
 
20
#ifdef L_msgget
21
#ifdef __NR_msgget
22
_syscall2(int, msgget, key_t, key, int, msgflg)
23
#else
24
/* Get messages queue.  */
25
int msgget (key_t key, int msgflg)
26
{
27
    return __ipc(IPCOP_msgget ,key ,msgflg ,0 ,0);
28
}
29
#endif
30
#endif
31
 
32
 
33
struct new_msg_buf{
34
    struct msgbuf * oldmsg;
35
    long int r_msgtyp;       /* the fifth arg of __ipc */
36
};
37
/* Receive message from message queue.  */
38
 
39
 
40
#ifdef L_msgrcv
41
#ifdef __NR_msgrcv
42
_syscall5(int, msgrcv, int, msqid, void *, msgp, size_t, msgsz, long int, msgtyp, int, msgflg);
43
#else
44
int msgrcv (int msqid, void *msgp, size_t msgsz,
45
        long int msgtyp, int msgflg)
46
{
47
    struct new_msg_buf temp;
48
 
49
    temp.r_msgtyp = msgtyp;
50
    temp.oldmsg = msgp;
51
    return __ipc(IPCOP_msgrcv ,msqid ,msgsz ,msgflg ,&temp);
52
}
53
#endif
54
#endif
55
 
56
 
57
 
58
#ifdef L_msgsnd
59
#ifdef __NR_msgsnd
60
_syscall4(int, msgsnd, int, msqid, const void *, msgp, size_t, msgsz, int, msgflg);
61
#else
62
/* Send message to message queue.  */
63
int msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg)
64
{
65
    return __ipc(IPCOP_msgsnd, msqid, msgsz, msgflg, (void *)msgp);
66
}
67
#endif
68
#endif
69
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.