-/* Copyright (c) 2008 The Board of Trustees of The Leland Stanford
+/* Copyright (c) 2008, 2009 The Board of Trustees of The Leland Stanford
* Junior University
*
* We are making the OpenFlow specification and associated documentation
return p->status;
}
+int
+process_run(char **argv, int *status)
+{
+ struct process *p;
+ int retval;
+
+ retval = process_start(argv, NULL, 0, &p);
+ if (retval) {
+ *status = 0;
+ return retval;
+ }
+
+ while (!process_exited(p)) {
+ process_wait(p);
+ poll_block();
+ }
+ *status = process_status(p);
+ process_destroy(p);
+ return 0;
+}
+
/* Given 'status', which is a process status in the form reported by waitpid(2)
* and returned by process_status(), returns a string describing how the
* process terminated. The caller is responsible for freeing the string when
-/* Copyright (c) 2008 The Board of Trustees of The Leland Stanford
+/* Copyright (c) 2008, 2009 The Board of Trustees of The Leland Stanford
* Junior University
*
* We are making the OpenFlow specification and associated documentation
void process_destroy(struct process *);
int process_kill(const struct process *, int signr);
+int process_run(char **argv, int *status);
+
pid_t process_pid(const struct process *);
const char *process_name(const struct process *);
bool process_exited(struct process *);