tty.h 682 B

12345678910111213141516171819
  1. /* Per-terminal output queues for ring-3 commands.
  2. *
  3. * The terminal process owns the display; commands write bytes here and the
  4. * terminal reads/renders them. One tty per terminal, inherited by children. */
  5. #ifndef TTY_H
  6. #define TTY_H
  7. #define TTY_MAX 4
  8. #define TTY_BUF 4096
  9. int tty_create(void); /* owner = current process */
  10. void tty_close(int id);
  11. int tty_write(int id, const char *buf, unsigned int len); /* 0/-1, blocks */
  12. int tty_write_str(int id, const char *s);
  13. int tty_read(int id, char *buf, unsigned int max); /* bytes, 0 if none */
  14. int tty_valid(int id);
  15. void tty_reap(unsigned int pid); /* schedule() reaper hook */
  16. #endif