From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2210) id 453A43857BB6; Wed, 25 May 2022 16:50:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 453A43857BB6 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Ken Brown To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/cygwin-3_3-branch] Cygwin: fix mknod (64-bit only) X-Act-Checkin: newlib-cygwin X-Git-Author: Ken Brown X-Git-Refname: refs/heads/cygwin-3_3-branch X-Git-Oldrev: a8629d6eaf4695d353b73f9d88aa123fedc2827a X-Git-Newrev: 807318b6eeb127b8e62d9a170aa61639bb8571b4 Message-Id: <20220525165042.453A43857BB6@sourceware.org> Date: Wed, 25 May 2022 16:50:42 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2022 16:50:42 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D807318b6eeb= 127b8e62d9a170aa61639bb8571b4 commit 807318b6eeb127b8e62d9a170aa61639bb8571b4 Author: Ken Brown Date: Sun May 22 11:43:44 2022 -0400 Cygwin: fix mknod (64-bit only) =20 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.) =20 Addresses: https://cygwin.com/pipermail/cygwin-developers/2022-May/0125= 89.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/01258= 9.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; } =20 +#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 =20 extern "C" int mkfifo (const char *path, mode_t mode)