File: tty_ioctl.h

package info (click to toggle)
twin 0.4.0-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,804 kB
  • ctags: 23,904
  • sloc: ansic: 61,860; cpp: 1,023; makefile: 777; sh: 552; lex: 302; yacc: 231
file content (30 lines) | stat: -rw-r--r-- 676 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef _TWIN_TTY_IOCTL_H
#define _TWIN_TTY_IOCTL_H

#ifndef RETSIGTYPE
# include "autoconf.h"
#endif

#if defined(HAVE_TERMIOS_H)
# include <termios.h>
#elif defined(HAVE_TERMIO_H)
# include <termio.h>
#endif

#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif

#ifdef TCSETS
# define tty_setioctl(tty_fd, ttyb) ioctl((tty_fd), TCSETS, (ttyb))
# define tty_getioctl(tty_fd, ttyb) ioctl((tty_fd), TCGETS, (ttyb))
#else
# ifdef TCSANOW
#  define tty_setioctl(tty_fd, ttyb) tcsetattr((tty_fd), TCSANOW, (ttyb))
#  define tty_getioctl(tty_fd, ttyb) tcgetattr((tty_fd), (ttyb))
# else
#  error TCSETS and TCSANOW both undefined.
# endif
#endif

#endif /* _TWIN_TTY_IOCTL_H */