Ssize_t is signed
Size_t,
Size_t is defined in the Standard C library and should be an unsigned int.
Socket_t:
The data type "socklen_t" and int should have the same length. otherwise, the filling of the BSD socket layer will be damaged. POSIX started with size_t, Linus Torvalds (he wanted more people, but apparently not a lot) and tried to explain to them that using size_t is totally wrong, because in the 64-bit structure, the length of size_t and int is different, and the length of this parameter (that is, the third parameter of the accept function) must be the same as that of int, this is the BSD socket interface standard. in the end, the POSIX guys found a solution, which is to create a new type "socklen_t ". linux Torvalds says this is because they have found their own errors but are embarrassed to admit it to the big guys, so they have created a new data type.
To enhance program portability, We have size_t, which is defined to facilitate migration between systems. size_t may be different in different systems.
It is defined as unsigned int on a 32-bit system.
That is to say, on a 32-bit system, it is a 32-bit unsigned integer.
Defined as unsigned long on a 64-bit System
That is to say, in a 64-bit system, it is a 64-bit unsigned integer.
Size_t is generally used to indicate a type of counting, such as how many items are copied. For example, the result type of the sizeof operator is size_t,
This type ensures that it can accommodate the maximum object size.
It is generally an unsigned integer type suitable for measuring the number of data items that can be accommodated in the memory ".
Therefore, it is widely used in array subscript and memory management functions.
Ssize_t: indicates the size of data blocks that can be read/written. it is similar to size_t, but must be signed. meaning: it indicates the sign size_t type.