From fbce8b1e4ea6390be0e46a503c5c22b4c4ca4b01 Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 17 Apr 2021 20:55:27 +0000 Subject: slbt_realpath(): added code path for systems with a realpathat syscall. --- src/helper/slbt_realpath.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/helper/slbt_realpath.c b/src/helper/slbt_realpath.c index bae41ec..6b48831 100644 --- a/src/helper/slbt_realpath.c +++ b/src/helper/slbt_realpath.c @@ -15,6 +15,10 @@ #include "slibtool_driver_impl.h" #include "slibtool_readlink_impl.h" +#ifdef __unix__ +#include +#endif + #ifdef _MIDIPIX_ABI #include #endif @@ -23,6 +27,10 @@ #define ENOTSUP EOPNOTSUPP #endif +#ifdef SYS___realpathat +extern long syscall(int, ...); +#endif + int slbt_realpath( int fdat, const char * path, @@ -48,6 +56,10 @@ int slbt_realpath( return __fs_rpath(fdat,path,options,buf,buflen); #endif +#ifdef SYS___realpathat + return syscall(SYS___realpathat,fdat,path,buf,buflen,0); +#endif + /* buflen */ if (buflen < PATH_MAX) { errno = ENOBUFS; -- cgit v1.2.3