Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:ipc\msg.c Create Date:2022-07-28 16:41:50
Last Modify:2020-03-17 22:56:56 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:ksys_msgctl

Proto:static long ksys_msgctl(int msqid, int cmd, struct msqid_ds __user *buf, int version)

Type:long

Parameter:

TypeParameterName
intmsqid
intcmd
struct msqid_ds __user *buf
intversion
576  If msqid < 0 || cmd < 0 Then Return -EINVAL
579  ns = ipc_ns
582  Case cmd == see ipcs
583  Case cmd == MSG_INFO
585  err = msgctl_info(ns, msqid, cmd, & msginfo)
586  If err < 0 Then Return err
588  If copy_to_user(buf, & msginfo, size of msginfo ) Then err = -EFAULT
590  Return err
592  Case cmd == pcs ctl commands
593  Case cmd == MSG_STAT_ANY
594  Case cmd == get ipc_perm options
595  err = msgctl_stat(ns, msqid, cmd, & msqid64)
596  If err < 0 Then Return err
598  If copy_msqid_to_user(buf, & msqid64, version) Then err = -EFAULT
600  Return err
601  Case cmd == set ipc_perm options
602  If copy_msqid_from_user( & msqid64, buf, version) Then Return -EFAULT
604  Return This function handles some msgctl commands which require the rwsem* to be held in write mode.* NOTE: no locks must be held, the rwsem is taken inside this function.
606  Case cmd == move resource
607  Return This function handles some msgctl commands which require the rwsem* to be held in write mode.* NOTE: no locks must be held, the rwsem is taken inside this function.
608  Default
609  Return -EINVAL
Caller
NameDescribe
SYSCALL_DEFINE3