From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 8GRHE3VmhGAkLgAAWB0awg (envelope-from ) for ; Sat, 24 Apr 2021 14:41:57 -0400 Received: by simark.ca (Postfix, from userid 112) id 3CF3E1F11C; Sat, 24 Apr 2021 14:41:57 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 2EBA01EE74 for ; Sat, 24 Apr 2021 14:41:55 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9FB4C396B41F; Sat, 24 Apr 2021 18:41:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9FB4C396B41F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1619289714; bh=fIxYWjzzM++EjChQVJkkCVAt9wp3lMC+SqcLQsoGLuA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=neP4OLw2mZrKEQIAC+U9ZztRIReCnvib9NfThwpVUW8u2LJr8KIDsAUNcMqIs5K6M T0wHrkQndAjwo1l9twFvZaBKnUpj89vL1ZNcmQdcJGVwvYxUYhCcze8O6aG6Ik0s0G 73M/Lb5GHa+pv4zFF1a68QTIbkYUh8BRXdkwVFkg= Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id B54DE3955426 for ; Sat, 24 Apr 2021 18:41:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B54DE3955426 Received: from vapier.lan (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id D2768341100 for ; Sat, 24 Apr 2021 18:41:49 +0000 (UTC) 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 Message-Id: <20210424184144.23736-6-vapier@gentoo.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210424184144.23736-1-vapier@gentoo.org> References: <20210424184144.23736-1-vapier@gentoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mike Frysinger via Gdb-patches Reply-To: Mike Frysinger Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" 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