Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:ipc\mqueue.c Create Date:2022-07-28 16:51:39
Last Modify:2020-03-17 23:00:47 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:do_mq_timedreceive

Proto:static int do_mq_timedreceive(mqd_t mqdes, char __user *u_msg_ptr, size_t msg_len, unsigned int __user *u_msg_prio, struct timespec64 *ts)

Type:int

Parameter:

TypeParameterName
mqd_tmqdes
char __user *u_msg_ptr
size_tmsg_len
unsigned int __user *u_msg_prio
struct timespec64 *ts
1091  ktime_t expires, * timeout = NULL
1092  struct posix_msg_tree_node * new_leaf = NULL
1094  If ts Then
1095  expires = vert a timespec64 to ktime_t format:
1096  timeout = expires
1099  audit_mq_sendrecv(mqdes, msg_len, 0, ts)
1101  f = fdget(mqdes)
1102  If Value for the false possibility is greater at compile time(!file) Then
1103  ret = -EBADF
1104  Go to out
1107  inode = file_inode(file)
1108  If Value for the false possibility is greater at compile time(f_op != & mqueue_file_operations) Then
1109  ret = -EBADF
1110  Go to out_fput
1112  info = MQUEUE_I(inode)
1113  audit_file(file)
1115  If Value for the false possibility is greater at compile time(!(f_mode & le is open for reading )) Then
1116  ret = -EBADF
1117  Go to out_fput
1121  If Value for the false possibility is greater at compile time(msg_len < maximum message size ) Then
1122  ret = -EMSGSIZE
1123  Go to out_fput
1131  If Not node_cache Then new_leaf = Allocation memory
1134  spin_lock( & lock)
1136  If Not node_cache && new_leaf Then
1138  Initialization list head
1139  node_cache = new_leaf
1140  Else
1141  kfree(new_leaf)
1144  If number of messages currently queued == 0 Then
1145  If f_flags & O_NONBLOCK Then
1146  spin_unlock( & lock)
1147  ret = -EAGAIN
1148  Else
1154  Else
1157  msg_ptr = msg_get(info)
1159  i_atime = i_mtime = i_ctime = current_time(inode)
1163  pipelined_receive() - if there is task waiting in sys_mq_timedsend()* gets its message and put to the queue (we have one free place for sure).
1164  spin_unlock( & lock)
1165  wake_up_q( & wake_q)
1166  ret = 0
1168  If ret == 0 Then
1169  ret = message text size
1173  ret = -EFAULT
1175  free_msg(msg_ptr)
1177  out_fput :
1178  fdput(f)
1179  out :
1180  Return ret
Caller
NameDescribe
SYSCALL_DEFINE5