This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]