本文共 1607 字,大约阅读时间需要 5 分钟。
retval = sock_create(family, type, protocol, &sock); |
int sock_create(int family, int type, int protocol, struct socket **res){ return __sock_create(current->nsproxy->net_ns, family, type, protocol, res, 0);} |
struct nsproxy { atomic_t count; struct uts_namespace *uts_ns; struct ipc_namespace *ipc_ns; struct mnt_namespace *mnt_ns; struct pid_namespace *pid_ns; struct net *net_ns;}; |
static int __sock_create(struct net *net, int family, int type, int protocol, struct socket **res, int kern){ int err; struct socket *sock; const struct net_proto_family *pf; /* * Check protocol is in range */ if (family 0 || family >= NPROTO) return -EAFNOSUPPORT; if (type 0 || type >= SOCK_MAX) return -EINVAL; /* } |
转载地址:https://blog.csdn.net/weixin_34223655/article/details/90064134 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!