where is socket header in linux
In case you have installed manual pages, the first stop should be man socket
.
Without manual pages you could call
find /usr/include -name socket.h
which outputs
/usr/include/asm/socket.h
/usr/include/sys/socket.h
/usr/include/bits/socket.h
/usr/include/linux/socket.h
on my system, the one to include is sys/socket.h
.
Also see the Single UNIX Specification.
sys/socket.h is not found for gcc arm x86_64-aarch64 cross compiling
As user253751 and Ian Abbott answered in comments, there are no header files because there is no operating system which defines "socket" entity.
Related Topics
Check If a Type Is from a Particular Namespace
Should C++ Programmer Avoid Memset
Is It Safe to Read an Integer Variable That's Being Concurrently Modified Without Locking
Do Polymorphism or Conditionals Promote Better Design
What Does 'Using Std::Swap' Inside the Body of a Class Method Implementation Mean
How to Initialize and Print a Std::Wstring
Why Isn't 'Std::Initializer_List' Defined as a Literal Type
Simple Ipc Between C++ and Python (Cross Platform)
I Want to Kill a Std::Thread Using Its Thread Object
Idiomatic Way to Declare C++ Immutable Classes
How to Execute a Piece of Code Only Once
C++ Template Function Compiles in Header But Not Implementation
Getting Clang to Work on Windows
Is 'Bool' a Basic Datatype in C++