Этот файл определяет много типов, используемых в других файлах. В старых системах необходимо было включить его перед другими системными заголовками.
Со страницы руководства для socket
системного вызова:
SYNOPSIS
#include <sys/types.h> /* See NOTES */
#include <sys/socket.h>
int socket(int domain, int type, int protocol);
...
NOTES
POSIX.1 does not require the inclusion of <sys/types.h>, and this
header file is not required on Linux. However, some historical (BSD)
implementations required this header file, and portable applications
are probably wise to include it.