From 64e8e422abebf139fac9a4ec8ba8f259e54679e6 Mon Sep 17 00:00:00 2001
From: Dan Gohman <dev@sunfishcode.online>
Date: Sun, 6 Apr 2025 05:22:49 -0700
Subject: [PATCH] Define more ioctl codes on riscv32gc-unknown-linux-gnu

Define ioctl codes including `FICLONE` and `FS_IOC32_GETVERSION` on
riscv32gc-unknown-linux-gnu.

Upstream-Status: Submitted [https://github.com/rust-lang/libc/pull/4382]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 src/unix/linux_like/linux/arch/generic/mod.rs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/unix/linux_like/linux/arch/generic/mod.rs b/src/unix/linux_like/linux/arch/generic/mod.rs
index 61d2e3f..05ffb12 100644
--- a/src/unix/linux_like/linux/arch/generic/mod.rs
+++ b/src/unix/linux_like/linux/arch/generic/mod.rs
@@ -164,6 +164,7 @@ cfg_if! {
         target_arch = "x86_64",
         target_arch = "arm",
         target_arch = "aarch64",
+        target_arch = "riscv32",
         target_arch = "riscv64",
         target_arch = "s390x",
         target_arch = "csky",
@@ -303,7 +304,8 @@ cfg_if! {
     if #[cfg(any(
         target_arch = "x86",
         target_arch = "arm",
-        target_arch = "csky"
+        target_arch = "csky",
+        target_arch = "riscv32"
     ))] {
         pub const FS_IOC_GETFLAGS: Ioctl = 0x80046601;
         pub const FS_IOC_SETFLAGS: Ioctl = 0x40046602;
