Let's say we want to create a socket using the "socket"-function. How does the compiler know that it has to invoke a system call for that corresponding function? Is there any internal table that records with functions belong to a specific set of library?
The usual method is this:
Your platform's library includes a function called socket
that contains the actual code needed to make a system call on your platform. The compiler reads in a header file that tells it that this function exists, the linker connects the compiled code to that function, and the library's implementation of that function makes the actual system call.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With