函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:ipc\shm.c Create Date:2022-07-27 18:23:11
Last Modify:2020-03-17 22:58:32 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:ksys_shmctl

函数原型:static long ksys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf, int version)

返回类型:long

参数:

类型参数名称
intshmid
intcmd
struct shmid_ds __user *buf
intversion
1146  如果cmd小于0或shmid小于0则返回:负EINVAL
1149  ns等于ipc_ns
1152  :cmd恒等于see ipcs
1154  err等于shmctl_ipc_info(ns, & shminfo)
1155  如果err小于0则返回:err
1157  如果copy_shminfo_to_user(buf, & shminfo, version)则err等于负EFAULT
1159  返回:err
1161  :cmd恒等于SHM_INFO
1163  err等于shmctl_shm_info(ns, & shm_info)
1164  如果err小于0则返回:err
1166  如果copy_to_user(buf, & shm_info, shm_info的长度)则err等于负EFAULT
1168  返回:err
1170  :cmd恒等于pcs ctl commands
1171  :cmd恒等于SHM_STAT_ANY
1172  :cmd恒等于get ipc_perm options
1173  err等于shmctl_stat(ns, shmid, cmd, & sem64)
1174  如果err小于0则返回:err
1176  如果copy_shmid_to_user(buf, & sem64, version)则err等于负EFAULT
1178  返回:err
1180  :cmd恒等于set ipc_perm options
1181  如果copy_shmid_from_user( & sem64, buf, version)则返回:负EFAULT
1184  :cmd恒等于move resource
1185  返回: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  :cmd恒等于super user shmctl commands
1187  :cmd恒等于SHM_UNLOCK
1188  返回:shmctl_do_lock(ns, shmid, cmd)
1189  默认
1190  返回:负EINVAL
调用者
名称描述
SYSCALL_DEFINE3