+ static struct iovec iov[2];
+ static struct {
+ struct cmsghdr h;
+ int fd;
+ } fd_buf = {
+ .h = {
+ .cmsg_len = sizeof(fd_buf),
+ .cmsg_level = SOL_SOCKET,
+ .cmsg_type = SCM_RIGHTS,
+ },
+ };
+ struct msghdr msghdr = {
+ .msg_iov = iov,
+ .msg_iovlen = ARRAY_SIZE(iov),
+ .msg_control = &fd_buf,
+ .msg_controllen = sizeof(fd_buf),
+ };
+
+ fd_buf.fd = ub->fd;
+ if (ub->fd < 0) {
+ msghdr.msg_control = NULL;
+ msghdr.msg_controllen = 0;
+ }