receive returns a message from the queue with the given ID. If msgCopy is true, a message is copied from the queue without being removed. Otherwise, a message is removed from the queue and returned.
(t *kernel.Task, id ipc.ID, mType int64, maxSize uint64, flags int32)
| 106 | // true, a message is copied from the queue without being removed. Otherwise, |
| 107 | // a message is removed from the queue and returned. |
| 108 | func receive(t *kernel.Task, id ipc.ID, mType int64, maxSize uint64, flags int32) (*msgqueue.Message, error) { |
| 109 | if flags&linux.MSG_COPY != 0 { |
| 110 | if flags&(linux.IPC_NOWAIT|linux.MSG_EXCEPT) != linux.IPC_NOWAIT { |
| 111 | return nil, linuxerr.EINVAL |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | queue, err := t.IPCNamespace().MsgqueueRegistry().FindByID(id) |
| 116 | if err != nil { |
| 117 | return nil, err |
| 118 | } |
| 119 | pid := int32(t.ThreadGroup().ID()) |
| 120 | return queue.Receive(t, mType, maxSize, flags, pid) |
| 121 | } |
| 122 | |
| 123 | // Msgctl implements msgctl(2). |
| 124 | func Msgctl(t *kernel.Task, sysno uintptr, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error) { |
no test coverage detected
searching dependent graphs…