[PATCH 3/3 v3] Implement remote_bfd_iovec_stat using vFile:fstat

Pedro Alves palves@redhat.com
Tue Mar 10 18:36:00 GMT 2015


Sorry, forgot to merge this comment with the other mail...

On 03/10/2015 03:51 PM, Gary Benson wrote:
> +   into ST.  Return 0 on success, or -1 if an error occurs (and
> +   set *REMOTE_ERRNO).  */
> +
> +static int
> +remote_hostio_fstat (struct target_ops *self,
> +		     int fd, struct stat *st,
> +		     int *remote_errno)
> +{
> +  struct remote_state *rs = get_remote_state ();
> +  char *p = rs->buf;
> +  int left = get_remote_packet_size ();
> +  int attachment_len, ret;
> +  char *attachment;
> +  struct fio_stat fst;
> +  int read_len;
> +
> +  if (packet_support (PACKET_vFile_fstat) != PACKET_ENABLE)
> +    {
> +      memset (st, 0, sizeof (struct stat));
> +      st->st_size = INT_MAX;

A future reader may wonder why this isn't ENOSYS instead.  I think
a comment here would help.

> +      return 0;
> +    }

Thanks,
Pedro Alves



More information about the Gdb-patches mailing list