Clog.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. #include "stdinc.h"
  10. #include "9.h"
  11. /*
  12. * To do: This will become something else ('vprint'?).
  13. */
  14. int
  15. consVPrint(char* fmt, va_list args)
  16. {
  17. int len, ret;
  18. char buf[256];
  19. len = vsnprint(buf, sizeof(buf), fmt, args);
  20. ret = consWrite(buf, len);
  21. while (len-- > 0 && buf[len] == '\n')
  22. buf[len] = '\0';
  23. /*
  24. * if we do this, checking the root fossil (if /sys/log/fossil is there)
  25. * will spew all over the console.
  26. */
  27. if (0)
  28. syslog(0, "fossil", "%s", buf);
  29. return ret;
  30. }
  31. /*
  32. * To do: This will become 'print'.
  33. */
  34. int
  35. consPrint(char* fmt, ...)
  36. {
  37. int ret;
  38. va_list args;
  39. va_start(args, fmt);
  40. ret = consVPrint(fmt, args);
  41. va_end(args);
  42. return ret;
  43. }