函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:shmctl_stat

函数原型:static int shmctl_stat(struct ipc_namespace *ns, int shmid, int cmd, struct shmid64_ds *tbuf)

返回类型:int

参数:

类型参数名称
struct ipc_namespace *ns
intshmid
intcmd
struct shmid64_ds *tbuf
986  memset(tbuf, 0, tbuf的长度)
988  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
989  如果cmd恒等于pcs ctl commands cmd恒等于SHM_STAT_ANY
990  shp等于shm_obtain_object(ns, shmid)
991  如果是错误
992  err等于错误
993  转到:out_unlock
995  否则
996  shp等于shm_obtain_object_check(ns, shmid)
997  如果是错误
998  err等于错误
999  转到:out_unlock
1010  如果cmd恒等于SHM_STAT_ANYaudit_ipc_obj( & shm_perm)
1012  否则
1013  err等于负EACCES
1014  如果pcperms - check ipc permissions*@ns: ipc namespace*@ipcp: ipc permission set*@flag: desired permission set* Check user, group, other permissions for access* to ipc resources. return 0 if allowed*@flag will most probably be 0 or ``S_则转到:out_unlock
1018  err等于security_shm_shmctl( & shm_perm, cmd)
1019  如果err则转到:out_unlock
1022  ipc_lock_object( & shm_perm)
1024  如果非pc_valid_object() - helper to sort out IPC_RMID races for codepaths* where the respective ipc_ids.rwsem is not being held down.* Checks whether the ipc object is still around or if it's gone already, as
1025  ipc_unlock_object( & shm_perm)
1026  err等于负EIDRM
1027  转到:out_unlock
1030  kernel_to_ipc64_perm - convert kernel ipc permissions to user*@in: kernel permissions*@out: new style ipc permissions* Turn the kernel object @in into a set of permissions descriptions* for returning to userspace (@out).
1031  size of segment (bytes) 等于shm_segsz
1032  last attach time 等于shm_atim
1033  last detach time 等于shm_dtim
1034  last change time 等于shm_ctim
1036  shm_atime_high等于shm_atim右移32位
1037  shm_dtime_high等于shm_dtim右移32位
1038  shm_ctime_high等于shm_ctim右移32位
1040  pid of creator 等于pid_vnr(shm_cprid)
1041  pid of last operator 等于pid_vnr(shm_lprid)
1042  . of current attaches 等于shm_nattch
1044  如果cmd恒等于get ipc_perm options
1049  err等于0
1050  否则
1055  err等于id
1058  ipc_unlock_object( & shm_perm)
1059  out_unlock :
1060  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
1061  返回:err
调用者
名称描述
ksys_shmctl
compat_ksys_shmctl