Explorar el Código

unify stub logic

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Mike Frysinger hace 16 años
padre
commit
73d5955414
Se han modificado 31 ficheros con 195 adiciones y 275 borrados
  1. 0 9
      extra/Configs/Config.in
  2. 1 1
      libc/sysdeps/linux/arm/posix_fadvise.c
  3. 1 1
      libc/sysdeps/linux/arm/posix_fadvise64.c
  4. 1 11
      libc/sysdeps/linux/common/__rt_sigtimedwait.c
  5. 1 10
      libc/sysdeps/linux/common/__rt_sigwaitinfo.c
  6. 0 6
      libc/sysdeps/linux/common/bdflush.c
  7. 0 6
      libc/sysdeps/linux/common/capget.c
  8. 1 6
      libc/sysdeps/linux/common/capset.c
  9. 0 7
      libc/sysdeps/linux/common/create_module.c
  10. 0 6
      libc/sysdeps/linux/common/delete_module.c
  11. 0 18
      libc/sysdeps/linux/common/epoll.c
  12. 0 7
      libc/sysdeps/linux/common/fdatasync.c
  13. 0 12
      libc/sysdeps/linux/common/fork.c
  14. 0 6
      libc/sysdeps/linux/common/get_kernel_syms.c
  15. 0 6
      libc/sysdeps/linux/common/getpgrp.c
  16. 0 6
      libc/sysdeps/linux/common/init_module.c
  17. 0 6
      libc/sysdeps/linux/common/pivot_root.c
  18. 1 2
      libc/sysdeps/linux/common/posix_fadvise.c
  19. 1 2
      libc/sysdeps/linux/common/posix_fadvise64.c
  20. 0 7
      libc/sysdeps/linux/common/query_module.c
  21. 0 6
      libc/sysdeps/linux/common/sched_getaffinity.c
  22. 0 11
      libc/sysdeps/linux/common/sched_setaffinity.c
  23. 1 5
      libc/sysdeps/linux/common/signalfd.c
  24. 0 7
      libc/sysdeps/linux/common/splice.c
  25. 183 0
      libc/sysdeps/linux/common/stubs.c
  26. 0 6
      libc/sysdeps/linux/common/sync_file_range.c
  27. 0 9
      libc/sysdeps/linux/common/umount.c
  28. 0 6
      libc/sysdeps/linux/common/umount2.c
  29. 0 7
      libc/sysdeps/linux/common/vmsplice.c
  30. 0 78
      libc/sysdeps/linux/common/xattr.c
  31. 4 5
      libc/sysdeps/linux/i386/posix_fadvise64.S

+ 0 - 9
extra/Configs/Config.in

@@ -665,15 +665,6 @@ config UCLIBC_HAS_STUBS
 	  functions which are impossible to implement on the target
 	  functions which are impossible to implement on the target
 	  architecture. Otherwise, such functions are simply omitted.
 	  architecture. Otherwise, such functions are simply omitted.
 
 
-	  As of 2008-07, this option makes uClibc provide fork() stub
-	  on NOMMU targets. It always sets errno to ENOSYS and returns -1.
-
-	  This may be useful if you port a lot of software and cannot
-	  audit all of it and replace or disable fork() usage.
-	  With this option, a program which uses fork() will build
-	  successfully. Of course, it may be useless if fork()
-	  is essential for its operation.
-
 config UCLIBC_HAS_SHADOW
 config UCLIBC_HAS_SHADOW
 	bool "Shadow Password Support"
 	bool "Shadow Password Support"
 	default y
 	default y

+ 1 - 1
libc/sysdeps/linux/arm/posix_fadvise.c

@@ -39,7 +39,7 @@ int posix_fadvise(int fd, off_t offset, off_t len, int advise)
 
 
 /* weak_alias(__libc_posix_fadvise, posix_fadvise); */
 /* weak_alias(__libc_posix_fadvise, posix_fadvise); */
 
 
