public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Ken Brown <kbrown@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin/cygwin-3_3-branch] Cygwin: fix mknod (64-bit only)
Date: Wed, 25 May 2022 16:50:42 +0000 (GMT)	[thread overview]
Message-ID: <20220525165042.453A43857BB6@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=807318b6eeb127b8e62d9a170aa61639bb8571b4

commit 807318b6eeb127b8e62d9a170aa61639bb8571b4
Author: Ken Brown <kbrown@cornell.edu>
Date:   Sun May 22 11:43:44 2022 -0400

    Cygwin: fix mknod (64-bit only)
    
    The current definition of mknod in syscalls.cc has a third argument of
    type __dev16_t instead of dev_t.  Fix this on 64-bit Cygwin by making
    the existing mknod 32-bit only and then exporting mknod as an alias
    for mknod32.  (No fix is needed on 32-bit because mknod is redirected
    to mknod32 via NEW_FUNCTIONS in Makefile.am.)
    
    Addresses: https://cygwin.com/pipermail/cygwin-developers/2022-May/012589.html

Diff:
---
 winsup/cygwin/release/3.3.6 | 3 +++
 winsup/cygwin/syscalls.cc   | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/winsup/cygwin/release/3.3.6 b/winsup/cygwin/release/3.3.6
index 6d722433f..135f33155 100644
--- a/winsup/cygwin/release/3.3.6
+++ b/winsup/cygwin/release/3.3.6
@@ -7,3 +7,6 @@ Bug Fixes
 - Fix killpg failing because the exec'ing as well as the exec'ed
   process are not in the pidlist for a brief moment.
   Addresses: https://cygwin.com/pipermail/cygwin/2022-May/251479.html
+
+- Fix mknod (64-bit only), whose definition didn't match its prototype.
+  Addresses: https://cygwin.com/pipermail/cygwin-developers/2022-May/012589.html
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index d431442a5..03fed032f 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -3488,11 +3488,15 @@ mknod32 (const char *path, mode_t mode, dev_t dev)
   return -1;
 }
 
+#ifdef __i386__
 extern "C" int
 mknod (const char *_path, mode_t mode, __dev16_t dev)
 {
   return mknod32 (_path, mode, (dev_t) dev);
 }
+#else
+EXPORT_ALIAS (mknod32, mknod)
+#endif
 
 extern "C" int
 mkfifo (const char *path, mode_t mode)


                 reply	other threads:[~2022-05-25 16:50 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:
  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=20220525165042.453A43857BB6@sourceware.org \
    --to=kbrown@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /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).