summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/sim/ChangeLog5
-rw-r--r--include/sim/callback.h6
-rw-r--r--sim/common/ChangeLog8
-rw-r--r--sim/common/callback.c10
-rw-r--r--sim/common/sim-io.c4
-rw-r--r--sim/common/sim-io.h2
6 files changed, 24 insertions, 11 deletions
diff --git a/include/sim/ChangeLog b/include/sim/ChangeLog
index 393b7b8262e..4fe3bc02403 100644
--- a/include/sim/ChangeLog
+++ b/include/sim/ChangeLog
@@ -1,5 +1,10 @@
2021-05-14 Mike Frysinger <vapier@gentoo.org>
+ * sim/callback.h (struct host_callback_struct): Change lseek return and
+ 3rd arg to int64_t. Change truncate & ftruncate 3rd arg to int64_t.
+
+2021-05-14 Mike Frysinger <vapier@gentoo.org>
+
* callback.h: Include stdint.h.
(struct host_callback_struct): Change time return to int64_t. Delete
2nd arg.
diff --git a/include/sim/callback.h b/include/sim/callback.h
index f40385e5761..4c162bc145e 100644
--- a/include/sim/callback.h
+++ b/include/sim/callback.h
@@ -73,7 +73,7 @@ struct host_callback_struct
int (*close) (host_callback *,int);
int (*get_errno) (host_callback *);
int (*isatty) (host_callback *, int);
- int (*lseek) (host_callback *, int, long , int);
+ int64_t (*lseek) (host_callback *, int, int64_t, int);
int (*open) (host_callback *, const char*, int mode);
int (*read) (host_callback *,int, char *, int);
int (*read_stdin) ( host_callback *, char *, int);
@@ -89,8 +89,8 @@ struct host_callback_struct
int (*to_stat) (host_callback *, const char *, struct stat *);
int (*to_fstat) (host_callback *, int, struct stat *);
int (*to_lstat) (host_callback *, const char *, struct stat *);
- int (*ftruncate) (host_callback *, int, long);
- int (*truncate) (host_callback *, const char *, long);
+ int (*ftruncate) (host_callback *, int, int64_t);
+ int (*truncate) (host_callback *, const char *, int64_t);
int (*pipe) (host_callback *, int *);
/* Called by the framework when a read call has emptied a pipe buffer. */
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 879aac96a95..b360ebdd759 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,5 +1,13 @@
2021-05-14 Mike Frysinger <vapier@gentoo.org>
+ * callback.c (os_lseek): Change return and 3rd arg to int64_t.
+ (os_ftruncate): Change 3rd arg to int64_t.
+ (os_truncate): Change 3rd arg to int64_t.
+ * sim-io.c (sim_io_lseek): Change return and 3rd arg to int64_t.
+ * sim-io.h (sim_io_lseek): Likewise.
+
+2021-05-14 Mike Frysinger <vapier@gentoo.org>
+
* callback.c (os_time): Change return to int64_t. Delete 2nd arg.
(os_fstat): Delete 2nd arg to time callback.
* sim-io.c (sim_io_time): Change return to int64_t. Delete 2nd arg
diff --git a/sim/common/callback.c b/sim/common/callback.c
index fb5e86431cc..24ea47025e1 100644
--- a/sim/common/callback.c
+++ b/sim/common/callback.c
@@ -205,10 +205,10 @@ os_isatty (host_callback *p, int fd)
return result;
}
-static int
-os_lseek (host_callback *p, int fd, long off, int way)
+static int64_t
+os_lseek (host_callback *p, int fd, int64_t off, int way)
{
- int result;
+ int64_t result;
result = fdbad (p, fd);
if (result)
@@ -519,7 +519,7 @@ os_lstat (host_callback *p, const char *file, struct stat *buf)
}
static int
-os_ftruncate (host_callback *p, int fd, long len)
+os_ftruncate (host_callback *p, int fd, int64_t len)
{
int result;
@@ -542,7 +542,7 @@ os_ftruncate (host_callback *p, int fd, long len)
}
static int
-os_truncate (host_callback *p, const char *file, long len)
+os_truncate (host_callback *p, const char *file, int64_t len)
{
#ifdef HAVE_TRUNCATE
int result;
diff --git a/sim/common/sim-io.c b/sim/common/sim-io.c
index e5da7f1fdaa..edef26e8e12 100644
--- a/sim/common/sim-io.c
+++ b/sim/common/sim-io.c
@@ -211,10 +211,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);
diff --git a/sim/common/sim-io.h b/sim/common/sim-io.h
index a091fd08e46..a78e8f59d54 100644
--- a/sim/common/sim-io.h
+++ b/sim/common/sim-io.h
@@ -53,7 +53,7 @@ int sim_io_read (SIM_DESC sd, int, char *, int);
int sim_io_open (SIM_DESC sd, const char *, int);
-int sim_io_lseek (SIM_DESC sd, int, long, int);
+int64_t sim_io_lseek (SIM_DESC sd, int, int64_t, int);
int sim_io_isatty (SIM_DESC sd, int);