-#else
+#elif defined __UCLIBC_HAS_STUBS__
 
 
 int posix_fadvise(int fd attribute_unused, off_t offset attribute_unused, off_t len attribute_unused, int advice attribute_unused)
 int posix_fadvise(int fd attribute_unused, off_t offset attribute_unused, off_t len attribute_unused, int advice attribute_unused)
 {
 {

+ 1 - 1
libc/sysdeps/linux/arm/posix_fadvise64.c

@@ -47,7 +47,7 @@ int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advise)
 
 
 /* weak_alias(__libc_posix_fadvise64, posix_fadvise64); */
 /* weak_alias(__libc_posix_fadvise64, posix_fadvise64); */
 
 
-#else
+#elif defined __UCLIBC_HAS_STUBS__
 
 
 int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advise)
 int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advise)
 {
 {

+ 1 - 11
libc/sysdeps/linux/common/__rt_sigtimedwait.c

@@ -86,16 +86,6 @@ int attribute_hidden __sigtimedwait(const sigset_t * set, siginfo_t * info,
 	return __rt_sigtimedwait(set, info, timeout, _NSIG / 8);
 	return __rt_sigtimedwait(set, info, timeout, _NSIG / 8);
 }
 }
 # endif /* !__UCLIBC_HAS_THREADS_NATIVE__ */
 # endif /* !__UCLIBC_HAS_THREADS_NATIVE__ */
-#else
-int attribute_hidden __sigtimedwait(const sigset_t * set, siginfo_t * info,
-									const struct timespec *timeout)
-{
-	if (set == NULL)
-		__set_errno(EINVAL);
-	else
-		__set_errno(ENOSYS);
-	return -1;
-}
-#endif
 weak_alias(__sigtimedwait,sigtimedwait)
 weak_alias(__sigtimedwait,sigtimedwait)
 libc_hidden_weak(sigtimedwait)
 libc_hidden_weak(sigtimedwait)
+#endif

+ 1 - 10
libc/sysdeps/linux/common/__rt_sigwaitinfo.c

@@ -83,16 +83,7 @@ int attribute_hidden __sigwaitinfo(const sigset_t * set, siginfo_t * info)
 	return __rt_sigwaitinfo(set, info, NULL, _NSIG / 8);
 	return __rt_sigwaitinfo(set, info, NULL, _NSIG / 8);
 }
 }
 # endif
 # endif
-#else
-int attribute_hidden __sigwaitinfo(const sigset_t * set, siginfo_t * info)
-{
-	if (set == NULL)
-		__set_errno(EINVAL);
-	else
-		__set_errno(ENOSYS);
-	return -1;
-}
-#endif
 libc_hidden_proto(sigwaitinfo)
 libc_hidden_proto(sigwaitinfo)
 weak_alias (__sigwaitinfo, sigwaitinfo)
 weak_alias (__sigwaitinfo, sigwaitinfo)
 libc_hidden_weak(sigwaitinfo)
 libc_hidden_weak(sigwaitinfo)
+#endif

+ 0 - 6
libc/sysdeps/linux/common/bdflush.c

@@ -12,10 +12,4 @@
 
 
 #ifdef __NR_bdflush
 #ifdef __NR_bdflush
 _syscall2(int, bdflush, int, __func, long int, __data)
 _syscall2(int, bdflush, int, __func, long int, __data)
-#else
-int bdflush(int __func, long int __data)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
 #endif
 #endif

+ 0 - 6
libc/sysdeps/linux/common/capget.c

@@ -11,10 +11,4 @@
 int capget(void *header, void *data);
 int capget(void *header, void *data);
 #ifdef __NR_capget
 #ifdef __NR_capget
 _syscall2(int, capget, void *, header, void *, data)
 _syscall2(int, capget, void *, header, void *, data)
-#else
-int capget(void *header, void *data)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
 #endif
 #endif

+ 1 - 6
libc/sysdeps/linux/common/capset.c

@@ -8,13 +8,8 @@
  */
  */
 
 
 #include <sys/syscall.h>
 #include <sys/syscall.h>
+
 int capset(void *header, const void *data);
 int capset(void *header, const void *data);
 #ifdef __NR_capset
 #ifdef __NR_capset
 _syscall2(int, capset, void *, header, const void *, data)
 _syscall2(int, capset, void *, header, const void *, data)
-#elif defined __UCLIBC_HAS_STUBS__
-int capset(void *header, const void *data)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
 #endif
 #endif

+ 0 - 7
libc/sysdeps/linux/common/create_module.c

@@ -49,11 +49,4 @@ unsigned long create_module(const char *name, size_t size)
 _syscall2(unsigned long, create_module, const char *, name, size_t, size)
 _syscall2(unsigned long, create_module, const char *, name, size_t, size)
 #endif
 #endif
 
 
