The rule that the writ cannot be used as a writ of prrnr a nnli ae fn trvfnarlifinv, ings and if the committing magistrate had jurisdiction and there was competent evi dence, his decision may not be reviewed; Charlton v. Kelly, 229 U. S. 447, 33 Sup. Ct. 945, 57 L. Ed. 1274.
If the imprisonment be claimed by virtue of legal process, the validity and present force of such process are the only of investigation; Bennac v. People, 4 Barb. (N. Y.) 31; State v. Buzine, 4 Harr. (Del.) 575.
But such process cannot, in this proceed ing, lie invalidated by errors which only ren der it irregular. The defects, to entitle the prisoner to be discharged, must be such as to render the process void ; for the writ of habeas corpus is not, and cannot perform the office of, a writ of error ; Walbridge v. Hall, 3 Vt. 114 ; Cox v. White, 2 La. 422 ; People v. Cavanagh, 2 Park. Cr. Cas. (N. Y.) 650; People v. Nevins, 1 Hill (N. Y.) 154; 4 C. & P. 415; Ex parte Shaw, 7 Ohio St. 81, 70 Am. Dec. 55 ; In re Pikulik, 81 Wis. 158, 51 N. W. 261; Ex parte Bowen, 25 Fla. 214, 6 South. 65; Davis v. Beason, 133 U. S. 333, 10 Sup. Ct. 299, 33 L. Ed. 637; In re Schneider, 118 U. S. 162, 13 Sup. Ct. 572, 31 L. Ed. 406 ; In re Swan, 150 U. S.• 637; 14 Sup. Ct. 225, 37 L. Ed. 1207 ; In re King, 51 Fed. 434; In re Copenhaver, 118 Mo. 377, 24 S. W. 161, 40 Am. St. Rep. 382 ; but will only be issued if applied for to relieve from imprisonment under the order or sentence of some inferior federal court, when such court has acted without jurisdiction, or has exceeded Its jurisdiction, and its order is for that reason void; In re Boyd, 49 Fed. 48, 1 C. C. A. 156, 4 U. S. App. 73. It may be issued when the petitioner is under arrest but at large on bail; Mackenzie v. 141 Fed. 964, 73 C. C. A. 280, 5 Ann. Cas. 551.
Although the writ of habeas corpus does not lie for the determination of mere errors where a conviction has been had and the commitment thereunder is in due form, yet if the court had no jurisdiction of the of fence charged, or if it affirmatively appears by the record that the prisoner was tried and sentenced for the commission of an act which under the law constitutes no crime, the judgment is void and the prisoner should be discharged; In re Kowalsky, 73 CaL 120, 14 Pac. 399 ; Ex parte Mirande, 73 Cal. 365, 14 Pac. 888 ; In re Coy, 127 U. S. 731, 8- Sup.
Ct. 1263, 32 L. Ed. 274 ; In re Nielson, 131 U. S. 176, 9 Sup. Ct. 672, 33 L. Ed. 118 ; Ex par te Kitchen, 19 Nev. 178, 18 Pac. 886 ; Daniels v. Towers,.79 Ga. 785, 7 S. E. 120.
It cannot be used to oust another com petent and acting jurisdiction, or to divert or defeat the course of justice therein; Pel tier v. Pennington, 14 N. J. L. 312 ; Ex parte Gilchrist, 4 McCord (S. C.) 233 ; Com. v. Lecky, 1 Watts (Pa.) 66, 26 Am. Dec. 37; In re Sims, 7 Cush. (Mass.) 285 ; Ex parte Bushnell, 8 Ohio St. 599; In re Duncan, 139 U. S. 449, 11 Sup. Ct. 573, 35 L. Ed. 219. It was not intended by congress that the feder al courts should, by writs of habeas corpus, obstruct the ordinary administration of the criminal laws of the states through their own tribunals; In re Wood, 140 U. S. 278, 11 Sup. Ct. 738, 35 L. Ed. 505; McElvaine v. Brush,' 142 U. S. 155, 12 Sup. Ct. 156, 35 L. Ed. 971.
The only ground on which a court, with out some special statute authorizing it, will give relief on habeas corpus to a prisoner under conviction and sentence of another court, is the want of jurisdiction in such court over the person or the cause, or some other matter rendering its proceedings void ; In re Frederich, 149 U. S. 70, 13 Sup. Ct. 793, 37 L. Ed. 653 ; Wight v. Nicholson, 134 U. S. 136, 10 Sup. Ct. 487, 33 L. ; Ex parte Nielsen, 131 U. S. 176, 9 Sup. Ct. 672, 33 L. Ed. 118.
The writ is also, employed to recover the custody of a person where the applicant has a legal right thereto : as, the husband for his wife, the parent for his child, the guard ian for his ward, and the master for his ap prentice ; Green v. Campbell, 35 W. Va. 698, 14 S. E. 212, 29 Am. St. Rep. 843; Ex parte Chin King, 35 Fed. 354; [1892] App. Cas. 326. But in such cases, as the just object of the proceeding is rather to remove illegal re straint than to enforce specifically the claims of private custody, the alleged prisoner, if an adult of sound mind, is generally permitted to go at large; if an infant of sufficient age and discretion, it is usually permitted to elect in whose custody it will remain, pro vided that it does not elect an injurious or improper custody> and if of tender years, without such discretion, the court determines its custody according to what the true in terests and welfare of the child may at the time require; Hurd, Hab. Corp. 450.