函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:ipc\sem.c Create Date:2022-07-27 18:19:36
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:semctl_stat

函数原型:static int semctl_stat(struct ipc_namespace *ns, int semid, int cmd, struct semid64_ds *semid64)

返回类型:int

参数:

类型参数名称
struct ipc_namespace *ns
intsemid
intcmd
struct semid64_ds *semid64
1222  memset(semid64, 0, semid64的长度)
1224  _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
1225  如果cmd恒等于pcs ctl cmds cmd恒等于SEM_STAT_ANY
1226  sma等于sem_lock_(check_) routines are called in the paths where the rwsem* is not held.* The caller holds the RCU read lock.
1227  如果是错误
1228  err等于错误
1229  转到:out_unlock
1231  否则
1232  sma等于sem_obtain_object_check(ns, semid)
1233  如果是错误
1234  err等于错误
1235  转到:out_unlock
1240  如果cmd恒等于SEM_STAT_ANYaudit_ipc_obj( & permissions .. see ipc.h )
1242  否则
1243  err等于负EACCES
1244  如果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
1248  err等于security_sem_semctl( & permissions .. see ipc.h , cmd)
1249  如果err则转到:out_unlock
1252  ipc_lock_object( & permissions .. see ipc.h )
1254  如果非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
1255  ipc_unlock_object( & permissions .. see ipc.h )
1256  err等于负EIDRM
1257  转到:out_unlock
1260  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).
1261  semotime等于get_semotime(sma)
1262  last semop time 等于semotime
1263  last change time 等于create/last semctl() time
1265  sem_otime_high等于semotime右移32位
1266  sem_ctime_high等于create/last semctl() time 右移32位
1268  . of semaphores in array 等于. of semaphores in array
1270  如果cmd恒等于get ipc_perm options
1275  err等于0
1276  否则
1281  err等于id
1283  ipc_unlock_object( & permissions .. see ipc.h )
1284  out_unlock :
1285  _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()
1286  返回:err
调用者
名称描述
ksys_semctl
compat_ksys_semctl