Socket function definition?

When reading the C source code, I see the socket function used to open the connection. When I look for a socket definition in the source code of the Linux kernel (version 3 and above) using grep , I can find more socket calls, but not a definition.

Where is socket indicated? Is this defined in the source code of the Ethernet card?

-1
source share
1 answer

The socket() function is not a kernel function, it is a libc .

If you want to learn socket() internals, get the glibc code (or any implementation of the standard C library), not the kernel code.

If you plan to go even deeper and learn how the kernel implements the socket mechanism, find the sys_socketcall() system call.

+1
source

Source: https://habr.com/ru/post/1285650/


All Articles