/* The common simulator framework for GDB, the GNU Debugger.
- Copyright 2002, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright 2002-2021 Free Software Foundation, Inc.
Contributed by Andrew Cagney and Red Hat.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "sim-io.h"
+#include "sim/callback.h"
#include "targ-vals.h"
#include <errno.h>
#include <unistd.h>
#endif
+#include <stdlib.h>
+
+#undef open
+
/* Define the rate at which the simulator should poll the host
for a quit. */
#ifndef POLL_QUIT_INTERVAL
}
-long
-sim_io_time (SIM_DESC sd,
- long *t)
+int64_t
+sim_io_time (SIM_DESC sd)
{
- return STATE_CALLBACK (sd)->time (STATE_CALLBACK (sd), t);
+ return STATE_CALLBACK (sd)->time (STATE_CALLBACK (sd));
}
}
-int
+int64_t
sim_io_lseek (SIM_DESC sd,
int fd,
- long off,
+ int64_t off,
int way)
{
return STATE_CALLBACK (sd)->lseek (STATE_CALLBACK (sd), fd, off, way);
int
sim_io_stat (SIM_DESC sd, const char *path, struct stat *buf)
{
- return STATE_CALLBACK (sd)->stat (STATE_CALLBACK (sd), path, buf);
+ return STATE_CALLBACK (sd)->to_stat (STATE_CALLBACK (sd), path, buf);
}
int
sim_io_fstat (SIM_DESC sd, int fd, struct stat *buf)
{
- return STATE_CALLBACK (sd)->fstat (STATE_CALLBACK (sd), fd, buf);
+ return STATE_CALLBACK (sd)->to_fstat (STATE_CALLBACK (sd), fd, buf);
}