+ }
+}
+
+/* Per-inferior data key. */
+static const struct inferior_data *inflow_inferior_data;
+
+static void
+inflow_inferior_data_cleanup (struct inferior *inf, void *arg)
+{
+ struct terminal_info *info;
+
+ info = inferior_data (inf, inflow_inferior_data);
+ if (info != NULL)
+ {
+ xfree (info->run_terminal);
+ xfree (info);
+ }
+}
+
+/* Get the current svr4 data. If none is found yet, add it now. This
+ function always returns a valid object. */
+
+static struct terminal_info *
+get_inflow_inferior_data (struct inferior *inf)
+{
+ struct terminal_info *info;
+
+ info = inferior_data (inf, inflow_inferior_data);
+ if (info == NULL)
+ {
+ info = XZALLOC (struct terminal_info);
+ set_inferior_data (inf, inflow_inferior_data, info);
+ }
+
+ return info;
+}
+
+/* This is a "inferior_exit" observer. Releases the TERMINAL_INFO member
+ of the inferior structure. This field is private to inflow.c, and
+ its type is opaque to the rest of GDB. PID is the target pid of
+ the inferior that is about to be removed from the inferior
+ list. */
+
+static void
+inflow_inferior_exit (int pid)
+{
+ struct inferior *inf = find_inferior_pid (pid);
+ struct terminal_info *info;