pty.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* Functions for pseudo TTY handling.
  2. Copyright (C) 1996-2020 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <https://www.gnu.org/licenses/>. */
  15. #ifndef _PTY_H
  16. #define _PTY_H 1
  17. #include <features.h>
  18. struct termios;
  19. struct winsize;
  20. #include <termios.h>
  21. #include <sys/ioctl.h>
  22. __BEGIN_DECLS
  23. /* Create pseudo tty master slave pair with NAME and set terminal
  24. attributes according to TERMP and WINP and return handles for both
  25. ends in AMASTER and ASLAVE. */
  26. extern int openpty (int *__amaster, int *__aslave, char *__name,
  27. const struct termios *__termp,
  28. const struct winsize *__winp) __THROW;
  29. /* Create child process and establish the slave pseudo terminal as the
  30. child's controlling terminal. */
  31. extern int forkpty (int *__amaster, char *__name,
  32. const struct termios *__termp,
  33. const struct winsize *__winp) __THROW;
  34. __END_DECLS
  35. #endif /* pty.h */