If a serial port is opened with O_DSYNC set, does this mean that a write()
won’t return until all data has made it out onto the serial line?
I know that dev_arm() using the drain event does not work this way, since it
triggers too early because of the way Dev and Dev.ser buffer data. I would
have thought that O_DSYNC would suffer from the same limitation.
Any comments?
Kevin Miller <kevin.miller@transcore.com> wrote:
If a serial port is opened with O_DSYNC set, does this mean that a write()
won’t return until all data has made it out onto the serial line?
Not all flags to an open() call are equally applicable to all types
of devices – if you read the details about O_DSYNC, it pretty clearly
is intended to apply to files – not to stream devices. I would expect
that it is completely ignored by serial ports.
(e.g. the phrase that says it “will be readable on any subsequent open
of the file” is meaningless for a serial port. Similarly O_NONBLOCK
is basically meaningless for a file.)
-David
QNX Training Services
dagibbs@qnx.com