kernel_termios.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /* Copyright (C) 1997 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, see
  13. <http://www.gnu.org/licenses/>. */
  14. #ifndef _KERNEL_TERMIOS_H
  15. #define _KERNEL_TERMIOS_H 1
  16. /* We need the definition of tcflag_t, cc_t, and speed_t. */
  17. #include <termios.h>
  18. /* The following corresponds to the values from the Linux 2.1.20 kernel. */
  19. #if defined( __sparc__ )
  20. #define __KERNEL_NCCS 17
  21. struct __kernel_termios
  22. {
  23. tcflag_t c_iflag; /* input mode flags */
  24. tcflag_t c_oflag; /* output mode flags */
  25. tcflag_t c_cflag; /* control mode flags */
  26. tcflag_t c_lflag; /* local mode flags */
  27. cc_t c_line; /* line discipline */
  28. cc_t c_cc[__KERNEL_NCCS]; /* control characters */
  29. };
  30. #elif defined(__powerpc__)
  31. #define __KERNEL_NCCS 19
  32. struct __kernel_termios
  33. {
  34. tcflag_t c_iflag; /* input mode flags */
  35. tcflag_t c_oflag; /* output mode flags */
  36. tcflag_t c_cflag; /* control mode flags */
  37. tcflag_t c_lflag; /* local mode flags */
  38. cc_t c_cc[__KERNEL_NCCS]; /* control characters */
  39. cc_t c_line; /* line discipline */
  40. speed_t c_ispeed; /* input speed */
  41. speed_t c_ospeed; /* output speed */
  42. };
  43. #define _HAVE_C_ISPEED 1
  44. #define _HAVE_C_OSPEED 1
  45. /* We have the kernel termios structure, so we can presume this code knows
  46. what it's doing... */
  47. #undef TCGETS
  48. #undef TCSETS
  49. #undef TCSETSW
  50. #undef TCSETSF
  51. #define TCGETS _IOR ('t', 19, struct __kernel_termios)
  52. #define TCSETS _IOW ('t', 20, struct __kernel_termios)
  53. #define TCSETSW _IOW ('t', 21, struct __kernel_termios)
  54. #define TCSETSF _IOW ('t', 22, struct __kernel_termios)
  55. #elif defined(__mips__)
  56. #define __KERNEL_NCCS 23
  57. struct __kernel_termios
  58. {
  59. tcflag_t c_iflag; /* input mode flags */
  60. tcflag_t c_oflag; /* output mode flags */
  61. tcflag_t c_cflag; /* control mode flags */
  62. tcflag_t c_lflag; /* local mode flags */
  63. cc_t c_line; /* line discipline */
  64. cc_t c_cc[__KERNEL_NCCS]; /* control characters */
  65. };
  66. #elif defined(__alpha__)
  67. #define __KERNEL_NCCS 19
  68. struct __kernel_termios
  69. {
  70. tcflag_t c_iflag; /* input mode flags */
  71. tcflag_t c_oflag; /* output mode flags */
  72. tcflag_t c_cflag; /* control mode flags */
  73. tcflag_t c_lflag; /* local mode flags */
  74. cc_t c_cc[__KERNEL_NCCS]; /* control characters */
  75. cc_t c_line; /* line discipline */
  76. speed_t c_ispeed; /* input speed */
  77. speed_t c_ospeed; /* output speed */
  78. };
  79. #define _HAVE_C_ISPEED 1
  80. #define _HAVE_C_OSPEED 1
  81. #else /* None of the above */
  82. #define __KERNEL_NCCS 19
  83. struct __kernel_termios
  84. {
  85. tcflag_t c_iflag; /* input mode flags */
  86. tcflag_t c_oflag; /* output mode flags */
  87. tcflag_t c_cflag; /* control mode flags */
  88. tcflag_t c_lflag; /* local mode flags */
  89. cc_t c_line; /* line discipline */
  90. cc_t c_cc[__KERNEL_NCCS]; /* control characters */
  91. };
  92. #endif
  93. #endif /* kernel_termios.h */