fork download
  1. #include <string.h>
  2. #include <stdio.h>
  3. #include <errno.h>
  4. #include <unistd.h>
  5.  
  6. int main(int argc, char *argv[]){
  7. char *my_env[] = {"FOOD=coffee",NULL};
  8. if (execle("./coffee","./coffee","donuts",NULL,my_env) == -1){
  9. fprintf(stderr,"Can't run process 0: %s\n",strerror(errno));
  10. return 1;
  11. }
  12. fprintf(stderr,"Can't create order: %s\n",strerror(errno));
  13. return 1;
  14. return 0;
  15. }
  16.  
Runtime error #stdin #stdout #stderr 0s 3292KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Can't run process 0: No such file or directory