fork(1) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <sys/utsname.h>
  4.  
  5. int main(void) {
  6. struct utsname un;
  7. uname(&un);
  8. printf("%s %s\n", un.sysname, un.release);
  9. const size_t block = 4;
  10. size_t alloced = 0;
  11. for (;;) {
  12. void *p = malloc(block);
  13. if (!p) break;
  14. alloced += block;
  15. }
  16. printf("Done with %zu bytes\n", alloced);
  17. }
  18.  
Success #stdin #stdout 4.2s 1043456KB
stdin
Standard input is empty
stdout
Linux 2.6.32.46
Done with 266551292 bytes