我有一个古老的调制解调器接口库,该库最初是为Solaris和Linux制作的,我正在尝试查看它是否适用于Linux。

在Linux上编译时,我看到了:

#if ! defined(WIN32)

#include <string.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <termios.h>
#include <sys/termiox.h>


它似乎无法找到termiox.h的位置,当我用google搜索它时,它只显示termios.h的结果

我不能简单地删除该引用,因为有很多调用它。

会有人碰巧知道在Linux下定义termiox调用的地方吗?

操作系统版本为RHEL 5.5

引用termiox库的代码只是说要忽略termiox选项:

 /home/local/NT/jayanthv/8.7/CallBur/lib/unix.c(556): error: struct "<unnamed>" has no field "termiox"
 if( modem_opt_ignore_termiox == No && ioctl( modem_handle, TCSETX, &mattr_current.termiox ) < 0 )


我应该继续在代码周围添加#if!defined()吗?

最佳答案

不要开玩笑。在man page linked by rodion的底部说:


  提供termiox(7I)系统调用是为了与
  不鼓励使用早期版本及其使用。相反,termio(7I)
  建议系统调用。


该手册页的日期为1990年。此后,termio has also become obsolete


  termio.h
      该头文件已过时,并且已被termios.h取代,这是POSIX标准的一部分。这两个头文件非常相似。但是,termios.h不包括与termio.h相同的头文件。因此,您应该确保直接查看termios.h标头,以确保它包含应用程序所需的所有内容。


因此,termiox替换为termio,termio替换了termios。

关于c - Linux的termiox.h等价物是什么?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12584575/

10-12 13:31