How to open() device or file in that way
that next call to open() the same device will fail ?
I try to open it in these ways:
dev_fd = open( “/dev/ser1”, O_RDWR | O_EXCL | O_NOCTTY | O_NONBLOCK );
dev_fd = sopen( “/dev/ser1”, O_RDWR | O_EXCL | O_NOCTTY | O_NONBLOCK,
SH_DENYRW );
…but before close() I can open or sopen the same dev again without any
errors (?!).
How to exclusive open serial device ?