/* Returns: number of bytes read in, or -1 on error, or 0 on end of file.  */
gssize g_input_stream_read_finish(GInputStream *stream, GAsyncResult *result, GError **error)
/* Returns: number of bytes read in, or -1 on error, or 0 on end of file.  */
gssize g_input_stream_read_finish(GInputStream *stream, GAsyncResult *result, GError **error)
{
  GInputStreamClass *class;
  g_return_val_if_fail (G_IS_INPUT_STREAM (stream), -1);
  g_return_val_if_fail (G_IS_ASYNC_RESULT (result), -1);
  if (g_async_result_legacy_propagate_error (result, error))
    return -1;
  else if (g_async_result_is_tagged (result, g_input_stream_read_async))
    return g_task_propagate_int (G_TASK (result), error);
  class = G_INPUT_STREAM_GET_CLASS (stream);
  return class->read_finish (stream, result, error);
}