fork download
  1. #define _POSIX_C_SOURCE 200809L
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. int main()
  6. {
  7. enum{MAXSTRLEN=50000};
  8.  
  9. FILE *f = popen("uname -a","r");
  10. if(!f)
  11. return 1;
  12. char *string = calloc(MAXSTRLEN+1,1);
  13. size_t n=fread(string,1,MAXSTRLEN,f);
  14. if(!ferror(f))
  15. printf("%zu Zeichen gelesen: %s",n,string);
  16. fclose(f);
  17. free(string);
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 2288KB
stdin
Standard input is empty
stdout
72 Zeichen gelesen: Linux checker 2.6.34 #6 SMP Fri Jan 21 15:21:52 CET 2011 i686 GNU/Linux