-#else /* !__NR_create_module */
-caddr_t create_module(const char *name attribute_unused, size_t size attribute_unused);
-caddr_t create_module(const char *name attribute_unused, size_t size attribute_unused)
-{
-	__set_errno(ENOSYS);
-	return (caddr_t)-1;
-}
 #endif
 #endif

+ 0 - 6
libc/sysdeps/linux/common/delete_module.c

@@ -10,10 +10,4 @@
 int delete_module(const char *name, unsigned int flags);
 int delete_module(const char *name, unsigned int flags);
 #ifdef __NR_delete_module
 #ifdef __NR_delete_module
 _syscall2(int, delete_module, const char *, name, unsigned int, flags)
 _syscall2(int, delete_module, const char *, name, unsigned int, flags)
-#elif defined __UCLIBC_HAS_STUBS__
-int delete_module(const char *name, unsigned int flags)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
 #endif
 #endif

+ 0 - 18
libc/sysdeps/linux/common/epoll.c

@@ -15,12 +15,6 @@
  */
  */
 #ifdef __NR_epoll_create
 #ifdef __NR_epoll_create
 _syscall1(int, epoll_create, int, size)
 _syscall1(int, epoll_create, int, size)
-#else
-int epoll_create(int size)
-{
-    __set_errno(ENOSYS);
-    return -1;
-}
 #endif
 #endif
 
 
 /*
 /*
@@ -28,12 +22,6 @@ int epoll_create(int size)
  */
  */
 #ifdef __NR_epoll_ctl
 #ifdef __NR_epoll_ctl
 _syscall4(int,epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event *, event)
 _syscall4(int,epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event *, event)
-#else
-int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
 #endif
 #endif
 
 
 /*
 /*
@@ -41,10 +29,4 @@ int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event)
  */
  */
 #ifdef __NR_epoll_wait
 #ifdef __NR_epoll_wait
 _syscall4(int, epoll_wait, int, epfd, struct epoll_event *, events, int, maxevents, int, timeout)
 _syscall4(int, epoll_wait, int, epfd, struct epoll_event *, events, int, maxevents, int, timeout)
-#else
-int epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
 #endif
 #endif

+ 0 - 7
libc/sysdeps/linux/common/fdatasync.c

@@ -40,11 +40,4 @@ int fdatasync(int fd)
 # endif
 # endif
 }
 }
 
 
-#elif defined __UCLIBC_HAS_STUBS__
-/* no syscall available, so provide a stub */
-int fdatasync(int fd)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
 #endif
 #endif

+ 0 - 12
libc/sysdeps/linux/common/fork.c

@@ -20,16 +20,4 @@ weak_alias(__libc_fork,fork)
 libc_hidden_weak(fork)
 libc_hidden_weak(fork)
 #endif
 #endif
 
 
-#elif defined __UCLIBC_HAS_STUBS__
-
-extern __typeof(fork) __libc_fork;
-pid_t __libc_fork(void)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
-weak_alias(__libc_fork,fork)
-libc_hidden_weak(fork)
-link_warning(fork, "fork: this function is not implemented on no-mmu systems")
-
 #endif
 #endif

+ 0 - 6
libc/sysdeps/linux/common/get_kernel_syms.c

@@ -13,10 +13,4 @@ struct kernel_sym;
 int get_kernel_syms(struct kernel_sym *table attribute_unused);
 int get_kernel_syms(struct kernel_sym *table attribute_unused);
 #ifdef __NR_get_kernel_syms
 #ifdef __NR_get_kernel_syms
 _syscall1(int, get_kernel_syms, struct kernel_sym *, table)
 _syscall1(int, get_kernel_syms, struct kernel_sym *, table)
-#else
-int get_kernel_syms(struct kernel_sym *table attribute_unused)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
 #endif
 #endif

+ 0 - 6
libc/sysdeps/linux/common/getpgrp.c

@@ -19,10 +19,4 @@ pid_t getpgrp(void)
 {
 {
 	return getpgid(getpid());
 	return getpgid(getpid());
 }
 }
-#elif defined __UCLIBC_HAS_STUBS__
-pid_t getpgrp(void)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
 #endif
 #endif

+ 0 - 6
libc/sysdeps/linux/common/init_module.c

