Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ksys_shmctl

Proto:static long ksys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf, int version)

Type:long

Parameter:

TypeParameterName
intshmid
intcmd
struct shmid_ds __user *buf
intversion
1146  If cmd < 0 || shmid < 0 Then Return -EINVAL
1149  ns = ipc_ns
1152  Case cmd == see ipcs
1154  err = shmctl_ipc_info(ns, & shminfo)
1155  If err < 0 Then Return err
1157  If copy_shminfo_to_user(buf, & shminfo, version) Then err = -EFAULT
1159  Return err
1161  Case cmd == SHM_INFO
1163  err = shmctl_shm_info(ns, & shm_info)
1164  If err < 0 Then Return err
1166  If copy_to_user(buf, & shm_info, size of shm_info ) Then err = -EFAULT
1168  Return err
1170  Case cmd == pcs ctl commands
1171  Case cmd == SHM_STAT_ANY
1172  Case cmd == get ipc_perm options
1173  err = shmctl_stat(ns, shmid, cmd, & sem64)
1174  If err < 0 Then Return err
1176  If copy_shmid_to_user(buf, & sem64, version) Then err = -EFAULT
1178  Return err
1180  Case cmd == set ipc_perm options
1181  If copy_shmid_from_user( & sem64, buf, version) Then Return -EFAULT
1184  Case cmd == move resource
1185  Return This function handles some shmctl commands which require the rwsem* to be held in write mode.* NOTE: no locks must be held, the rwsem is taken inside this function.
1186  Case cmd == super user shmctl commands
1187  Case cmd == SHM_UNLOCK
1188  Return shmctl_do_lock(ns, shmid, cmd)
1189  Default
1190  Return -EINVAL
Caller
NameDescribe
SYSCALL_DEFINE3