I’m afraid it is not possible.
In qnx4 there was dev_info() which allowed to get an “open_count” value. As far as i know there is no equivalent in qnx6.
You will probably have to implement this through another type of synchroniztion object like a named semaphore or similar concept.
(Also, the O_EXCL flag do not have meaning for serial device, it is used for regural files in conjunction with flag O_CREAT to make open() fail when the file already exists.)
in any version of MS Windows it’s possible, but not in QNX ?!
and what about Unix / Linux (especialy Red Hat based systems) ?
RedHat open( serial_port ) always return ok ?
is there any posix function that make open exclusive ?