Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:ipc\msg.c Create Date:2022-07-28 16:41:46
Last Modify:2020-03-17 22:56:56 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:msgctl_stat

Proto:static int msgctl_stat(struct ipc_namespace *ns, int msqid, int cmd, struct msqid64_ds *p)

Type:int

Parameter:

TypeParameterName
struct ipc_namespace *ns
intmsqid
intcmd
struct msqid64_ds *p
497  memset(p, 0, size of 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  If cmd == pcs ctl commands || cmd == MSG_STAT_ANY Then
501  msq = msq_obtain_object(ns, msqid)
502  If IS_ERR(msq) Then
503  err = PTR_ERR(msq)
504  Go to out_unlock
506  Else
507  msq = msq_obtain_object_check(ns, msqid)
508  If IS_ERR(msq) Then
509  err = PTR_ERR(msq)
510  Go to out_unlock
515  If cmd == MSG_STAT_ANY Then audit_ipc_obj( & q_perm)
517  Else
518  err = -EACCES
519  If 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_ Then Go to out_unlock
523  err = security_msg_queue_msgctl( & q_perm, cmd)
524  If err Then Go to out_unlock
527  ipc_lock_object( & q_perm)
529  If Not 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 Then
530  ipc_unlock_object( & q_perm)
531  err = -EIDRM
532  Go to 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  If cmd == get ipc_perm options Then
555  err = 0
556  Else
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  Return err
Caller
NameDescribe
ksys_msgctl
compat_ksys_msgctl