|
|
Message-ID: <20190824002507.GT9017@brightrain.aerifal.cx>
Date: Fri, 23 Aug 2019 20:25:07 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: [PATCH] Add copy_file_range system call
On Mon, Aug 19, 2019 at 11:41:14PM +0000, Árni Dagur wrote:
> This patch was based on commit 53147f9, which added splice and vmsplice.
> ---
> The function signature in the glibc manpage specifies `loff_t` instead
> of `off_t`, for both `copy_file_range` and `splice`. In musl, however,
> the function signature for `splice` specifies `off_t`, so I did the
> same here. I'm not an experienced C programmer, so that may have been
> wrong.
>
> include/unistd.h | 1 +
> src/linux/copy_file_range.c | 8 ++++++++
> 2 files changed, 9 insertions(+)
> create mode 100644 src/linux/copy_file_range.c
>
> diff --git a/include/unistd.h b/include/unistd.h
> index 9485da7a..00cc7042 100644
> --- a/include/unistd.h
> +++ b/include/unistd.h
> @@ -188,6 +188,7 @@ char *get_current_dir_name(void);
> int syncfs(int);
> int euidaccess(const char *, int);
> int eaccess(const char *, int);
> +ssize_t copy_file_range(int fd_in, off_t *off_in, int fd_out, off_t *off_out, size_t len, unsigned flags);
> #endif
>
> #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
> diff --git a/src/linux/copy_file_range.c b/src/linux/copy_file_range.c
> new file mode 100644
> index 00000000..34742588
> --- /dev/null
> +++ b/src/linux/copy_file_range.c
> @@ -0,0 +1,8 @@
> +#define _GNU_SOURCE
> +#include <fcntl.h>
^^^^^^^^^
One more detail, this should be unistd.h. I'm fixing with applying it.
Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.