Line | |
---|
1 | /*
|
---|
2 | posix/_tcsetattr.c
|
---|
3 |
|
---|
4 | Created: June 11, 1993 by Philip Homburg
|
---|
5 | */
|
---|
6 |
|
---|
7 | #define tcsetattr _tcsetattr
|
---|
8 | #define ioctl _ioctl
|
---|
9 | #include <errno.h>
|
---|
10 | #include <termios.h>
|
---|
11 | #include <sys/ioctl.h>
|
---|
12 | #include <sys/types.h>
|
---|
13 |
|
---|
14 | int tcsetattr(fd, opt_actions, termios_p)
|
---|
15 | int fd;
|
---|
16 | int opt_actions;
|
---|
17 | _CONST struct termios *termios_p;
|
---|
18 | {
|
---|
19 | int request;
|
---|
20 |
|
---|
21 | switch(opt_actions)
|
---|
22 | {
|
---|
23 | case TCSANOW: request = TCSETS; break;
|
---|
24 | case TCSADRAIN: request = TCSETSW; break;
|
---|
25 | case TCSAFLUSH: request = TCSETSF; break;
|
---|
26 | default: errno = EINVAL; return(-1);
|
---|
27 | };
|
---|
28 | return(ioctl(fd, request, (void *) termios_p));
|
---|
29 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.