From 82fc713658c82cbbc577e6f8fa6cec67b911ba6e Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Wed, 10 Oct 2012 14:45:14 +0100 Subject: link: Use linkat if arch does not have the link syscall Signed-off-by: Markos Chandras Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/link.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libc/sysdeps/linux/common/link.c') diff --git a/libc/sysdeps/linux/common/link.c b/libc/sysdeps/linux/common/link.c index b5e5536d5..86d4cfabc 100644 --- a/libc/sysdeps/linux/common/link.c +++ b/libc/sysdeps/linux/common/link.c @@ -9,4 +9,13 @@ #include #include + +#if defined __NR_linkat && !defined __NR_link +# include +int link(const char *oldpath, const char *newpath) +{ + return linkat(AT_FDCWD, oldpath, AT_FDCWD, newpath, 0); +} +#else _syscall2(int, link, const char *, oldpath, const char *, newpath) +#endif -- cgit v1.2.3