From d4d70d4437177a9b811083d900663bd2442061c9 Mon Sep 17 00:00:00 2001
From: Peter S. Mazinger <ps.m@gmx.net>
Date: Sat, 16 Apr 2011 12:17:41 +0200
Subject: [PATCH 286/396] add swapoff,swapon and symlink stubs

Compile symlink only if syscall is available.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
---
 libc/sysdeps/linux/common/stubs.c   |   12 ++++++++++++
 libc/sysdeps/linux/common/symlink.c |    5 +++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c
index 0e24ac9..0e62dd7 100644
--- a/libc/sysdeps/linux/common/stubs.c
+++ b/libc/sysdeps/linux/common/stubs.c
@@ -446,6 +446,18 @@ make_stub(stime)
 make_stub(settimeofday)
 #endif
 
+#ifndef __NR_swapoff
+make_stub(swapoff)
+#endif
+
+#ifndef __NR_swapon
+make_stub(swapon)
+#endif
+
+#ifndef __NR_symlink
+make_stub(symlink)
+#endif
+
 #ifndef __NR_fadvise64
 make_ret_stub(posix_fadvise)
 #endif
diff --git a/libc/sysdeps/linux/common/symlink.c b/libc/sysdeps/linux/common/symlink.c
index e53e8d4..15a576d 100644
--- a/libc/sysdeps/linux/common/symlink.c
+++ b/libc/sysdeps/linux/common/symlink.c
@@ -8,7 +8,8 @@
  */
 
 #include <sys/syscall.h>
-#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K
-#include <unistd.h>
+
+#if defined __NR_symlink && (defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K)
+# include <unistd.h>
 _syscall2(int, symlink, const char *, oldpath, const char *, newpath)
 #endif
-- 
1.7.0.4

