2
0

run.c 444 B

12345678910111213141516171819
  1. #include <stdlib.h>
  2. #include <reproc/run.h>
  3. // Start a process from the arguments given on the command line. Inherit the
  4. // parent's standard streams and allow the process to run for maximum 5 seconds
  5. // before terminating it.
  6. int main(int argc, const char **argv)
  7. {
  8. (void) argc;
  9. int r = reproc_run(argv + 1, (reproc_options){ .deadline = 5000 });
  10. if (r < 0) {
  11. fprintf(stderr, "%s\n", reproc_strerror(r));
  12. }
  13. return abs(r);
  14. }