workaround for osx in serial.c