[6/6] sim: callback: convert FS interfaces to 64-bit

Message ID 20210424184144.23736-6-vapier@gentoo.org
State New
Headers show
Series
  • [1/6] gdb: callback: always include necessary headers
Related show

Commit Message

Lancelot SIX via Gdb-patches April 24, 2021, 6:41 p.m.
Rather than rely on off_t being the right size between the host &
target, have the interface always be 64-bit.  We can figure out if
we need to truncate when actually outputting it to the right target.
---
 include/gdb/callback.h | 6 +++---
 sim/common/callback.c  | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

-- 
2.30.2

Patch

diff --git a/include/gdb/callback.h b/include/gdb/callback.h
index f86fe7e4c548..001e69aa8b37 100644
--- a/include/gdb/callback.h
+++ b/include/gdb/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);
+  int (*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/callback.c b/sim/common/callback.c
index da8ea3e2f10c..d31fdc606c90 100644
--- a/sim/common/callback.c
+++ b/sim/common/callback.c
@@ -206,7 +206,7 @@  os_isatty (host_callback *p, int fd)
 }
 
 static int
-os_lseek (host_callback *p, int fd, long off, int way)
+os_lseek (host_callback *p, int fd, int64_t off, int way)
 {
   int result;
 
@@ -522,7 +522,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;
 
@@ -545,7 +545,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;