I have actually been able to do this using the serial_struct
struct and ASYNC_SAK
flag using ioctl()
as follows
serial_struct s_serial;
memset(&s_serial,0,sizeof(s_serial));
ioctl(current_fd, TIOCGSERIAL, &s_serial);
s_serial.flags &= ~ASYNC_SAK;
ioctl(current_fd, TIOCSSERIAL, &s_serial);
I am still at a loss as to why opening the serial port had overridden the sak
flag that I had previously set using setserial()
but adding the code above before I set the termios
options has resolved the issue and the sak
flag remains disabled.