1
0

conswrite.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * This file is part of Jehanne.
  3. *
  4. * Copyright (C) 2015 Giacomo Tesio <giacomo@tesio.it>
  5. *
  6. * Jehanne is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, version 2 of the License.
  9. *
  10. * Jehanne is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #include <u.h>
  19. #include <lib9.h>
  20. #define BUFSZ (32*1024)
  21. void
  22. main(void)
  23. {
  24. int w;
  25. char msg[BUFSZ];
  26. print("This test write 32k 1 to stderr to test /dev/cons behaviour.\n");
  27. print("The test pass if the everything get written, including 'PASS'.\n");
  28. memset(msg, '1', BUFSZ);
  29. if((w = jehanne_write(2, msg, BUFSZ)) < BUFSZ){
  30. print("\nFAIL, written %d instead of %d\n", w, BUFSZ);
  31. exits("FAIL");
  32. }
  33. print("\nPASS\n");
  34. exits("PASS");
  35. }