public inbox for
help / color / mirror / Atom feed
From: Corinna Vinschen <>
Subject: [newlib-cygwin] Cygwin: Make sure newer apps get uname_x even when loading uname dynamically
Date: Tue, 15 Dec 2020 12:05:27 +0000 (GMT)	[thread overview]
Message-ID: <> (raw);h=532b91d24e9496c7988b2b1dda7fc0e8b161f782

commit 532b91d24e9496c7988b2b1dda7fc0e8b161f782
Author: Corinna Vinschen <>
Date:   Mon Dec 14 12:29:23 2020 +0100

    Cygwin: Make sure newer apps get uname_x even when loading uname dynamically
    if an application built after API version 334 loads uname dynamically,
    it actually gets the old uname, rather than the new uname_x.  Fix this by
    checking the apps API version in uname and call uname_x instead, if it's
    a newer app.
    Signed-off-by: Corinna Vinschen <>

 winsup/cygwin/include/cygwin/version.h | 3 +++
 winsup/cygwin/                 | 7 +++++++
 2 files changed, 10 insertions(+)

diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h
index f21aba726..b39d0dbe9 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -74,6 +74,9 @@ details. */
 /* API_MAJOR 0.0: Initial version.  API_MINOR changes:
diff --git a/winsup/cygwin/ b/winsup/cygwin/
index 350216681..48f7dda60 100644
--- a/winsup/cygwin/
+++ b/winsup/cygwin/
@@ -92,7 +92,14 @@ struct old_utsname
 extern "C" int
 uname (struct utsname *in_name)
+  /* This occurs if the application fetches the uname symbol dynamically.
+     We must call uname_x for newer API versions, otherwise the idea of
+     struct utsname doesn't match. */
+    return uname_x (in_name);
   struct old_utsname *name = (struct old_utsname *) in_name;
       char *snp = strstr  (cygwin_version.dll_build_date, "SNP");

                 reply	other threads:[~2020-12-15 12:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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:

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

  git send-email \ \ \ \

* 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).