From 37ed2951d2729a0409e219fe0f54e081b2d882c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 12 Jan 2022 06:35:23 +0000 Subject: [PATCH] libredirect: improve musl support (#154039) __nss_files_open is glibc only. Also mark some linux specific system calls as such for better portability with other unixes. --- pkgs/build-support/libredirect/libredirect.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/libredirect/libredirect.c b/pkgs/build-support/libredirect/libredirect.c index 9dde78c7492..0dc7feb382c 100644 --- a/pkgs/build-support/libredirect/libredirect.c +++ b/pkgs/build-support/libredirect/libredirect.c @@ -153,7 +153,7 @@ WRAPPER(FILE *, fopen)(const char * path, const char * mode) } WRAPPER_DEF(fopen) -#ifndef __APPLE__ +#ifdef __GLIBC__ WRAPPER(FILE *, __nss_files_fopen)(const char * path) { FILE * (*__nss_files_fopen_real) (const char *) = LOOKUP_REAL(__nss_files_fopen); @@ -174,7 +174,7 @@ WRAPPER(FILE *, fopen64)(const char * path, const char * mode) WRAPPER_DEF(fopen64) #endif -#ifndef __APPLE__ +#ifdef __linux__ WRAPPER(int, __xstat)(int ver, const char * path, struct stat * st) { int (*__xstat_real) (int ver, const char *, struct stat *) = LOOKUP_REAL(__xstat); @@ -184,7 +184,7 @@ WRAPPER(int, __xstat)(int ver, const char * path, struct stat * st) WRAPPER_DEF(__xstat) #endif -#ifndef __APPLE__ +#ifdef __linux__ WRAPPER(int, __xstat64)(int ver, const char * path, struct stat64 * st) { int (*__xstat64_real) (int ver, const char *, struct stat64 *) = LOOKUP_REAL(__xstat64);