logo

utils-std

Collection of commonly available Unix tools
commit: 2bb392e331805cecb5c87df87c2c8c49b1aeea3b
parent 2bd2c87f99d9925c90c4f5cc6c3f5180bfa9b8c6
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sun,  5 May 2024 01:31:47 +0200

Use _DEFAULT_SOURCE and no _POSIX_C_SOURCE for copy_file_range

FreeBSD is a bit strict there, if you have _POSIX_C_SOURCE it hides it away.

Diffstat:

Mcmd/install.c3+--
Mconfigure.d/copy_file_range.c4+---
2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/cmd/install.c b/cmd/install.c @@ -2,8 +2,7 @@ // SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me> // SPDX-License-Identifier: MPL-2.0 -#define _POSIX_C_SOURCE 200809L -#define _GNU_SOURCE // copy_file_range +#define _DEFAULT_SOURCE // copy_file_range #include "../lib/mkdir.h" #include "../lib/mode.h" diff --git a/configure.d/copy_file_range.c b/configure.d/copy_file_range.c @@ -2,9 +2,7 @@ // SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me> // SPDX-License-Identifier: MPL-2.0 -// Because that's what our utilities will use :) -#define _POSIX_C_SOURCE 200809L -#define _GNU_SOURCE // for copy_file_range +#define _DEFAULT_SOURCE // for copy_file_range #include <stdint.h> // SIZE_MAX #include <sys/types.h>