MCPcopy
hub / github.com/google/gvisor / Msgget

Function Msgget

pkg/sentry/syscalls/linux/sys_msgqueue.go:29–44  ·  view source on GitHub ↗

Msgget implements msgget(2).

(t *kernel.Task, sysno uintptr, args arch.SyscallArguments)

Source from the content-addressed store, hash-verified

27
28// Msgget implements msgget(2).
29func Msgget(t *kernel.Task, sysno uintptr, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error) {
30 key := ipc.Key(args[0].Int())
31 flag := args[1].Int()
32
33 private := key == linux.IPC_PRIVATE
34 create := flag&linux.IPC_CREAT == linux.IPC_CREAT
35 exclusive := flag&linux.IPC_EXCL == linux.IPC_EXCL
36 mode := linux.FileMode(flag & 0777)
37
38 r := t.IPCNamespace().MsgqueueRegistry()
39 queue, err := r.FindOrCreate(t, key, mode, private, create, exclusive)
40 if err != nil {
41 return 0, nil, err
42 }
43 return uintptr(queue.ID()), nil, nil
44}
45
46// Msgsnd implements msgsnd(2).
47func Msgsnd(t *kernel.Task, sysno uintptr, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error) {

Callers

nothing calls this directly

Calls 7

KeyTypeAlias · 0.92
FileModeTypeAlias · 0.92
MsgqueueRegistryMethod · 0.80
IPCNamespaceMethod · 0.80
IDMethod · 0.65
IntMethod · 0.45
FindOrCreateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…