let recvmsg fd =
  match recvmsg_fd fd with
  | (None, msg) -> msg
  | (Some fd, msg) -> raise (Recvfd (fd, msg))