@@ -15,11 +15,5 @@ int init_module(void *first, void *second, void *third, void *fourth, void *fift
  * and let the kernel cope with whatever it gets.  It's good at that. */
  * and let the kernel cope with whatever it gets.  It's good at that. */
 _syscall5(int, init_module, void *, first, void *, second, void *, third,
 _syscall5(int, init_module, void *, first, void *, second, void *, third,
 		  void *, fourth, void *, fifth)
 		  void *, fourth, void *, fifth)
-#else
-int init_module(void *first, void *second, void *third, void *fourth, void *fifth)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
 #endif
 #endif
 
 

+ 0 - 6
libc/sysdeps/linux/common/pivot_root.c

@@ -12,10 +12,4 @@
 int pivot_root(const char *new_root, const char *put_old);
 int pivot_root(const char *new_root, const char *put_old);
 #ifdef __NR_pivot_root
 #ifdef __NR_pivot_root
 _syscall2(int, pivot_root, const char *, new_root, const char *, put_old)
 _syscall2(int, pivot_root, const char *, new_root, const char *, put_old)
-#else
-int pivot_root(const char *new_root, const char *put_old)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
 #endif
 #endif

+ 1 - 2
libc/sysdeps/linux/common/posix_fadvise.c

@@ -27,10 +27,9 @@ int posix_fadvise(int fd, off_t offset, off_t len, int advice)
 strong_alias(posix_fadvise,posix_fadvise64)
 strong_alias(posix_fadvise,posix_fadvise64)
 #endif
 #endif
 
 
-#else
+#elif defined __UCLIBC_HAS_STUBS__
 int posix_fadvise(int fd attribute_unused, off_t offset attribute_unused, off_t len attribute_unused, int advice attribute_unused)
 int posix_fadvise(int fd attribute_unused, off_t offset attribute_unused, off_t len attribute_unused, int advice attribute_unused)
 {
 {
-#warning This is not correct as far as SUSv3 is concerned.
 	return ENOSYS;
 	return ENOSYS;
 }
 }
 #endif
 #endif

+ 1 - 2
libc/sysdeps/linux/common/posix_fadvise64.c

@@ -58,13 +58,12 @@ int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice)
 #error your machine is neither 32 bit or 64 bit ... it must be magical
 #error your machine is neither 32 bit or 64 bit ... it must be magical
 #endif
 #endif
 
 
-#elif !defined __NR_fadvise64
+#elif !defined __NR_fadvise64 && defined __UCLIBC_HAS_STUBS__
 /* This is declared as a strong alias in posix_fadvise.c if __NR_fadvise64
 /* This is declared as a strong alias in posix_fadvise.c if __NR_fadvise64
  * is defined.
  * is defined.
  */
  */
 int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice)
 int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice)
 {
 {
-#warning This is not correct as far as SUSv3 is concerned.
 	return ENOSYS;
 	return ENOSYS;
 }
 }
 #endif /* __NR_fadvise64_64 */
 #endif /* __NR_fadvise64_64 */

+ 0 - 7
libc/sysdeps/linux/common/query_module.c

@@ -13,11 +13,4 @@ int query_module(const char *name attribute_unused, int which attribute_unused,
 #ifdef __NR_query_module
 #ifdef __NR_query_module
 _syscall5(int, query_module, const char *, name, int, which,
 _syscall5(int, query_module, const char *, name, int, which,
 		  void *, buf, size_t, bufsize, size_t *, ret)
 		  void *, buf, size_t, bufsize, size_t *, ret)
-#elif defined __UCLIBC_HAS_STUBS__
-int query_module(const char *name attribute_unused, int which attribute_unused,
-				 void *buf attribute_unused, size_t bufsize attribute_unused, size_t * ret attribute_unused)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
 #endif
 #endif

+ 0 - 6
libc/sysdeps/linux/common/sched_getaffinity.c

@@ -44,11 +44,5 @@ int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *cpuset)
 	}
 	}
 	return res;
 	return res;
 }
 }
-#elif defined __UCLIBC_HAS_STUBS__
-int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *cpuset)
-{
-    __set_errno(ENOSYS);
-    return -1;
-}
 #endif
 #endif
 #endif
 #endif

+ 0 - 11
libc/sysdeps/linux/common/sched_setaffinity.c

@@ -70,16 +70,5 @@ int sched_setaffinity(pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)
 
 
 	return INLINE_SYSCALL (sched_setaffinity, 3, pid, cpusetsize, cpuset);
 	return INLINE_SYSCALL (sched_setaffinity, 3, pid, cpusetsize, cpuset);
 }
 }
