Any party to a proceeding on a writ of habeas corpus may procure the attendance of witnesses at the hearing, by subpoena, to be issued by the clerk of any superior court, under the same rules, regulations and penalties prescribed by law in other cases.
N.C. Gen. Stat. § 17-31