在同一个项目中包含<termios.h>和<asm / termios.h>

我想要实现的:我想为某些类似tty*UART映射的terminal设置自定义的baud rate值。

方法:我发现的唯一方法是使用位于<asm/termios>头部的struct termios2结构(如这里所述 ,第一个答案)。

我的解决scheme工作得很好,但现在我需要使用一些function:

 speed_t cfgetispeed(const struct termios *); int tcdrain(int); int tcflow(int, int); int tcflush(int, int); int tcgetattr(int, struct termios *); pid_t tcgetsid(int); int tcsendbreak(int, int); int tcsetattr(int, int, struct termios *); 

问题是在<asm/termios.h>中没有这样的函数,我需要包含<termios.h>才能使用它们。

问题:如果我同时包含头文件( <asm/termios.h><termios.h> ),编译器会对函数和结构重新声明进行尖叫,他是对的。

我怎样才能解决这个问题,而不使用一些模糊的做法(比如像在这里提到的, 在命名空间中包装头部之一)?