[sgen] Don't use standard C API for binary protocol IO.