-#else
-#define ___HAVE_NO_sched_setaffinity
 #endif
 #endif
-
-#if defined ___HAVE_NO_sched_setaffinity && defined __UCLIBC_HAS_STUBS__
-int sched_setaffinity(pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)
-{
-    __set_errno(ENOSYS);
-    return -1;
-}
-#endif
-
 #endif /* __USE_GNU */
 #endif /* __USE_GNU */

+ 1 - 5
libc/sysdeps/linux/common/signalfd.c

@@ -21,8 +21,7 @@ static __inline__ _syscall3(int, __syscall_signalfd, int, fd,
 		const sigset_t *, mask, size_t, sizemask)
 		const sigset_t *, mask, size_t, sizemask)
 #endif
 #endif
 
 
-#if defined __NR_signalfd4 || defined __NR_signalfd \
+#if defined __NR_signalfd4 || defined __NR_signalfd
-	|| defined __UCLIBC_HAS_STUBS__
 int signalfd (int fd, const sigset_t *mask, int flags)
 int signalfd (int fd, const sigset_t *mask, int flags)
 {
 {
 #if defined __NR___syscall_signalfd4
 #if defined __NR___syscall_signalfd4
@@ -33,9 +32,6 @@ int signalfd (int fd, const sigset_t *mask, int flags)
 		return -1;
 		return -1;
 	}
 	}
 	return __syscall_signalfd(fd, mask, _NSIG / 8);
 	return __syscall_signalfd(fd, mask, _NSIG / 8);
-#elif defined __UCLIBC_HAS_STUBS__
-	__set_errno(ENOSYS);
-	return -1;
 #endif
 #endif
 }
 }
 #endif
 #endif

+ 0 - 7
libc/sysdeps/linux/common/splice.c

@@ -13,11 +13,4 @@
 #ifdef __NR_splice
 #ifdef __NR_splice
 _syscall6(ssize_t, splice, int, __fdin, __off64_t *, __offin, int, __fdout,
 _syscall6(ssize_t, splice, int, __fdin, __off64_t *, __offin, int, __fdout,
 	__off64_t *, __offout, size_t, __len, unsigned int, __flags)
 	__off64_t *, __offout, size_t, __len, unsigned int, __flags)
-#else
-ssize_t splice(int __fdin, __off64_t *__offin, int __fdout,
-	__off64_t *__offout, size_t __len, unsigned int __flags)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
 #endif
 #endif

+ 183 - 0
libc/sysdeps/linux/common/stubs.c

