btestprint.c 251 B

1234567891011121314151617181920
  1. #include <u.h>
  2. #include <libc.h>
  3. #include <bio.h>
  4. void
  5. main(int argc, char **argv)
  6. {
  7. Biobuf b;
  8. char *s;
  9. int n;
  10. n = atoi(argv[1]);
  11. s = malloc(n+1);
  12. memset(s, 'a', n);
  13. s[n] = '\0';
  14. Binit(&b, 1, OWRITE);
  15. Bprint(&b, "%s\n", s);
  16. Bflush(&b);
  17. }