Locking Linux Serial Port

前端 未结 2 1002
庸人自扰
庸人自扰 2021-01-06 03:08

I have an issue that I\'m trying to solve regarding the serial port in Linux. I\'m able to open, read from, and close the port just fine. However, I want to ensure that I

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-06 03:16

    I was able to fix the issue with use of the flock() function. Use of the structure and fcntl() wasn't working for me for some reason. With use of flock() I was able to add two lines of code and solve my issue.

提交回复
热议问题