gpt4 book ai didi

linux - 界面关闭时未删除 socat 设备文件

转载 作者:太空宇宙 更新时间:2023-11-04 10:18:59 27 4
gpt4 key购买 nike

我正在使用 socat 版本 1.7.3.2 从 VLAN 以太网设备创建字符设备以进行通信。我使用以下命令创 build 备:

socat INTERFACE:wwan0.vlan_dev1,type=2 PTY,mode=0777,rawer,link="/dev/ser_vlan0" &

它将文件创建为:

/dev/ser_vlan0 -> /dev/pts/22

即使在 wwan0 设备被移除后,文件 /dev/ser_vlan0/dev/pts/22 仍然存在。

有没有办法在 wwan0 不再存在时自动删除这些文件?

最佳答案

来自 socatOPTIONS文档:

-t <超时>:

When one channel has reached EOF, the write part of the other channel is shut down. Then, socat waits seconds before terminating. Default is 0.5 seconds. This timeout only applies to addresses where write and read part can be closed independently. When during the timeout interval the read part gives EOF, socat terminates without awaiting the timeout.

您需要将超时设置为0

关于linux - 界面关闭时未删除 socat 设备文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44717793/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com