I know that in general case int
size is compiler-dependant, but as Linux and other *nixes use int
as a file descriptor and are required by POSIX to be able to send the file descriptors through UNIX sockets via cmsghdr
structure, is there a specification that say how large is int
exactly? Otherwise 2 different compilers could end in ABI incompatible code.
I couldn't find any definitive standard except mention in IBM Knowledge Base that states that int
is 4 bytes on UNIX and Linux on both 64-bit and 32-bit platforms.