unistd.c 487 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Copyright (c) 2006-2018, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-09-01 Meco Man First Version
  9. */
  10. #include <unistd.h>
  11. #ifdef RT_USING_POSIX_TERMIOS
  12. #include "termios.h"
  13. int isatty(int fd)
  14. {
  15. struct termios ts;
  16. return(tcgetattr(fd,&ts) != -1);/*true if no error (is a tty)*/
  17. }
  18. #endif
  19. char *ttyname(int fd)
  20. {
  21. return "/dev/tty0"; /*TODO: need to add more specific*/
  22. }