kernel_termios.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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, write to the Free
  13. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  14. 02111-1307 USA. */
  15. #ifndef _KERNEL_TERMIOS_H
  16. #define _KERNEL_TERMIOS_H 1
  17. /* We need the definition of tcflag_t, cc_t, and speed_t. */
  18. #include <termios.h>
  19. /* The following corresponds to the values from the Linux 2.1.20 kernel. */
  20. #if defined( __sparc__ )
  21. #define __KERNEL_NCCS 17
  22. struct __kernel_termios
  23. {
  24. tcflag_t c_iflag; /* input mode flags */
  25. tcflag_t c_oflag; /* output mode flags */
  26. tcflag_t c_cflag; /* control mode flags */
  27. tcflag_t c_lflag; /* local mode flags */
  28. cc_t c_line; /* line discipline */
  29. cc_t c_cc[__KERNEL_NCCS]; /* control characters */
  30. };
  31. #elif defined(__powerpc__)
  32. #define __KERNEL_NCCS 19
  33. struct __kernel_termios
  34. {
  35. tcflag_t c_iflag; /* input mode flags */
  36. tcflag_t c_oflag; /* output mode flags */
  37. tcflag_t c_cflag; /* control mode flags */
  38. tcflag_t c_lflag; /* local mode flags */
  39. cc_t c_cc[__KERNEL_NCCS]; /* control characters */
  40. cc_t c_line; /* line discipline */
  41. speed_t c_ispeed; /* input speed */
  42. speed_t c_ospeed; /* output speed */
  43. };
  44. #define _HAVE_C_ISPEED 1
  45. #define _HAVE_C_OSPEED 1
  46. /* We have the kernel termios structure, so we can presume this code knows
  47. what it's doing... */
  48. #undef TCGETS
  49. #undef TCSETS
  50. #undef TCSETSW
  51. #undef TCSETSF
  52. #define TCGETS _IOR ('t', 19, struct __kernel_termios)
  53. #define TCSETS _IOW ('t', 20, struct __kernel_termios)
  54. #define TCSETSW _IOW ('t', 21, struct __kernel_termios)
  55. #define TCSETSF _IOW ('t', 22, struct __kernel_termios)
  56. #elif defined(__mips__)
  57. #define __KERNEL_NCCS 23
  58. struct __kernel_termios
  59. {
  60. tcflag_t c_iflag; /* input mode flags */
  61. tcflag_t c_oflag; /* output mode flags */
  62. tcflag_t c_cflag; /* control mode flags */
  63. tcflag_t c_lflag; /* local mode flags */
  64. cc_t c_line; /* line discipline */
  65. cc_t c_cc[__KERNEL_NCCS]; /* control characters */
  66. };
  67. #elif defined(__alpha__)
  68. #define __KERNEL_NCCS 19
  69. struct __kernel_termios
  70. {
  71. tcflag_t c_iflag; /* input mode flags */
  72. tcflag_t c_oflag; /* output mode flags */
  73. tcflag_t c_cflag; /* control mode flags */
  74. tcflag_t c_lflag; /* local mode flags */
  75. cc_t c_cc[__KERNEL_NCCS]; /* control characters */
  76. cc_t c_line; /* line discipline */
  77. speed_t c_ispeed; /* input speed */
  78. speed_t c_ospeed; /* output speed */
  79. };
  80. #define _HAVE_C_ISPEED 1
  81. #define _HAVE_C_OSPEED 1
  82. #else /* None of the above */
  83. #define __KERNEL_NCCS 19
  84. struct __kernel_termios
  85. {
  86. tcflag_t c_iflag; /* input mode flags */
  87. tcflag_t c_oflag; /* output mode flags */
  88. tcflag_t c_cflag; /* control mode flags */
  89. tcflag_t c_lflag; /* local mode flags */
  90. cc_t c_line; /* line discipline */
  91. cc_t c_cc[__KERNEL_NCCS]; /* control characters */
  92. };
  93. #endif
  94. #endif /* kernel_termios.h */