From: Ken Brown <kbrown@cornell.edu>
To: cygwin-developers@cygwin.com
Subject: Re: mknod bug?
Date: Sun, 22 May 2022 12:19:28 -0400 [thread overview]
Message-ID: <1c72647b-86b8-2d93-20bb-90a82e9507dc@cornell.edu> (raw)
In-Reply-To: <e308809a-d907-5163-0629-38571550e6ec@cornell.edu>
On 5/21/2022 5:22 PM, Ken Brown wrote:
> The definition of mknod in syscalls.cc has a third argument of type __dev16_t
> instead of dev_t. This doesn't matter on 32-bit Cygwin, because calls to mknod
> are redirected to mknod32 via NEW_FUNCTIONS in Makefile.am [cygwin-3_3-branch
> only]. Presumably this definition exists for the sake of old 32-bit apps that
> were built when dev_t was 16 bits.
>
> But it seems to be a clear bug on 64-bit Cygwin. I think we need the following,
> similar to what we do for many other syscalls:
>
> 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;
> }
>
> +#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)
>
> If I'm right, this is a longstanding bug, and I'm surprised no one has noticed
> it before. Am I missing something?
I sent the patch to cygwin-patches. Any comments should probably go there.
Ken
prev parent reply other threads:[~2022-05-22 16:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-21 21:22 Ken Brown
2022-05-22 16:19 ` Ken Brown [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=1c72647b-86b8-2d93-20bb-90a82e9507dc@cornell.edu \
--to=kbrown@cornell.edu \
--cc=cygwin-developers@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).