Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mike Frysinger via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 6/6] sim: callback: convert FS interfaces to 64-bit
Date: Sat, 24 Apr 2021 14:41:44 -0400	[thread overview]
Message-ID: <20210424184144.23736-6-vapier@gentoo.org> (raw)
In-Reply-To: <20210424184144.23736-1-vapier@gentoo.org>

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(-)

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;
-- 
2.30.2


      parent reply	other threads:[~2021-04-24 18:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-24 18:41 [PATCH 1/6] gdb: callback: always include necessary headers Mike Frysinger via Gdb-patches
2021-04-24 18:41 ` [PATCH 2/6] gdb: callback: use ATTRIBUTE_NORETURN Mike Frysinger via Gdb-patches
2021-04-24 18:41 ` [PATCH 3/6] gdb: callback: inline PTR define Mike Frysinger via Gdb-patches
2021-04-24 18:41 ` [PATCH 4/6] sim: callback: inline wrap helper Mike Frysinger via Gdb-patches
2021-04-24 18:41 ` [PATCH 5/6] sim: callback: convert time interface to 64-bit Mike Frysinger via Gdb-patches
2021-04-24 21:11   ` Tom Tromey
2021-04-24 22:36     ` Mike Frysinger via Gdb-patches
2021-05-14  5:39   ` [PATCH 5/6 v2] " Mike Frysinger via Gdb-patches
2021-05-14 14:00     ` Tom Tromey
2021-04-24 18:41 ` Mike Frysinger via Gdb-patches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210424184144.23736-6-vapier@gentoo.org \
    --to=gdb-patches@sourceware.org \
    --cc=vapier@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox