[fpc-pascal] Serial port access on Darwin PPC

Jonas Maebe jonas.maebe at elis.ugent.be
Tue Sep 23 14:54:16 CEST 2008

On 23 Sep 2008, at 14:24, Brad Campbell wrote:

> tios.c_cflag is used to obtain the baudrate constant, but it's not  
> then cleared before or'ing the other constants into it. Strangely  
> enough this works on linux x86, but breaks badly in MacOS PPC.

Uninitialised data often causes bugs like this.

> This patch makes it work for me on Linux X86 and OSX PPC.
> I'm not sure about the side effect of existing users to adding the  
> O_NONBLOCK in there, but this _must_ be in place for the port to  
> open in MacOS if there is no carrier detect.

Are you certain that this doesn't simply depend on some particular  
configuration of the serial port? I'm not a serial programming expert,  
but I assume that this behaviour can be changed with the stty program  
or with some ioctl


More information about the fpc-pascal mailing list