linux的md5函数 tcgetattrfd:Input/outputerror什么原因?

tcgetattrfd:Input/outputerror什么原因?tcgetattr的定义如下:<termios。H><unistd。H>int tcgetattr(int FD,s

tcgetattrfd:Input/outputerror什么原因?

tcgetattr的定义如下:<termios。H><unistd。H>int tcgetattr(int FD,struct termios*termios)p)FD指打开串行端口时返回的文件描述符,struct termios结构包含串行端口的设置。因此,建议您检查串口4的设备文件是否存在,调用tcgetattr()的FD是否必须在程序调用open()之后使用close()之前,以及struct termios设置是否正确