From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2210) id EB0FA3857BB6; Wed, 25 May 2022 16:51:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EB0FA3857BB6 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: fix mknod (64-bit only) X-Act-Checkin: newlib-cygwin X-Git-Author: Ken Brown X-Git-Refname: refs/heads/master X-Git-Oldrev: 03e815a91b1a1f94ce0cfd6ff64f50ae40ed740c X-Git-Newrev: 2f8ba4004675ff13741dcfd7de2014bec6834ca3 Message-Id: <20220525165104.EB0FA3857BB6@sourceware.org> Date: Wed, 25 May 2022 16:51:04 +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:51:05 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D2f8ba400467= 5ff13741dcfd7de2014bec6834ca3 commit 2f8ba4004675ff13741dcfd7de2014bec6834ca3 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 3a652c4f4..344d1d329 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -3490,11 +3490,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)