@@ -0,0 +1,183 @@
+/*
+ * system call not available stub
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <errno.h>
+#include <sys/syscall.h>
+
+#ifdef __UCLIBC_HAS_STUBS__
+
+attribute_hidden int enosys_stub(void);
+libc_hidden_proto(enosys_stub)
+
+attribute_hidden int enosys_stub(void)
+{
+	__set_errno(ENOSYS);
+	return -1;
+}
+libc_hidden_def(enosys_stub)
+
+#define make_stub(stub) \
+	link_warning(stub, #stub ": this function is not implemented") \
+	strong_alias(enosys_stub, stub)
+
+#ifndef __ARCH_USE_MMU__
+# undef __NR_fork
+#endif
+
+#ifndef __UCLIBC_HAS_LFS__
+# undef __NR_fadvise64
+# undef __NR_fadvise64_64
+# undef __NR_sync_file_range
+#endif
+
+#ifndef __NR_bdflush
+make_stub(bdflush)
+#endif
+
+#ifndef __NR_capget
+make_stub(capget)
+#endif
+
+#ifndef __NR_capset
+make_stub(capset)
+#endif
+
+#ifndef __NR_create_module
+make_stub(create_module)
+#endif
+
+#ifndef __NR_delete_module
+make_stub(delete_module)
+#endif
+
+#ifndef __NR_epoll_create
+make_stub(epoll_create)
+#endif
+
+#ifndef __NR_epoll_ctl
+make_stub(epoll_ctl)
+#endif
+
+#ifndef __NR_epoll_wait
+make_stub(epoll_wait)
+#endif
+
+#ifndef __NR_fdatasync
+make_stub(fdatasync)
+#endif
+
+#ifndef __NR_flistxattr
+make_stub(flistxattr)
+#endif
+
+#ifndef __NR_fork
+make_stub(fork)
+#endif
+
+#ifndef __NR_fgetxattr
+make_stub(fgetxattr)
+#endif
+
+#ifndef __NR_fremovexattr
+make_stub(fremovexattr)
+#endif
+
+#ifndef __NR_fsetxattr
+make_stub(fsetxattr)
+#endif
+
+#ifndef __NR_get_kernel_syms
+make_stub(get_kernel_syms)
+#endif
+
+#if !defined(__NR_getpgrp) && (defined(__NR_getpgid) && (defined(__NR_getpid) || defined(__NR_getxpid)))
+make_stub(getpgrp)
+#endif
+
+#ifndef __NR_getxattr
+make_stub(getxattr)
+#endif
+
+#ifndef __NR_init_module
+make_stub(init_module)
+#endif
+
+#ifndef __NR_lgetxattr
+make_stub(lgetxattr)
+#endif
+
+#ifndef __NR_listxattr
+make_stub(listxattr)
+#endif
+
+#ifndef __NR_llistxattr
+make_stub(llistxattr)
+#endif
+
+#ifndef __NR_lremovexattr
+make_stub(lremovexattr)
+#endif
+
+#ifndef __NR_lsetxattr
+make_stub(lsetxattr)
+#endif
+
+#ifndef __NR_pivot_root
+make_stub(pivot_root)
+#endif
+
+#ifndef __NR_query_module
+make_stub(query_module)
+#endif
+
+#ifndef __NR_removexattr
+make_stub(removexattr)
+#endif
+
+#ifndef __NR_sched_getaffinity
+make_stub(sched_getaffinity)
+#endif
+
+#ifndef __NR_sched_setaffinity
+make_stub(sched_setaffinity)
+#endif
+
+#ifndef __NR_setxattr
+make_stub(setxattr)
+#endif
+
+#if !defined(__NR_signalfd4) && !defined(__NR_signalfd)
+make_stub(signalfd)
+#endif
+
+#ifndef __NR_rt_sigtimedwait
+make_stub(sigtimedwait)
+make_stub(sigwaitinfo)
+#endif
+
+#ifndef __NR_splice
+make_stub(splice)
+#endif
+
+#ifndef __NR_sync_file_range
+make_stub(sync_file_range)
+#endif
+
+#if !defined(__NR_umount) && !defined(__NR_umount2)
+make_stub(umount)
+#endif
+
+#ifndef __NR_umount2
+make_stub(umount2)
+#endif
+
+#ifndef __NR_vmsplice
+make_stub(vmsplice)
+#endif
+
+#endif

+ 0 - 6
libc/sysdeps/linux/common/sync_file_range.c

@@ -23,11 +23,5 @@ int sync_file_range(int fd, off64_t offset, off64_t nbytes, unsigned int flags)
 		__LONG_LONG_PAIR((long)(nbytes >> 32), (long)(nbytes & 0xffffffff)),
 		__LONG_LONG_PAIR((long)(nbytes >> 32), (long)(nbytes & 0xffffffff)),
 		flags);
 		flags);
 }
 }
-#elif defined __UCLIBC_HAS_STUBS__
-int sync_file_range(int fd, __off64_t offset, __off64_t nbytes, unsigned int flags)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
 #endif
 #endif
 #endif
 #endif

+ 0 - 9
libc/sysdeps/linux/common/umount.c

@@ -28,14 +28,5 @@ int umount(const char *special_file)
 	return (__syscall_umount2(special_file, 0));
 	return (__syscall_umount2(special_file, 0));
 }
 }
 
 
-/* arch doesn't provide any umount syscall !? */
-#else
-
-int umount(const char *special_file)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
-
 #endif
 #endif
 #endif
 #endif

+ 0 - 6
libc/sysdeps/linux/common/umount2.c

@@ -13,11 +13,5 @@
 #include <sys/mount.h>
 #include <sys/mount.h>
 #ifdef __NR_umount2	/* Old kernels don't have umount2 */
 #ifdef __NR_umount2	/* Old kernels don't have umount2 */
 _syscall2(int, umount2, const char *, special_file, int, flags)
 _syscall2(int, umount2, const char *, special_file, int, flags)
-#else
-int umount2(const char *special_file, int flags)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
 #endif
 #endif
 #endif
 #endif

