https://github.com/michaelrj-google commented: LGTM, I agree with the comments. For return types I think we should generally match what `fread` and `fwrite` do: return the number of characters read/written. https://github.com/llvm/llvm-project/pull/98683