提交 6ad3f09b 编写于 作者: N Natanael Copa 提交者: Peter Maydell

util/qemu-openpty: fix build with musl libc by include termios.h as fallback

Include termios.h as POSIX fallback when not glibc, bsd or solaris.
POSIX says that termios.h should define struct termios and TCAFLUSH.
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/termios.h.html

This fixes the following compile errors with musl libc:

util/qemu-openpty.c: In function 'qemu_openpty_raw':
util/qemu-openpty.c:112:20: error: storage size of 'tty' isn't known
     struct termios tty;
                    ^
...
util/qemu-openpty.c:128:24: error: 'TCSAFLUSH' undeclared (first use in this function)
     tcsetattr(*aslave, TCSAFLUSH, &tty);
                        ^
Signed-off-by: NNatanael Copa <ncopa@alpinelinux.org>
Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
上级 b7b5233a
...@@ -47,6 +47,8 @@ ...@@ -47,6 +47,8 @@
#elif defined CONFIG_SOLARIS #elif defined CONFIG_SOLARIS
# include <termios.h> # include <termios.h>
# include <stropts.h> # include <stropts.h>
#else
# include <termios.h>
#endif #endif
#ifdef __sun__ #ifdef __sun__
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册