函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:msgctl_stat

函数原型:static int msgctl_stat(struct ipc_namespace *ns, int msqid, int cmd, struct msqid64_ds *p)

返回类型:int

参数:

类型参数名称
struct ipc_namespace *ns
intmsqid
intcmd
struct msqid64_ds *p
497  memset(p, 0, p的长度)
499  _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
500  如果cmd恒等于pcs ctl commands cmd恒等于MSG_STAT_ANY
501  msq等于msq_obtain_object(ns, msqid)
502  如果是错误
503  err等于错误
504  转到:out_unlock
506  否则
507  msq等于msq_obtain_object_check(ns, msqid)
508  如果是错误
509  err等于错误
510  转到:out_unlock
515  如果cmd恒等于MSG_STAT_ANYaudit_ipc_obj( & q_perm)
517  否则
518  err等于负EACCES
519  如果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
523  err等于security_msg_queue_msgctl( & q_perm, cmd)
524  如果err则转到:out_unlock
527  ipc_lock_object( & q_perm)
529  如果非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
530  ipc_unlock_object( & q_perm)
531  err等于负EIDRM
532  转到:out_unlock
535  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).
536  last msgsnd time 等于last msgsnd time
537  last msgrcv time 等于last msgrcv time
538  last change time 等于last change time
540  msg_stime_high等于last msgsnd time 右移32位
541  msg_rtime_high等于last msgrcv time 右移32位
542  msg_ctime_high等于last change time 右移32位
544  current number of bytes on queue 等于current number of bytes on queue
545  umber of messages in queue 等于umber of messages in queue
546  max number of bytes on queue 等于max number of bytes on queue
547  pid of last msgsnd 等于pid_vnr(pid of last msgsnd )
548  last receive pid 等于pid_vnr(last receive pid )
550  如果cmd恒等于get ipc_perm options
555  err等于0
556  否则
561  err等于id
564  ipc_unlock_object( & q_perm)
565  out_unlock :
566  _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()
567  返回:err
调用者
名称描述
ksys_msgctl
compat_ksys_msgctl