delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/09/28/04:55:19

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 375E33858432
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1632819317;
bh=1SmvnQhaS6ZzyeUQKSznUn+86pNUp0oHe/sf/qui1IQ=;
h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=RhsOQ7yqdxv/kVzdEFplDnC0OBCXBBogBXibX3pLkdIplNNmVn3WqXvY1GF1Qeopk
A/5Y6yZPi37A09sUreJxaBk1eWVriMjkZV7w/Vn2Ne/kRTLukToZhhhFWQWgk5bhxv
7zaf2Lz8eHlx2CpAwVdQ8MCqX4ijWiEuC10TzjgY=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7CD71385843B
DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com 18S8DgLL025190
X-Nifty-SrcIP: [110.4.221.123]
Date: Tue, 28 Sep 2021 17:13:42 +0900
To: cygwin AT cygwin DOT com
Subject: Re: Incompatible clipboard format between 32bit and 64bit cygwin
Message-Id: <20210928171342.c720a327eeaf5ab97241d7f6@nifty.ne.jp>
In-Reply-To: <82c34eff-3913-785c-7e77-aadc9d257d60@SystematicSw.ab.ca>
References: <20210926103325 DOT 5c17eb11c3c8a56c377199a8 AT nifty DOT ne DOT jp>
<584f536c-b108-b562-b940-798ec2847c68 AT maxrnd DOT com>
<0b13b9ac-583f-ab72-4202-f8b187946d93 AT towo DOT net>
<dd433ab8-ca9b-d6e8-3dce-c69a4dc9c593 AT towo DOT net>
<498f0cfb-c6c1-cb61-2e88-fcb9ce61f4d4 AT maxrnd DOT com>
<731c8611-4ed2-29fd-0b9c-33e221d6451e AT SystematicSw DOT ab DOT ca>
<20210928151936 DOT 2e644c2ebc717dc367e63003 AT nifty DOT ne DOT jp>
<82c34eff-3913-785c-7e77-aadc9d257d60 AT SystematicSw DOT ab DOT ca>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Mime-Version: 1.0
X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE,
SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Takashi Yano via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

On Tue, 28 Sep 2021 00:46:15 -0600
Brian Inglis wrote:
> On 2021-09-28 00:19, Takashi Yano via Cygwin wrote:
> > On Mon, 27 Sep 2021 23:22:30 -0600
> > Brian Inglis wrote:
> >> Would it perhaps make sense to include struct stat with appropriate
> >> entries rather than a couple of adhoc members unrelated to much else?
> > 
> > struct stat also has different size between 32 and 64 bit environment,
> > therefore, it does not resolve the issue.
> 
> I didn't think any of those types varied by architecture, given the same 
> underlying file systems are supported, except the trailing long 
> st_spare4[2]; if it does, your proposal is better.

I have checked the size of struct stat using:
#include <stdio.h>
#include <sys/stat.h>

int main()
{
	intptr_t offset0, offset_atime, offset_mtime, offset_ctime;
	struct stat t0;

	printf("sizeof stat=%ld\n", sizeof(struct stat));
	offset0 = (intptr_t) &t0;
	offset_atime = (intptr_t) &t0.st_atime;
	offset_mtime = (intptr_t) &t0.st_mtime;
	offset_ctime = (intptr_t) &t0.st_ctime;
	printf("offset st_atime=%ld\n", offset_atime - offset0);
	printf("offset st_mtime=%ld\n", offset_mtime - offset0);
	printf("offset st_ctime=%ld\n", offset_ctime - offset0);
	return 0;
}

In 32bit environment, the output is:
sizeof stat=96
offset st_atime=48
offset st_mtime=56
offset st_ctime=64

In 64bit environment, the output is:
sizeof stat=128
offset st_atime=48
offset st_mtime=64
offset st_ctime=80

It seems that the size of struct timespec is different.

-- 
Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>


-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019