Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:compat_ksys_msgctl

Proto:static long compat_ksys_msgctl(int msqid, int cmd, void __user *uptr, int version)

Type:long

Parameter:

TypeParameterName
intmsqid
intcmd
void __user *uptr
intversion
711  ns = ipc_ns
713  If msqid < 0 || cmd < 0 Then Return -EINVAL
717  Case & == see ipcs
718  Case & == MSG_INFO
720  err = msgctl_info(ns, msqid, cmd, & msginfo)
721  If err < 0 Then Return err
723  If copy_to_user(uptr, & msginfo, size of msginfo ) Then err = -EFAULT
725  Return err
727  Case & == get ipc_perm options
728  Case & == pcs ctl commands
729  Case & == MSG_STAT_ANY
730  err = msgctl_stat(ns, msqid, cmd, & msqid64)
731  If err < 0 Then Return err
733  If copy_compat_msqid_to_user(uptr, & msqid64, version) Then err = -EFAULT
735  Return err
736  Case & == set ipc_perm options
737  If copy_compat_msqid_from_user( & msqid64, uptr, version) Then Return -EFAULT
739  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.
740  Case & == move resource
741  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.
742  Default
743  Return -EINVAL
Caller
NameDescribe
COMPAT_SYSCALL_DEFINE3