0

我有一个古老的调制解调器接口库,它最初是为 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 的位置,当我搜索它时,它只显示 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() 吗?

4

1 回答 1

0

没有开玩笑的古老。在rodion 链接的手册页底部,它说:

提供 termiox(7I) 系统调用是为了与以前的版本兼容,不鼓励使用它。相反,建议使用 termio(7I) 系统调用。

该手册页的日期为 1990 年。从那时起,termio 也已过时

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

于是termiox被termio取代,termio又被termios取代。

于 2012-09-25T16:59:10.580 回答