public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: stat st_birthtim(espec)
Date: Mon, 19 Oct 2020 14:01:27 +0200	[thread overview]
Message-ID: <20201019120127.GG5492@calimero.vinschen.de> (raw)
In-Reply-To: <202010190606.09J666Jp007285@ultimate.com>

On Oct 19 02:06, Phil Budne wrote:
> While checking if an OSS project of mine (www.snobol4.org/csnobol4)
> compiled cleanly under Cygwin, I was happy to discover that struct
> stat contains file birth time as on various BSD based systems.
> 
> BUT, I was unhappy to find out that MacOS 10.15 and Cygwin 3.1.7 have
> non-overlapping definitions for birth time information.
> 
> FreeBSD 12, NetBSD 9, and OSX 10.15 all have a "timespec" available as
> "st_birthtimespec", but Cygwin does not.
> 
> On FreeBSD, NetBSD, and Cygwin the actual member of struct stat is
> st_birthtim, but on OSX, the member is st_birthtimespec, and there is
> no define for st_birthtim.
> 
> A st_birthtimespec define in cygwin/stat.h would make it easier to
> write portable code.

Well, portable code should use the st_atim/st_mtim/st_ctim members
directly and not use st_birthtim at all.

For the headers we're usually looking for Linux compatibility in the
first place and if that's any indication, we should add all the
st_XYZtimensec members, but *only* if __USE_XOPEN2K8 is defined
(equivalent _XOPEN_SOURCE >= 700 for Cygwin/newlib)

GLibc does not provide any st_XYZtimespec definitions, though.  I don't
think it really makes a lot of sense to add those with portability in
mind.


Corinna

      reply	other threads:[~2020-10-19 12:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19  6:06 Phil Budne
2020-10-19 12:01 ` Corinna Vinschen [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=20201019120127.GG5492@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --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).