move msghdr, cmsghdr to common code