Armin Diehl wrote:
yes, that is better
function SerOpen(const DeviceName: String): TSerialHandle;
var
flags : cint;
begin
Result := fpopen(DeviceName, O_RDWR or O_NOCTTY or O_NONBLOCK);
if result > -1 then
begin
flags := fpfcntl(Result,F_GetFl);
fpfcntl(Result,F_SETFL,flags and (not O_NONBLOCK));
end;
end;
results in
open("/dev/ttyUSB0", O_RDWR|O_NOCTTY|O_NONBLOCK|O_LARGEFILE) = 10
fcntl(10, F_GETFL) = 0x8802 (flags
O_RDWR|O_NONBLOCK|O_LARGEFILE)
fcntl(10, F_SETFL, O_RDWR|O_LARGEFILE) = 0
i think this should be changed in serial.pp
But why have I not seen this problem on Debian despite having used this
unit extensively? And why have I not seen it when testing the modified
unit on Solaris with the SerOpen() function being unchanged?
--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk
[Opinions above are the author's, not those of his employers or colleagues]
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel