Leaks the remaining file descriptors.

You should probably set the close-on-exec flag on the file descriptors first.  Linux has a MSG_CMSG_CLOEXEC flag that you can pass to recvmsg() which does that atomically but it wasn't added until 2.6.22 or 2.6.23.  You'll need a fallback path for when recvmsg() returns EINVAL.