void-packages/srcpkgs/mergerfs/patches/musl-fix-loff_t.patch
Noel Cower 7d9ec219a8 mergerfs: update to 2.25.1.
Removes patches that are no longer needed and sets INTERNAL_FUSE=0 so
that the Makefile will defer to pkg-config for libfuse.

Adds a patch to replace non-portable use of loff_t with int64_t for the
copy_file_range syscall.

Also adopting the package since it's an orphan.
2019-02-11 05:27:44 -02:00

77 lines
2.4 KiB
Diff

From 7779db242ab470053c9da188a639573750587adb Mon Sep 17 00:00:00 2001
From: Noel Cower <ncower@gmail.com>
Date: Sun, 10 Feb 2019 20:41:54 -0800
Subject: [PATCH] musl: use int64_t in place of loff_t
This replaces the less portable loff_t with int64_t (loff_t is
exclusive to the kernel). This stays compatible with the syscall when
available without modifying
src/fs_copy_file_range_unsupported.icpp is not updated because I'm not
sure that would apply to musl or glibc targets.
---
src/fs_copy_file_range.hpp | 4 ++--
src/fs_copy_file_range_linux.icpp | 14 +++++++-------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git src/fs_copy_file_range.hpp src/fs_copy_file_range.hpp
index 0b8984e..036c0f8 100644
--- src/fs_copy_file_range.hpp
+++ src/fs_copy_file_range.hpp
@@ -26,9 +26,9 @@ namespace fs
{
ssize_t
copy_file_range(const int fd_in_,
- loff_t *off_in_,
+ int64_t *off_in_,
const int fd_out_,
- loff_t *off_out_,
+ int64_t *off_out_,
const size_t len_,
const unsigned int flags_);
diff --git src/fs_copy_file_range_linux.icpp src/fs_copy_file_range_linux.icpp
index 4718649..408afb0 100644
--- src/fs_copy_file_range_linux.icpp
+++ src/fs_copy_file_range_linux.icpp
@@ -28,11 +28,11 @@
#include <unistd.h>
static
-loff_t
+ssize_t
copy_file_range_(int fd_in_,
- loff_t *off_in_,
+ int64_t *off_in_,
int fd_out_,
- loff_t *off_out_,
+ int64_t *off_out_,
size_t len_,
unsigned int flags_)
{
@@ -53,9 +53,9 @@ namespace fs
{
ssize_t
copy_file_range(const int fd_in_,
- loff_t *off_in_,
+ int64_t *off_in_,
const int fd_out_,
- loff_t *off_out_,
+ int64_t *off_out_,
const size_t len_,
const unsigned int flags_)
{
@@ -73,8 +73,8 @@ namespace fs
const size_t len_,
const unsigned int flags_)
{
- loff_t off_in;
- loff_t off_out;
+ int64_t off_in;
+ int64_t off_out;
off_in = 0;
off_out = 0;
--
2.20.1