+static fileio_fh_t *
+fileio_fd_to_fh (int fd)
+{
+ return &fileio_fhandles[fd];
+}
+
+
+/* Default implementations of file i/o methods. We don't want these
+ to delegate automatically, because we need to know which target
+ supported the method, in order to call it directly from within
+ pread/pwrite, etc. */
+
+int
+target_ops::fileio_open (struct inferior *inf, const char *filename,
+ int flags, int mode, int warn_if_slow,
+ int *target_errno)
+{
+ *target_errno = FILEIO_ENOSYS;
+ return -1;
+}
+
+int
+target_ops::fileio_pwrite (int fd, const gdb_byte *write_buf, int len,
+ ULONGEST offset, int *target_errno)
+{
+ *target_errno = FILEIO_ENOSYS;
+ return -1;
+}
+
+int
+target_ops::fileio_pread (int fd, gdb_byte *read_buf, int len,
+ ULONGEST offset, int *target_errno)
+{
+ *target_errno = FILEIO_ENOSYS;
+ return -1;
+}
+
+int
+target_ops::fileio_fstat (int fd, struct stat *sb, int *target_errno)
+{
+ *target_errno = FILEIO_ENOSYS;
+ return -1;
+}
+
+int
+target_ops::fileio_close (int fd, int *target_errno)
+{
+ *target_errno = FILEIO_ENOSYS;
+ return -1;
+}
+
+int
+target_ops::fileio_unlink (struct inferior *inf, const char *filename,
+ int *target_errno)
+{
+ *target_errno = FILEIO_ENOSYS;
+ return -1;
+}
+
+gdb::optional<std::string>
+target_ops::fileio_readlink (struct inferior *inf, const char *filename,
+ int *target_errno)
+{
+ *target_errno = FILEIO_ENOSYS;
+ return {};
+}