move socklen, msghdr, cmsghdr to common code