![](https://i-blog.csdnimg.cn/blog_migrate/593a2b380e94018e04cba13bafd77f8f.png)
一、Linux 4.19内核recvmmsg系统调用代码中文注释
/*
* Linux recvmmsg 接口
*/
int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen,
unsigned int flags, struct timespec *timeout)
{
int fput_needed, err, datagrams; // 文件引用计数标记、错误码和接收的数据报数
struct socket *sock; // 套接字结构
struct mmsghdr __user *entry; // 指向用户空间的多消息结构
struct compat_mmsghdr __user *compat_entry; // 兼容模式下的多消息结构
struct msghdr msg_sys; // 内核空间的消息头结构
struct timespec64 end_time; // 定义超时结束时间
struct timespec64 timeout64; // 用来存放经过转换的超时时间结构体
// 如果有超时设置,并且它不合法(负值或大于最大值),则返回 -EINVAL
if (timeout &&
poll_select_set_timeout(&end_time, timeout->tv_sec,
timeout->tv_nsec))
return -EI