Linux-bcachefs Archive mirror
 help / color / mirror / Atom feed
From: Kent Overstreet <kent.overstreet@linux.dev>
To: Thomas Bertschinger <tahbertschinger@gmail.com>
Cc: linux-bcachefs@vger.kernel.org, bfoster@redhat.com
Subject: Re: [PATCH TOOLS] rust: use libc::Ioctl type for ioctl() request argument
Date: Wed, 21 Feb 2024 19:08:01 -0500	[thread overview]
Message-ID: <qxjz6evmfl5dsdiha3hucarpqh32rxglqwb4foil3imiy5blms@cmxcdw5zw63m> (raw)
In-Reply-To: <20240221032420.73205-1-tahbertschinger@gmail.com>

On Tue, Feb 20, 2024 at 08:24:20PM -0700, Thomas Bertschinger wrote:
> The second argument to ioctl() can be defined as a different type by
> different libc implementations, and can be a different size on different
> architectures depending on what type it is defined as. For example,
> glibc defines it as `unsigned long` which may have a different size on
> 32-bit vs. 64-bit architectures, and musl libc defines it as `int`.
> 
> The Rust libc crate exposes a type `libc::Ioctl` which is defined as the
> appropriate integer type for the given libc implementation. Using this
> type for the request argument to `libc::ioctl()` ensures code will
> compile correctly regardless of architecture and libc implementation.
> 
> Also, because ioctl request numbers are defined to be 32 bits
> (regardless of the fact that `unsigned long` might sometimes take 64
> bits on some architectures), this patch changes the Rust representation
> of the bcachefs ioctl numbers to u32 instead of u64.
> 
> Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>

this is applied

      reply	other threads:[~2024-02-22  0:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-21  3:24 [PATCH TOOLS] rust: use libc::Ioctl type for ioctl() request argument Thomas Bertschinger
2024-02-22  0:08 ` Kent Overstreet [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=qxjz6evmfl5dsdiha3hucarpqh32rxglqwb4foil3imiy5blms@cmxcdw5zw63m \
    --to=kent.overstreet@linux.dev \
    --cc=bfoster@redhat.com \
    --cc=linux-bcachefs@vger.kernel.org \
    --cc=tahbertschinger@gmail.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).