[git commit future] stubs.c: provide stubs for posix_fadvise[64]
Peter S. Mazinger
ps.m at gmx.net
Wed Mar 30 11:53:36 UTC 2011
commit: http://git.uclibc.org/uClibc/commit/?id=690ca664f1f0b4f74ba4175c5afde817546b9fb8
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/future
Add a new macro to return ENOSYS.
Despite it's name, __NR_fadvise64 is not LFS related, do not undefine it.
Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
---
libc/sysdeps/linux/common/stubs.c | 31 ++++++++++++++++++++++++++++++-
1 files changed, 30 insertions(+), 1 deletions(-)
diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c
index 3899f35..883bd34 100644
--- a/libc/sysdeps/linux/common/stubs.c
+++ b/libc/sysdeps/linux/common/stubs.c
@@ -17,16 +17,37 @@ static int enosys_stub(void)
return -1;
}
+static int ret_enosys_stub(void)
+{
+ return ENOSYS;
+}
+
#define make_stub(stub) \
link_warning(stub, #stub ": this function is not implemented") \
strong_alias(enosys_stub, stub)
+#define make_ret_stub(stub) \
+ link_warning(stub, #stub ": this function is not implemented") \
+ strong_alias(ret_enosys_stub, stub)
+
#ifndef __ARCH_USE_MMU__
# undef __NR_fork
#endif
+#ifdef __arm__
+# define __NR_fadvise64_64 __NR_arm_fadvise64_64
+# define __NR_fadvise64 __NR_arm_fadvise64_64
+#endif
+
+#ifdef __mips__
+# define __NR_fadvise64_64 __NR_fadvise64
+#endif
+
+#ifdef __xtensa__
+# define __NR_fadvise64 __NR_fadvise64_64
+#endif
+
#ifndef __UCLIBC_HAS_LFS__
-# undef __NR_fadvise64
# undef __NR_fadvise64_64
# undef __NR_readahead
# undef __NR_sync_file_range
@@ -198,4 +219,12 @@ make_stub(lutimes)
# endif
#endif
+#ifndef __NR_fadvise64
+make_ret_stub(posix_fadvise)
+#endif
+
+#ifndef __NR_fadvise64_64
+make_ret_stub(posix_fadvise64)
+#endif
+
#endif
--
1.7.3.4
More information about the uClibc-cvs
mailing list