LOG_DBG ((LOG_SYSDEP, 90, "mm_send_fd: send %d", fd));
mm_send_fd (int socket, int fd){  struct msghdr msg;  char tmp[CMSG_SPACE (sizeof (int))];  struct cmsghdr *cmsg;  struct iovec vec;  char ch = '\0';  ssize_t n;  memset(&msg, 0, sizeof msg);  msg.msg_control = (caddr_t)tmp;  msg.msg_controllen = CMSG_LEN (sizeof (int));  cmsg = CMSG_FIRSTHDR (&msg);  cmsg->cmsg_len = CMSG_LEN (sizeof (int));  cmsg->cmsg_level = SOL_SOCKET;  cmsg->cmsg_type = SCM_RIGHTS;  *(int *)CMSG_DATA (cmsg) = fd;  vec.iov_base = &ch;  vec.iov_len = 1;  msg.msg_iov = &vec;  msg.msg_iovlen = 1;  if ((n = sendmsg (socket, &msg, 0)) == -1)    {      log_error ("%s: sendmsg(%d)", __func__, fd);      return -1;    }  if (n != 1)    {      log_error ("%s: sendmsg: expected sent 1 got %ld", __func__, (long)n);      return -1;    }  return 0;}