1SOCKFD_LOOKUP(9) Linux Networking SOCKFD_LOOKUP(9)
2
3
4
6 sockfd_lookup - Go from a file number to its socket slot
7
9 struct socket * sockfd_lookup(int fd, int * err);
10
12 fd
13 file handle
14
15 err
16 pointer to an error code return
17
19 The file handle passed in is locked and the socket it is bound too is
20 returned. If an error occurs the err pointer is overwritten with a
21 negative errno code and NULL is returned. The function checks for both
22 invalid handles and passing a handle which is not a socket.
23
24 On a success the socket object pointer is returned.
25
27Kernel Hackers Manual 3.10 June 2019 SOCKFD_LOOKUP(9)