sim: drop core libiberty.h include
[deliverable/binutils-gdb.git] / sim / common / sim-io.c
index 38e2d82e3b9be400ef8658821513c06fc758b809..e09a4af7ba2e4dd66935971d09ab874b4914b47a 100644 (file)
@@ -1,6 +1,6 @@
 /* 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
@@ -66,11 +73,10 @@ sim_io_unlink (SIM_DESC sd,
 }
 
 
-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));
 }
 
 
@@ -210,10 +216,10 @@ sim_io_open (SIM_DESC 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);
@@ -391,11 +397,11 @@ sim_io_poll_read (SIM_DESC sd,
 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);
 }
This page took 0.023509 seconds and 4 git commands to generate.