I am not really familar with the details of tcgetattr, but is it possible that the ignored return value would indicate that tcgetattr failed and thus didn’t write anything to &thing for some reason?
Basically it seems like you aren’t guaranteed to successfully read the result and may even need to poll/retry a bunch of times based on what is indicated by the errno value. (If I interprete the implementation within the posix namespace correctly)
I think instead of doing that manually, you can use std.posix.tcgetattr, which is a more abstracted/ziggified interface to the lower level os specific implementation.