+/* True if the user did "target native". In that case, we won't
+ unpush the child target automatically when the last inferior is
+ gone. */
+static int inf_child_explicitly_opened;
+
+/* See inf-child.h. */
+
+void
+inf_child_open_target (struct target_ops *target, const char *arg,
+ int from_tty)
+{
+ target_preopen (from_tty);
+ push_target (target);
+ inf_child_explicitly_opened = 1;
+ if (from_tty)
+ printf_filtered ("Done. Use the \"run\" command to start a process.\n");
+}
+
+static void
+inf_child_open (const char *arg, int from_tty)
+{
+ inf_child_open_target (inf_child_ops, arg, from_tty);
+}
+
+/* Implement the to_disconnect target_ops method. */
+
+static void
+inf_child_disconnect (struct target_ops *target, const char *args, int from_tty)
+{
+ if (args != NULL)
+ error (_("Argument given to \"disconnect\"."));
+
+ /* This offers to detach/kill current inferiors, and then pops all
+ targets. */
+ target_preopen (from_tty);
+}
+
+/* Implement the to_close target_ops method. */
+