From e4f6d7b6d57e83633814c54d93dff292ed0e4609 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 8 Apr 2023 09:01:54 -0700
Subject: [PATCH] musl: Move F_OFD_GETLK, F_OFD_SETLK and F_OFD_SETLKW to
 common location

These defines are not architecture specific in musl [1] therefore move them
to be common

[1] https://git.musl-libc.org/cgit/musl/tree/include/fcntl.h#n48

Upstream-Status: Submitted [https://github.com/rust-lang/libc/pull/3191]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 src/unix/linux_like/linux/musl/b32/arm/mod.rs     | 3 ---
 src/unix/linux_like/linux/musl/b32/hexagon.rs     | 3 ---
 src/unix/linux_like/linux/musl/b32/mips/mod.rs    | 3 ---
 src/unix/linux_like/linux/musl/b32/powerpc.rs     | 3 ---
 src/unix/linux_like/linux/musl/b32/x86/mod.rs     | 3 ---
 src/unix/linux_like/linux/musl/b64/aarch64/mod.rs | 3 ---
 src/unix/linux_like/linux/musl/b64/mips64.rs      | 3 ---
 src/unix/linux_like/linux/musl/mod.rs             | 4 ++++
 8 files changed, 4 insertions(+), 21 deletions(-)

diff --git a/src/unix/linux_like/linux/musl/b32/arm/mod.rs b/src/unix/linux_like/linux/musl/b32/arm/mod.rs
index c47fa2c4c..3c8978e4f 100644
--- a/src/unix/linux_like/linux/musl/b32/arm/mod.rs
+++ b/src/unix/linux_like/linux/musl/b32/arm/mod.rs
@@ -451,9 +451,6 @@ pub const F_GETOWN: ::c_int = 9;
 pub const F_SETLK: ::c_int = 13;
 pub const F_SETLKW: ::c_int = 14;
 pub const F_SETOWN: ::c_int = 8;
-pub const F_OFD_GETLK: ::c_int = 36;
-pub const F_OFD_SETLK: ::c_int = 37;
-pub const F_OFD_SETLKW: ::c_int = 38;
 
 pub const VEOF: usize = 4;
 pub const VEOL: usize = 11;
diff --git a/src/unix/linux_like/linux/musl/b32/hexagon.rs b/src/unix/linux_like/linux/musl/b32/hexagon.rs
index f83d208d5..720c603da 100644
--- a/src/unix/linux_like/linux/musl/b32/hexagon.rs
+++ b/src/unix/linux_like/linux/musl/b32/hexagon.rs
@@ -225,9 +225,6 @@ pub const F_GETOWN_EX: ::c_int = 16;
 pub const F_GETSIG: ::c_int = 11;
 pub const F_LINUX_SPECIFIC_BASE: ::c_int = 1024;
 pub const FLUSHO: ::c_int = 4096;
-pub const F_OFD_GETLK: ::c_int = 36;
-pub const F_OFD_SETLK: ::c_int = 37;
-pub const F_OFD_SETLKW: ::c_int = 38;
 pub const F_OWNER_PGRP: ::c_int = 2;
 pub const F_OWNER_PID: ::c_int = 1;
 pub const F_OWNER_TID: ::c_int = 0;
diff --git a/src/unix/linux_like/linux/musl/b32/mips/mod.rs b/src/unix/linux_like/linux/musl/b32/mips/mod.rs
index d09b8278e..69e20ce32 100644
--- a/src/unix/linux_like/linux/musl/b32/mips/mod.rs
+++ b/src/unix/linux_like/linux/musl/b32/mips/mod.rs
@@ -388,9 +388,6 @@ pub const F_GETOWN: ::c_int = 23;
 pub const F_SETLK: ::c_int = 34;
 pub const F_SETLKW: ::c_int = 35;
 pub const F_SETOWN: ::c_int = 24;
-pub const F_OFD_GETLK: ::c_int = 36;
-pub const F_OFD_SETLK: ::c_int = 37;
-pub const F_OFD_SETLKW: ::c_int = 38;
 
 pub const VEOF: usize = 16;
 pub const VEOL: usize = 17;
diff --git a/src/unix/linux_like/linux/musl/b32/powerpc.rs b/src/unix/linux_like/linux/musl/b32/powerpc.rs
index 3b998329b..63bc9163d 100644
--- a/src/unix/linux_like/linux/musl/b32/powerpc.rs
+++ b/src/unix/linux_like/linux/musl/b32/powerpc.rs
@@ -384,9 +384,6 @@ pub const F_GETOWN: ::c_int = 9;
 pub const F_SETLK: ::c_int = 13;
 pub const F_SETLKW: ::c_int = 14;
 pub const F_SETOWN: ::c_int = 8;
-pub const F_OFD_GETLK: ::c_int = 36;
-pub const F_OFD_SETLK: ::c_int = 37;
-pub const F_OFD_SETLKW: ::c_int = 38;
 
 pub const VEOF: usize = 4;
 pub const VEOL: usize = 6;
diff --git a/src/unix/linux_like/linux/musl/b32/x86/mod.rs b/src/unix/linux_like/linux/musl/b32/x86/mod.rs
index c319b91b6..52ecf3c7e 100644
--- a/src/unix/linux_like/linux/musl/b32/x86/mod.rs
+++ b/src/unix/linux_like/linux/musl/b32/x86/mod.rs
@@ -441,9 +441,6 @@ pub const F_GETOWN: ::c_int = 9;
 pub const F_SETLK: ::c_int = 13;
 pub const F_SETLKW: ::c_int = 14;
 pub const F_SETOWN: ::c_int = 8;
-pub const F_OFD_GETLK: ::c_int = 36;
-pub const F_OFD_SETLK: ::c_int = 37;
-pub const F_OFD_SETLKW: ::c_int = 38;
 
 pub const VEOF: usize = 4;
 pub const VEOL: usize = 11;
diff --git a/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs b/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
index 14b4bc6d6..522493ff3 100644
--- a/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
+++ b/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
@@ -250,9 +250,6 @@ pub const F_GETOWN: ::c_int = 9;
 pub const F_SETLK: ::c_int = 6;
 pub const F_SETLKW: ::c_int = 7;
 pub const F_SETOWN: ::c_int = 8;
-pub const F_OFD_GETLK: ::c_int = 36;
-pub const F_OFD_SETLK: ::c_int = 37;
-pub const F_OFD_SETLKW: ::c_int = 38;
 
 pub const VEOF: usize = 4;
 
diff --git a/src/unix/linux_like/linux/musl/b64/mips64.rs b/src/unix/linux_like/linux/musl/b64/mips64.rs
index 22ac91690..c7f041260 100644
--- a/src/unix/linux_like/linux/musl/b64/mips64.rs
+++ b/src/unix/linux_like/linux/musl/b64/mips64.rs
@@ -612,9 +612,6 @@ pub const F_GETOWN: ::c_int = 23;
 pub const F_SETOWN: ::c_int = 24;
 pub const F_SETLK: ::c_int = 6;
 pub const F_SETLKW: ::c_int = 7;
-pub const F_OFD_GETLK: ::c_int = 36;
-pub const F_OFD_SETLK: ::c_int = 37;
-pub const F_OFD_SETLKW: ::c_int = 38;
 
 pub const MCL_CURRENT: ::c_int = 0x0001;
 pub const MCL_FUTURE: ::c_int = 0x0002;
diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs
index 37a8ca2af..9a4fa7ca7 100644
--- a/src/unix/linux_like/linux/musl/mod.rs
+++ b/src/unix/linux_like/linux/musl/mod.rs
@@ -506,6 +506,10 @@ pub const ECOMM: ::c_int = 70;
 pub const EPROTO: ::c_int = 71;
 pub const EDOTDOT: ::c_int = 73;
 
+pub const F_OFD_GETLK: ::c_int = 36;
+pub const F_OFD_SETLK: ::c_int = 37;
+pub const F_OFD_SETLKW: ::c_int = 38;
+
 pub const F_RDLCK: ::c_int = 0;
 pub const F_WRLCK: ::c_int = 1;
 pub const F_UNLCK: ::c_int = 2;
-- 
2.40.0

