Summary
System call socket will do two things:
- create a
struct socket *sock.
Mainly done by__sock_create, which alloc astruct socket *sock,
then init it with thecreatingmethod ofnet_families[family]. - map the
sockto a file descriptor bysock_map_fd.
TODO…..
call trace:
1 | > socket |
For AF_INET socket pf->create is inet_create,
which will be duscussed here.
1 | 1368 SYSCALL_DEFINE3(socket, int, family, int, type, int, protocol) |
socket_create and __sock_create
1 | 1356 int sock_create(int family, int type, int protocol, struct socket **res) |
1 | 1243 int __sock_create(struct net *net, int family, int type, int protocol, |
What is pf->create? for PF_INET family please see here.
####
1 | 528 /** |