【发布时间】:2012-09-25 14:00:26
【问题描述】:
我有一个古老的调制解调器接口库,它最初是为 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() 吗?
【问题讨论】:
-
它似乎来自 AIX——termiox.h 中定义了您需要的哪些调用/结构?即,在没有包含的情况下尝试编译时会出现什么错误?编辑:我们的 SunOS 服务器似乎也有 termiox。
-
我已经用信息更新了问题,您认为忽略调用 termiox 的代码是否明智?
-
很难说——我个人会继续尝试 :) 您发布的 ioctl 调用基本上将 modem_handle 的流控制设置设置为 mattr_current.termiox 中的设置。 mattr_current.termiox 是如何初始化的?
-
顺便说一句,这里是 SunOS termiox 手册页:www-it.desy.de/cgi-bin/man-cgi?termiox+7