In Linux, applications normally lock serial ports for exclusive use by creating a corresponding lock file in /var/lock/
with a name something like LCK..ttyS1
.
- Serial HOWTO: Locking Out Others
liblockdev
liblockfile
(thought it isn't as full-featured asliblockdev
—it doesn't handle symlinks or multiple device files with the same device numbers)
Does Mono implement this locking of serial ports? I found this bug report which suggests it doesn't.
Does Mono provide a library for locking other Linux devices, e.g. a custom char device /dev/custom-char-device
via /var/lock/LCK..custom-char-device
?
(Note: now I'm not even sure what is the "right way" to lock serial ports in Linux; see my other question about that.)