I'm building a simple socket web server using the sys/socket.h lib, and I came across the socklen_t and sa_family_t data types and am a bit confused on what their actual purpose is.
Definition:
sa_family_t- unsigned integer type.socklen_t- an unsigned opaque integer type of length of at least 32-bits.
Now I understand that the <sys/socket> lib declares three structures (sockaddr,msghdr,cmsghdr) which contain members that declare these data types.
sa_family_t sa_family address familysocklen_t msg_namelen size of addresssocklen_t msg_controllen ancillary data buffer lensocklen_t cmsg_len data byte count, including the cmsghdr
But why create new data types, why not just use an unsigned int data type?