How to make /dev/ttyACM0 (and friends) exclusive?

Jeffrey Walton noloader at gmail.com
Mon Mar 4 08:04:23 EST 2019


On Sun, Mar 3, 2019 at 6:00 AM Greg KH <greg at kroah.com> wrote:
>
> On Sun, Mar 03, 2019 at 03:55:44AM -0500, Jeffrey Walton wrote:
> > ...
>
> Again, go delete modem manager off of your system, it is the thing that
> keeps opening the port up to see if you have made a valid connection on
> the device or not.  If you write your own program to talk to the device,
> modem manager is not needed at all, and is known to cause this problem.

Thanks Greg. I deleted modem manager, then ran two instances of my
program. Both opened the device with O_EXCL, and both opens succeeded.
They proceeded to much with one another's state.

I don't think modem manager is the problem here.

The first problem is the way this device is setup. An exclusive
resource is being treated as a shared resource. The second problem is
open silently ignores flags. Epic fail.

Thanks again for the help.

Jeff



More information about the Kernelnewbies mailing list