+ 0 - 7
libc/sysdeps/linux/common/vmsplice.c

@@ -13,11 +13,4 @@
 #ifdef __NR_vmsplice
 #ifdef __NR_vmsplice
 _syscall4(ssize_t, vmsplice, int, __fdout, const struct iovec *, __iov,
 _syscall4(ssize_t, vmsplice, int, __fdout, const struct iovec *, __iov,
 	size_t, __count, unsigned int, __flags)
 	size_t, __count, unsigned int, __flags)
-#else
-ssize_t vmsplice(int __fdout, const struct iovec *__iov, size_t __count,
-	unsigned int __flags)
-{
-	__set_errno(ENOSYS);
-	return -1;
-}
 #endif
 #endif

+ 0 - 78
libc/sysdeps/linux/common/xattr.c

@@ -29,136 +29,58 @@
 #ifdef __NR_setxattr
 #ifdef __NR_setxattr
 _syscall5(int, setxattr, const char *, path, const char *, name,
 _syscall5(int, setxattr, const char *, path, const char *, name,
 	const void *, value, size_t, size, int, flags)
 	const void *, value, size_t, size, int, flags)
-#else
-int setxattr(__const char *__path, __const char *__name,
-	__const void *__value, size_t __size, int __flags)
-{
-    __set_errno(ENOSYS);
-    return -1;
-}
 #endif
 #endif
 
 
 #ifdef __NR_lsetxattr
 #ifdef __NR_lsetxattr
 _syscall5(int, lsetxattr, const char *, path, const char *, name,
 _syscall5(int, lsetxattr, const char *, path, const char *, name,
 	const void *, value, size_t, size, int, flags)
 	const void *, value, size_t, size, int, flags)
-#else
-int lsetxattr(__const char *__path, __const char *__name,
-	__const void *__value, size_t __size, int __flags)
-{
-    __set_errno(ENOSYS);
-    return -1;
-}
 #endif
 #endif
 
 
 #ifdef __NR_fsetxattr
 #ifdef __NR_fsetxattr
 _syscall5(int, fsetxattr, int, filedes, const char *, name, const void *,
 _syscall5(int, fsetxattr, int, filedes, const char *, name, const void *,
 	value, size_t, size, int, flags)
 	value, size_t, size, int, flags)
-#else
-int fsetxattr(int __fd, __const char *__name, __const void *__value,
-	size_t __size, int __flags)
-{
-    __set_errno(ENOSYS);
-    return -1;
-}
 #endif
 #endif
 
 
 /* gets */
 /* gets */
 #ifdef __NR_getxattr
 #ifdef __NR_getxattr
 _syscall4(ssize_t, getxattr, const char *, path, const char *, name,
 _syscall4(ssize_t, getxattr, const char *, path, const char *, name,
 	void *, value, size_t, size)
 	void *, value, size_t, size)
-#else
-ssize_t getxattr(__const char *__path, __const char *__name, void *__value,
-	size_t __size)
-{
-    __set_errno(ENOSYS);
-    return -1;
-}
 #endif
 #endif
 
 
 #ifdef __NR_lgetxattr
 #ifdef __NR_lgetxattr
 _syscall4(ssize_t, lgetxattr, const char *, path, const char *, name,
 _syscall4(ssize_t, lgetxattr, const char *, path, const char *, name,
 	void *, value, size_t, size)
 	void *, value, size_t, size)
-#else
-ssize_t lgetxattr(__const char *__path, __const char *__name,
-	void *__value, size_t __size)
-{
-    __set_errno(ENOSYS);
-    return -1;
-}
 #endif
 #endif
 
 
 #ifdef __NR_fgetxattr
 #ifdef __NR_fgetxattr
 _syscall4(ssize_t, fgetxattr, int, filedes, const char *, name, void *,
 _syscall4(ssize_t, fgetxattr, int, filedes, const char *, name, void *,
 	value, size_t, size)
 	value, size_t, size)
-#else
-ssize_t fgetxattr(int __fd, __const char *__name, void *__value,
-	size_t __size)
-{
-    __set_errno(ENOSYS);
-    return -1;
-}
 #endif
 #endif
 
 
 /* list */
 /* list */
 #ifdef __NR_listxattr
 #ifdef __NR_listxattr
 _syscall3(ssize_t, listxattr, const char *, path, char *, list, size_t,
 _syscall3(ssize_t, listxattr, const char *, path, char *, list, size_t,
 	size)
 	size)
