csocketsnetwork-programming

What is SOL_SOCKET used for?


As it is stated in the Linux man page

Use this constant as the level argument to getsockopt or setsockopt to manipulate the socket-level options described in this section

But I don't get this explanation. What is the purpose of SOL_SOCKET? What does it do?


Solution

  • SOL_SOCKET is the socket layer itself. It is used for options that are protocol independent.

    You can read more here.