diff mbox series

[03/11] unfs3: Define off64_t in terms of off_t on musl

Message ID 20221215084546.125368-3-raj.khem@gmail.com
State Accepted, archived
Commit b096c469fe54132a9862ffff1daf3dedcfc63ec4
Headers show
Series [01/11] erofs-utils: Convert from off64_t to off_t | expand

Commit Message

Khem Raj Dec. 15, 2022, 8:45 a.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...4_t-to-off_t-on-linux-if-not-defined.patch | 28 +++++++++++++++++++
 meta/recipes-devtools/unfs3/unfs3_git.bb      |  3 +-
 2 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/unfs3/unfs3/0001-Alias-off64_t-to-off_t-on-linux-if-not-defined.patch
diff mbox series

Patch

diff --git a/meta/recipes-devtools/unfs3/unfs3/0001-Alias-off64_t-to-off_t-on-linux-if-not-defined.patch b/meta/recipes-devtools/unfs3/unfs3/0001-Alias-off64_t-to-off_t-on-linux-if-not-defined.patch
new file mode 100644
index 0000000000..91909fa236
--- /dev/null
+++ b/meta/recipes-devtools/unfs3/unfs3/0001-Alias-off64_t-to-off_t-on-linux-if-not-defined.patch
@@ -0,0 +1,28 @@ 
+From 949db882e487d728c44bb68139682b38396dd275 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 14 Dec 2022 14:50:10 -0800
+Subject: [PATCH] Alias off64_t to off_t on linux if not defined
+
+Musl C library does not define off64_t and has 64-bit default off_t
+therefore define off64_t as an alias on linux as well when configure
+detects that off64_t is not provided by a linux system
+
+Upstream-Status: Submitted [https://github.com/unfs3/unfs3/pull/29]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ nfs.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/nfs.h b/nfs.h
+index aded011..7996c67 100644
+--- a/nfs.h
++++ b/nfs.h
+@@ -62,7 +62,7 @@ typedef int32_t int32;
+ #endif
+ 
+ #ifndef HAVE_OFF64_T
+-#ifdef __APPLE__
++#if defined(__APPLE__) || defined(__linux__)
+ typedef off_t off64_t;
+ #endif
+ #endif
diff --git a/meta/recipes-devtools/unfs3/unfs3_git.bb b/meta/recipes-devtools/unfs3/unfs3_git.bb
index 606c103a79..a4701bdb57 100644
--- a/meta/recipes-devtools/unfs3/unfs3_git.bb
+++ b/meta/recipes-devtools/unfs3/unfs3_git.bb
@@ -14,7 +14,8 @@  DEPENDS:append:class-nativesdk = " flex-nativesdk"
 S = "${WORKDIR}/git"
 SRC_URI = "git://github.com/unfs3/unfs3.git;protocol=https;branch=master \
            file://0001-daemon.c-Fix-race-window-for-writing-of-the-pid-file.patch \
-          "
+           file://0001-Alias-off64_t-to-off_t-on-linux-if-not-defined.patch \
+           "
 SRCREV = "c8f2d2cd4529955419bad0e163f88d47ff176b8d"
 UPSTREAM_CHECK_GITTAGREGEX = "unfs3\-(?P<pver>\d+(\.\d+)+)"