aboutsummaryrefslogtreecommitdiff
path: root/win32/termios.c
diff options
context:
space:
mode:
Diffstat (limited to 'win32/termios.c')
-rw-r--r--win32/termios.c43
1 files changed, 39 insertions, 4 deletions
diff --git a/win32/termios.c b/win32/termios.c
index 658af4a26..108a746ef 100644
--- a/win32/termios.c
+++ b/win32/termios.c
@@ -1,13 +1,26 @@
1#include "libbb.h" 1#include "libbb.h"
2 2
3int tcsetattr(int fd UNUSED_PARAM, int mode UNUSED_PARAM, const struct termios *t UNUSED_PARAM) 3static struct termios dummy = {
4 0, /* c_iflag */
5 0, /* c_oflag */
6 0, /* c_cflag */
7 0, /* c_lflag */
8 '\0', /* c_line */
9 "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", /* c_cc[NCCS] */
10 B9600, /* c_ispeed */
11 B9600 /* c_ospeed */
12};
13
14int tcsetattr(int fd UNUSED_PARAM, int mode UNUSED_PARAM, const struct termios *t)
4{ 15{
5 return -1; 16 dummy = *t;
17 return 0;
6} 18}
7 19
8int tcgetattr(int fd UNUSED_PARAM, struct termios *t UNUSED_PARAM) 20int tcgetattr(int fd UNUSED_PARAM, struct termios *t)
9{ 21{
10 return -1; 22 *t = dummy;
23 return 0;
11} 24}
12 25
13int64_t FAST_FUNC read_key(int fd, char *buf UNUSED_PARAM, int timeout) 26int64_t FAST_FUNC read_key(int fd, char *buf UNUSED_PARAM, int timeout)
@@ -81,3 +94,25 @@ int64_t FAST_FUNC read_key(int fd, char *buf UNUSED_PARAM, int timeout)
81 SetConsoleMode(cin, mode); 94 SetConsoleMode(cin, mode);
82 return ret; 95 return ret;
83} 96}
97
98speed_t cfgetispeed(const struct termios *termios_p)
99{
100 return termios_p->c_ispeed;
101}
102
103speed_t cfgetospeed(const struct termios *termios_p)
104{
105 return termios_p->c_ospeed;
106}
107
108int cfsetispeed(struct termios *termios_p, speed_t speed)
109{
110 termios_p->c_ispeed = speed;
111 return 0;
112}
113
114int cfsetospeed(struct termios *termios_p, speed_t speed)
115{
116 termios_p->c_ospeed = speed;
117 return 0;
118}