-#else
-ssize_t listxattr(__const char *__path, char *__list, size_t __size)
-{
-    __set_errno(ENOSYS);
-    return -1;
-}
 #endif
 #endif
 
 
 #ifdef __NR_llistxattr
 #ifdef __NR_llistxattr
 _syscall3(ssize_t, llistxattr, const char *, path, char *, list, size_t,
 _syscall3(ssize_t, llistxattr, const char *, path, char *, list, size_t,
 	size)
 	size)
-#else
-ssize_t llistxattr(__const char *__path, char *__list, size_t __size)
-{
-    __set_errno(ENOSYS);
-    return -1;
-}
 #endif
 #endif
 
 
 #ifdef __NR_flistxattr
 #ifdef __NR_flistxattr
 _syscall3(ssize_t, flistxattr, int, filedes, char *, list, size_t, size)
 _syscall3(ssize_t, flistxattr, int, filedes, char *, list, size_t, size)
-#else
-ssize_t flistxattr(int __fd, char *__list, size_t __size)
-{
-    __set_errno(ENOSYS);
-    return -1;
-}
 #endif
 #endif
 
 
 /* remove */
 /* remove */
 #ifdef __NR_removexattr
 #ifdef __NR_removexattr
 _syscall2(int, removexattr, const char *, path, const char *, name)
 _syscall2(int, removexattr, const char *, path, const char *, name)
-#else
-int removexattr(__const char *__path, __const char *__name)
-{
-    __set_errno(ENOSYS);
-    return -1;
-}
 #endif
 #endif
 
 
 #ifdef __NR_lremovexattr
 #ifdef __NR_lremovexattr
 _syscall2(int, lremovexattr, const char *, path, const char *, name)
 _syscall2(int, lremovexattr, const char *, path, const char *, name)
-#else
-int lremovexattr(__const char *__path, __const char *__name)
-{
-    __set_errno(ENOSYS);
-    return -1;
-}
 #endif
 #endif
 
 
 #ifdef __NR_fremovexattr
 #ifdef __NR_fremovexattr
 _syscall2(int, fremovexattr, int, filedes, const char *, name)
 _syscall2(int, fremovexattr, int, filedes, const char *, name)
-#else
-int fremovexattr(int __fd, __const char *__name)
-{
-    __set_errno(ENOSYS);
-    return -1;
-}
 #endif
 #endif

+ 4 - 5
libc/sysdeps/linux/i386/posix_fadvise64.S

@@ -22,6 +22,8 @@
 #include <bits/errno.h>
 #include <bits/errno.h>
 #include <sys/syscall.h>
 #include <sys/syscall.h>
 
 
+#if defined __NR_fadvise64_64
+
 /* Was named __libc_posix_fadvise64 for some inexplicable reason.
 /* Was named __libc_posix_fadvise64 for some inexplicable reason.
 ** google says only uclibc has *__libc*_posix_fadviseXXX,
 ** google says only uclibc has *__libc*_posix_fadviseXXX,
 ** so it cannot be compat with anything.
 ** so it cannot be compat with anything.
@@ -33,7 +35,6 @@
 .global posix_fadvise64
 .global posix_fadvise64
 .type   posix_fadvise64,%function
 .type   posix_fadvise64,%function
 posix_fadvise64:
 posix_fadvise64:
-#if defined __NR_fadvise64_64
 	/* Save regs  */
 	/* Save regs  */
 	pushl	%ebp
 	pushl	%ebp
 	pushl	%ebx
 	pushl	%ebx
@@ -91,10 +92,6 @@ overflow:
 	/* Returns 0 on success, else an error code.  */
 	/* Returns 0 on success, else an error code.  */
 	negl	%eax
 	negl	%eax
 
 
-#elif defined __UCLIBC_HAS_STUBS__
-	movl	$-ENOSYS, %eax
-	jmp __syscall_error
-#endif
 	/* Successful; return the syscall's value.  */
 	/* Successful; return the syscall's value.  */
 	ret
 	ret
 
 
@@ -106,3 +103,5 @@ overflow:
 ** weak_alias(__libc_posix_fadvise64,posix_fadvise64)
 ** weak_alias(__libc_posix_fadvise64,posix_fadvise64)
 ** #endif
 ** #endif
 */
 */
+
+#endif