/* Host file transfer support for gdbserver.
- Copyright (C) 2007-2020 Free Software Foundation, Inc.
+ Copyright (C) 2007-2021 Free Software Foundation, Inc.
Contributed by CodeSourcery.
return -1;
}
-/* Fill in own_buf with the last hostio error packet, however it
- suitable for the target. */
+/* Fill BUF with an hostio error packet representing the last hostio
+ error, from errno. */
+
static void
hostio_error (char *own_buf)
{
- the_target->pt->hostio_last_error (own_buf);
+ int fileio_error = host_to_fileio_error (errno);
+ sprintf (own_buf, "F-1,%x", fileio_error);
}
static void
then there's no point in GDB sending "vFile:setfs:" packets. We
reply with an empty packet (i.e. we pretend we don't understand
"vFile:setfs:") and that should stop GDB sending any more. */
- if (!the_target->pt->supports_multifs ())
+ if (!the_target->supports_multifs ())
{
own_buf[0] = '\0';
return;
/* We do not need to convert MODE, since the fileio protocol
uses the standard values. */
if (hostio_fs_pid != 0)
- fd = the_target->pt->multifs_open (hostio_fs_pid, filename,
- flags, mode);
+ fd = the_target->multifs_open (hostio_fs_pid, filename, flags, mode);
else
fd = open (filename, flags, mode);
}
if (hostio_fs_pid != 0)
- ret = the_target->pt->multifs_unlink (hostio_fs_pid, filename);
+ ret = the_target->multifs_unlink (hostio_fs_pid, filename);
else
ret = unlink (filename);
}
if (hostio_fs_pid != 0)
- ret = the_target->pt->multifs_readlink (hostio_fs_pid, filename,
- linkname,
- sizeof (linkname) - 1);
+ ret = the_target->multifs_readlink (hostio_fs_pid, filename,
+ linkname,
+ sizeof (linkname) - 1);
else
ret = readlink (filename, linkname, sizeof (linkname) - 1);