Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:compat_ksys_shmctl

Proto:long compat_ksys_shmctl(int shmid, int cmd, void __user *uptr, int version)

Type:long

Parameter:

TypeParameterName
intshmid
intcmd
void __user *uptr
intversion
1341  ns = ipc_ns
1343  If cmd < 0 || shmid < 0 Then Return -EINVAL
1347  Case cmd == see ipcs
1349  err = shmctl_ipc_info(ns, & shminfo)
1350  If err < 0 Then Return err
1352  If copy_compat_shminfo_to_user(uptr, & shminfo, version) Then err = -EFAULT
1354  Return err
1356  Case cmd == SHM_INFO
1358  err = shmctl_shm_info(ns, & shm_info)
1359  If err < 0 Then Return err
1361  If put_compat_shm_info( & shm_info, uptr) Then err = -EFAULT
1363  Return err
1365  Case cmd == get ipc_perm options
1366  Case cmd == SHM_STAT_ANY
1367  Case cmd == pcs ctl commands
1368  err = shmctl_stat(ns, shmid, cmd, & sem64)
1369  If err < 0 Then Return err
1371  If copy_compat_shmid_to_user(uptr, & sem64, version) Then err = -EFAULT
1373  Return err
1375  Case cmd == set ipc_perm options
1376  If copy_compat_shmid_from_user( & sem64, uptr, version) Then Return -EFAULT
1379  Case cmd == move resource
1380  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.
1381  Case cmd == super user shmctl commands
1382  Case cmd == SHM_UNLOCK
1383  Return shmctl_do_lock(ns, shmid, cmd)
1384  Break
1385  Default
1386  Return -EINVAL
1388  Return err
Caller
NameDescribe
COMPAT_SYSCALL_DEFINE3