This function is supposed to return the actual number of bytes written. On the USB (native) port it always returns 0.