Function report | 
Source Code:ipc\msg.c | 
Create Date:2022-07-28 16:42:37 | 
| Last Modify:2020-03-17 22:56:56 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:do_msgrcv
Proto:static long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgflg, long (*msg_handler)(void __user *, struct msg_msg *, size_t ))
Type:long
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| int | msqid | |
| void __user * | buf | |
| size_t | bufsz | |
| long | msgtyp | |
| int | msgflg | |
| long (* | msg_handler | 
| 1081 | If msgflg & copy (not remove) all queue messages Then | 
| 1082 | If msgflg & cv any msg except of specified type. || Not (msgflg & urn error on wait ) Then Return -EINVAL | 
| 1088 | mode = convert_mode( & msgtyp, msgflg) | 
| 1091 | msq = msq_obtain_object_check(ns, msqid) | 
| 1098 | cycle | 
| 1105 | ipc_lock_object( & q_perm) | 
| 1110 | Go to out_unlock0 | 
| 1119 | If bufsz < message text size && Not (msgflg & error if message is too big ) Then | 
| 1121 | Go to out_unlock0 | 
| 1127 | If msgflg & copy (not remove) all queue messages Then | 
| 1129 | Go to out_unlock0 | 
| 1133 | umber of messages in queue -- | 
| 1135 | ipc_update_pid( & last receive pid , task_tgid(current process)) | 
| 1137 | atomic_sub(message text size , & msg_bytes) | 
| 1138 | atomic_dec( & msg_hdrs) | 
| 1141 | Go to out_unlock0 | 
| 1145 | If msgflg & urn error on wait Then | 
| 1147 | Go to out_unlock0 | 
| 1151 | r_tsk = current process | 
| 1154 | If msgflg & error if message is too big Then r_maxsize = INT_MAX | 
| 1161 | ipc_unlock_object( & q_perm) | 
| 1163 | schedule() | 
| 1187 | If msg != ERR_PTR( - EAGAIN) Then Go to out_unlock1 | 
| 1194 | ipc_lock_object( & q_perm) | 
| 1197 | If msg != ERR_PTR( - EAGAIN) Then Go to out_unlock0 | 
| 1201 | If signal_pending(current process) Then | 
| 1202 | msg = ERR_PTR( - start if no handler.. ) | 
| 1203 | Go to out_unlock0 | 
| 1206 | ipc_unlock_object( & q_perm) | 
| 1209 | out_unlock0 : | 
| 1210 | ipc_unlock_object( & q_perm) | 
| 1212 | out_unlock1 : | 
| 1219 | bufsz = msg_handler(buf, msg, bufsz) | 
| 1222 | Return bufsz | 
| Name | Describe | 
|---|---|
| ksys_msgrcv | |
| compat_ksys_msgrcv | 
| Source code conversion tool public plug-in interface  | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion  |