From: Takashi Yano <takashi.yano@nifty.ne.jp>
To: cygwin@cygwin.com
Subject: Re: Incompatible clipboard format between 32bit and 64bit cygwin
Date: Tue, 28 Sep 2021 17:13:42 +0900 [thread overview]
Message-ID: <20210928171342.c720a327eeaf5ab97241d7f6@nifty.ne.jp> (raw)
In-Reply-To: <82c34eff-3913-785c-7e77-aadc9d257d60@SystematicSw.ab.ca>
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.yano@nifty.ne.jp>
next prev parent reply other threads:[~2021-09-28 8:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-26 1:33 Takashi Yano
2021-09-26 9:50 ` Mark Geisert
2021-09-26 18:37 ` Thomas Wolff
2021-09-26 18:41 ` Thomas Wolff
2021-09-26 19:09 ` Lee
2021-09-26 20:46 ` Brian Inglis
2021-09-28 4:49 ` Mark Geisert
2021-09-28 5:22 ` Brian Inglis
2021-09-28 6:19 ` Takashi Yano
2021-09-28 6:46 ` Brian Inglis
2021-09-28 8:13 ` Takashi Yano [this message]
2021-09-28 17:11 ` Mark Geisert
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=20210928171342.c720a327eeaf5ab97241d7f6@nifty.ne.jp \
--to=takashi.yano@nifty.ne.jp \
--cc=cygwin@cygwin.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).