let recvmsg_nofd fd =
  match recvmsg_fd fd with
  | (Some fd, msg) -> (Unix.close fd; msg)
  | (None, msg) -> msg