summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-04-17 20:55:27 +0000
committermidipix <writeonce@midipix.org>2021-04-17 20:55:27 +0000
commitfbce8b1e4ea6390be0e46a503c5c22b4c4ca4b01 (patch)
tree73f6f21953ab677912d9e1010dce26064c1cc1d4 /src
parente8bfe52070bfaa7934a02b78312b1689ac7b3805 (diff)
downloadslibtool-fbce8b1e4ea6390be0e46a503c5c22b4c4ca4b01.tar.bz2
slibtool-fbce8b1e4ea6390be0e46a503c5c22b4c4ca4b01.tar.xz
slbt_realpath(): added code path for systems with a realpathat syscall.
Diffstat (limited to 'src')
-rw-r--r--src/helper/slbt_realpath.c12
1 files changed, 12 insertions, 0 deletions
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 <sys/syscall.h>
+#endif
+
#ifdef _MIDIPIX_ABI
#include <sys/fs.h>
#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;