zte's code,first commit

Change-Id: I9a04da59e459a9bc0d67f101f700d9d7dc8d681b
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/.indent.pro b/ap/build/uClibc/libc/sysdeps/linux/common/.indent.pro
new file mode 100644
index 0000000..492ecf1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/.indent.pro
@@ -0,0 +1,33 @@
+--blank-lines-after-declarations
+--blank-lines-after-procedures
+--break-before-boolean-operator
+--no-blank-lines-after-commas
+--braces-on-if-line
+--braces-on-struct-decl-line
+--comment-indentation25
+--declaration-comment-column25
+--no-comment-delimiters-on-blank-lines
+--cuddle-else
+--continuation-indentation4
+--case-indentation0
+--else-endif-column33
+--space-after-cast
+--line-comments-indentation0
+--declaration-indentation1
+--dont-format-first-column-comments
+--dont-format-comments
+--honour-newlines
+--indent-level4
+/* changed from 0 to 4 */
+--parameter-indentation4
+--line-length78 /* changed from 75 */
+--continue-at-parentheses
+--no-space-after-function-call-names
+--dont-break-procedure-type
+--dont-star-comments
+--leave-optional-blank-lines
+--dont-space-special-semicolon
+--tab-size4
+/* additions by Mark */
+--case-brace-indentation0
+--leave-preprocessor-space
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/Makefile b/ap/build/uClibc/libc/sysdeps/linux/common/Makefile
new file mode 100644
index 0000000..3ed177a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/Makefile
@@ -0,0 +1,13 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+top_srcdir=../../../../
+top_builddir=../../../../
+all: objs
+include $(top_builddir)Rules.mak
+include Makefile.in
+include $(top_srcdir)Makerules
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/Makefile.in b/ap/build/uClibc/libc/sysdeps/linux/common/Makefile.in
new file mode 100644
index 0000000..3b5763c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/Makefile.in
@@ -0,0 +1,125 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+COMMON_DIR := $(top_srcdir)libc/sysdeps/linux/common
+COMMON_OUT := $(top_builddir)libc/sysdeps/linux/common
+
+CSRC-y := $(notdir $(wildcard $(COMMON_DIR)/*.c))
+CSRC-  := ssp-local.c
+
+CSRC_LFS := $(notdir $(wildcard $(COMMON_DIR)/*64.c))
+CSRC-y := $(filter-out llseek.c $(CSRC_LFS),$(CSRC-y))
+CSRC-$(UCLIBC_HAS_LFS) += llseek.c $(CSRC_LFS)
+CSRC-$(findstring y,$(UCLIBC_HAS_SSP)$(UCLIBC_HAS_FORTIFY)) += ssp.c
+CSRC-$(UCLIBC_LINUX_MODULE_26) += delete_module.c init_module.c
+CSRC-$(UCLIBC_LINUX_MODULE_24) += create_module.c query_module.c \
+	get_kernel_syms.c
+# we need these internally: fstatfs.c statfs.c
+CSRC-$(UCLIBC_LINUX_SPECIFIC) += \
+	bdflush.c \
+	capget.c \
+	capset.c \
+	eventfd.c \
+	inotify.c \
+	ioperm.c \
+	iopl.c \
+	modify_ldt.c \
+	personality.c \
+	pipe2.c \
+	ppoll.c \
+	prctl.c \
+	readahead.c \
+	reboot.c \
+	remap_file_pages.c \
+	sched_cpucount.c \
+	sched_getaffinity.c \
+	sched_getcpu.c \
+	sched_setaffinity.c \
+	sendfile.c \
+	setfsgid.c \
+	setfsuid.c \
+	setresgid.c \
+	setresuid.c \
+	signalfd.c \
+	splice.c \
+	swapoff.c \
+	swapon.c \
+	sync_file_range.c \
+	sysctl.c \
+	sysinfo.c \
+	tee.c \
+	timerfd.c \
+	umount2.c \
+	umount.c \
+	unshare.c \
+	uselib.c \
+	vhangup.c \
+	vmsplice.c
+CSRC-$(if $(findstring yy,$(UCLIBC_LINUX_SPECIFIC)$(UCLIBC_HAS_LFS)),y) += \
+	sendfile64.c
+# NPTL needs these internally: madvise.c
+CSRC-$(findstring y,$(UCLIBC_LINUX_SPECIFIC)$(UCLIBC_HAS_THREADS_NATIVE)) += madvise.c
+ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
+CSRC- += fork.c getpid.c raise.c open.c close.c read.c write.c
+CSRC- += $(if $(findstring =arm=,=$(TARGET_ARCH)=),vfork.c)
+CSRC- += $(if $(findstring =x86_64=,=$(TARGET_ARCH)=),vfork.c)
+CSRC- += $(if $(findstring =mips=y=,=$(TARGET_ARCH)=$(CONFIG_MIPS_O32_ABI)=),waitpid.c)
+endif
+# stubbed out in mman.h
+CSRC-$(ARCH_USE_MMU) += msync.c
+# we need these internally: getdomainname.c
+CSRC-$(UCLIBC_BSD_SPECIFIC) += mincore.c setdomainname.c
+CSRC-$(UCLIBC_NTP_LEGACY) += ntp_gettime.c
+# aio_cancel|aio_error|aio_fsync|aio_read|aio_return|aio_suspend|aio_write|clock_getres|clock_gettime|clock_settime|clock_settime|fdatasync|lio_listio|mlockall|munlockall|mlock|munlock|mq_close|mq_getattr|mq_notify|mq_open|mq_receive|mq_timedreceive|mq_send|mq_timedsend|mq_setattr|mq_unlink|nanosleep|sched_getparam|sched_get_priority_max|sched_get_priority_min|sched_getscheduler|sched_rr_get_interval|sched_setparam|sched_setscheduler|sem_close|sem_destroy|sem_getvalue|sem_init|sem_open|sem_post|sem_trywait|sem_wait|sem_unlink|sem_wait|shm_open|shm_unlink|sigqueue|sigtimedwait|sigwaitinfo|sigwaitinfo|timer_create|timer_delete|timer_getoverrun|timer_gettime|timer_settime
+CSRC-$(UCLIBC_HAS_REALTIME) += clock_getres.c clock_gettime.c clock_settime.c \
+	fdatasync.c mlockall.c mlock.c munlockall.c munlock.c \
+	nanosleep.c __rt_sigtimedwait.c __rt_sigwaitinfo.c sched_getparam.c \
+	sched_get_priority_max.c sched_get_priority_min.c sched_getscheduler.c \
+	sched_rr_get_interval.c sched_setparam.c sched_setscheduler.c sigqueue.c
+# clock_getcpuclockid|clock_nanosleep|mq_timedreceive|mq_timedsend|posix_fadvise|posix_fallocate|posix_madvise|posix_memalign|posix_mem_offset|posix_spawnattr_destroy|posix_spawnattr_init|posix_spawnattr_getflags|posix_spawnattr_setflags|posix_spawnattr_getpgroup|posix_spawnattr_setpgroup|posix_spawnattr_getschedparam|posix_spawnattr_setschedparam|posix_spawnattr_getschedpolicy|posix_spawnattr_setschedpolicy|posix_spawnattr_getsigdefault|posix_spawnattr_setsigdefault|posix_spawnattr_getsigmask|posix_spawnattr_setsigmask|posix_spawnattr_init|posix_spawnattr_setflags|posix_spawnattr_setpgroup|posix_spawnattr_setschedparam|posix_spawnattr_setschedpolicy|posix_spawnattr_setsigdefault|posix_spawnattr_setsigmask|posix_spawn_file_actions_addclose|posix_spawn_file_actions_addopen|posix_spawn_file_actions_adddup2|posix_spawn_file_actions_addopen|posix_spawn_file_actions_destroy|posix_spawn_file_actions_init|posix_spawn_file_actions_init|posix_spawn|posix_spawnp|posix_spawnp|posix_typed_mem_get_info|pthread_mutex_timedlock|sem_timedwait
+CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c
+CSRC-$(UCLIBC_SUSV4_LEGACY) += utime.c
+CSRC-$(UCLIBC_HAS_EPOLL) += epoll.c
+CSRC-$(UCLIBC_HAS_XATTR) += xattr.c
+CSRC-$(UCLIBC_HAS_PROFILING) += noophooks.c #pcprofile.c
+CSRC-$(UCLIBC_SV4_DEPRECATED) += ustat.c
+CSRC- += $(if $(findstring =c6x=,=$(TARGET_ARCH)=),vfork.c)
+CSRC- += $(if $(findstring =sh=,=$(TARGET_ARCH)=),vfork.c)
+CSRC- += $(if $(findstring =sparc=,=$(TARGET_ARCH)=),vfork.c)
+CSRC- += $(if $(findstring =i386=,=$(TARGET_ARCH)=),vfork.c)
+
+CSRC-y := $(filter-out $(CSRC-),$(CSRC-y))
+
+# provided via pthreads builddir
+CSRC-y := $(filter-out $(libc_a_CSRC) $(notdir $(libpthread_libc_OBJS:.o=.c)),$(CSRC-y))
+SSRC := $(filter-out $(libc_a_SSRC) $(notdir $(libpthread_libc_OBJS:.o=.S)),$(SSRC))
+
+# fails for some reason
+ifneq ($(strip $(ARCH_OBJS)),)
+CSRC-y := $(filter-out $(notdir $(ARCH_OBJS:.o=.c)) $(ARCH_OBJ_FILTEROUT),$(CSRC-y))
+endif
+
+CFLAGS-ssp.c := $(SSP_DISABLE_FLAGS)
+CFLAGS-ssp-local.c := $(SSP_DISABLE_FLAGS)
+
+COMMON_SRC := $(patsubst %.c,$(COMMON_DIR)/%.c,$(CSRC-y))
+COMMON_OBJ := $(patsubst %.c,$(COMMON_OUT)/%.o,$(CSRC-y))
+
+libc-y += $(COMMON_OBJ)
+libc-static-$(UCLIBC_HAS_SSP) += $(COMMON_OUT)/ssp-local.o
+libc-nonshared-$(UCLIBC_HAS_SSP) += $(COMMON_OUT)/ssp-local.os
+
+libc-nomulti-y += $(COMMON_OUT)/__syscall_rt_sigaction.o \
+	$(COMMON_OUT)/__syscall_sigaction.o \
+	$(COMMON_OUT)/mremap.o \
+	$(COMMON_OUT)/stat.o
+libc-nomulti-$(UCLIBC_HAS_SSP) += $(COMMON_OUT)/ssp.o
+
+objclean-y += CLEAN_libc/sysdeps/linux/common
+
+CLEAN_libc/sysdeps/linux/common:
+	$(do_rm) $(addprefix $(COMMON_OUT)/*., o os oS)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/__rt_sigtimedwait.c b/ap/build/uClibc/libc/sysdeps/linux/common/__rt_sigtimedwait.c
new file mode 100644
index 0000000..d9f3260
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/__rt_sigtimedwait.c
@@ -0,0 +1,92 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * __rt_sigtimedwait() for uClibc
+ *
+ * Copyright (C) 2006 by Steven Hill <sjhill@realitydiluted.com>
+ * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ *
+ * GNU Library General Public License (LGPL) version 2 or later.
+ */
+
+#include <sys/syscall.h>
+#include <signal.h>
+#include <string.h>
+
+#ifdef __NR_rt_sigtimedwait
+
+# ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#  include <sysdep-cancel.h>
+#  include <pthreadP.h>	/* SIGCANCEL */
+
+static int do_sigtimedwait(const sigset_t *set, siginfo_t *info,
+						   const struct timespec *timeout)
+{
+#  ifdef SIGCANCEL
+	sigset_t tmpset;
+
+	if (set != NULL && (__builtin_expect (__sigismember (set, SIGCANCEL), 0)
+#   ifdef SIGSETXID
+		|| __builtin_expect (__sigismember (set, SIGSETXID), 0)
+#   endif
+		))
+	{
+		/* Create a temporary mask without the bit for SIGCANCEL set.  */
+		// We are not copying more than we have to.
+		memcpy (&tmpset, set, _NSIG / 8);
+		__sigdelset (&tmpset, SIGCANCEL);
+#   ifdef SIGSETXID
+		__sigdelset (&tmpset, SIGSETXID);
+#   endif
+		set = &tmpset;
+	}
+#  endif
+
+	/* XXX The size argument hopefully will have to be changed to the
+	   real size of the user-level sigset_t.  */
+	int result = INLINE_SYSCALL (rt_sigtimedwait, 4, set, info,
+								 timeout, _NSIG / 8);
+
+	/* The kernel generates a SI_TKILL code in si_code in case tkill is
+	   used.  tkill is transparently used in raise().  Since having
+	   SI_TKILL as a code is useful in general we fold the results
+	   here.  */
+	if (result != -1 && info != NULL && info->si_code == SI_TKILL)
+		info->si_code = SI_USER;
+
+	return result;
+}
+
+/* Return any pending signal or wait for one for the given time.  */
+int attribute_hidden __sigtimedwait(const sigset_t *set, siginfo_t *info,
+				    const struct timespec *timeout)
+{
+	if(SINGLE_THREAD_P)
+		return do_sigtimedwait(set, info, timeout);
+
+	int oldtype = LIBC_CANCEL_ASYNC();
+
+	/* XXX The size argument hopefully will have to be changed to the
+	   real size of the user-level sigset_t.  */
+	int result = do_sigtimedwait(set, info, timeout);
+
+	LIBC_CANCEL_RESET(oldtype);
+
+	return result;
+}
+# else
+#  define __need_NULL
+#  include <stddef.h>
+#  define __NR___rt_sigtimedwait __NR_rt_sigtimedwait
+static _syscall4(int, __rt_sigtimedwait, const sigset_t *, set,
+				 siginfo_t *, info, const struct timespec *, timeout,
+				 size_t, setsize);
+
+int attribute_hidden __sigtimedwait(const sigset_t * set, siginfo_t * info,
+									const struct timespec *timeout)
+{
+	return __rt_sigtimedwait(set, info, timeout, _NSIG / 8);
+}
+# endif /* !__UCLIBC_HAS_THREADS_NATIVE__ */
+weak_alias(__sigtimedwait,sigtimedwait)
+libc_hidden_weak(sigtimedwait)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/__rt_sigwaitinfo.c b/ap/build/uClibc/libc/sysdeps/linux/common/__rt_sigwaitinfo.c
new file mode 100644
index 0000000..6b43327
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/__rt_sigwaitinfo.c
@@ -0,0 +1,89 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * __rt_sigwaitinfo() for uClibc
+ *
+ * Copyright (C) 2006 by Steven Hill <sjhill@realitydiluted.com>
+ * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ *
+ * GNU Library General Public License (LGPL) version 2 or later.
+ */
+
+#include <sys/syscall.h>
+#include <signal.h>
+#include <string.h>
+
+#ifdef __NR_rt_sigtimedwait
+
+# ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#  include <sysdep-cancel.h>
+
+static int do_sigwaitinfo(const sigset_t *set, siginfo_t *info)
+{
+#  ifdef SIGCANCEL
+	sigset_t tmpset;
+
+	if (set != NULL && (__builtin_expect (__sigismember (set, SIGCANCEL), 0)
+#   ifdef SIGSETXID
+		|| __builtin_expect (__sigismember (set, SIGSETXID), 0)
+#   endif
+		))
+	{
+		/* Create a temporary mask without the bit for SIGCANCEL set.  */
+		// We are not copying more than we have to.
+		memcpy (&tmpset, set, _NSIG / 8);
+		__sigdelset (&tmpset, SIGCANCEL);
+#   ifdef SIGSETXID
+		__sigdelset (&tmpset, SIGSETXID);
+#   endif
+		set = &tmpset;
+	}
+#  endif
+
+	/* XXX The size argument hopefully will have to be changed to the
+	   real size of the user-level sigset_t.  */
+	int result = INLINE_SYSCALL (rt_sigtimedwait, 4, set, info,
+								 NULL, _NSIG / 8);
+
+	/* The kernel generates a SI_TKILL code in si_code in case tkill is
+	   used.  tkill is transparently used in raise().  Since having
+	   SI_TKILL as a code is useful in general we fold the results
+	   here.  */
+	if (result != -1 && info != NULL && info->si_code == SI_TKILL)
+		info->si_code = SI_USER;
+
+	return result;
+}
+
+/* Return any pending signal or wait for one for the given time.  */
+int __sigwaitinfo(const sigset_t *set, siginfo_t *info)
+{
+	if(SINGLE_THREAD_P)
+		return do_sigwaitinfo(set, info);
+
+	int oldtype = LIBC_CANCEL_ASYNC();
+
+	/* XXX The size argument hopefully will have to be changed to the
+	   real size of the user-level sigset_t.  */
+	int result = do_sigwaitinfo(set, info);
+
+	LIBC_CANCEL_RESET(oldtype);
+
+	return result;
+}
+# else
+#  define __need_NULL
+#  include <stddef.h>
+#  define __NR___rt_sigwaitinfo __NR_rt_sigtimedwait
+static _syscall4(int, __rt_sigwaitinfo, const sigset_t *, set,
+				 siginfo_t *, info, const struct timespec *, timeout,
+				 size_t, setsize);
+
+int attribute_hidden __sigwaitinfo(const sigset_t * set, siginfo_t * info)
+{
+	return __rt_sigwaitinfo(set, info, NULL, _NSIG / 8);
+}
+# endif
+libc_hidden_proto(sigwaitinfo)
+weak_alias (__sigwaitinfo, sigwaitinfo)
+libc_hidden_weak(sigwaitinfo)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/__socketcall.c b/ap/build/uClibc/libc/sysdeps/linux/common/__socketcall.c
new file mode 100644
index 0000000..e49fb21
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/__socketcall.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * __socketcall() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#ifdef __NR_socketcall
+#define __NR___socketcall __NR_socketcall
+int __socketcall(int __call, unsigned long *__args) attribute_hidden;
+_syscall2(int, __socketcall, int, call, unsigned long *, args)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_fcntl.c b/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_fcntl.c
new file mode 100644
index 0000000..6d4c339
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_fcntl.c
@@ -0,0 +1,91 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * __syscall_fcntl() for uClibc
+ *
+ * Copyright (C) 2006 Steven J. Hill <sjhill@realitydiluted.com>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <stdarg.h>
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <sysdep-cancel.h>	/* Must come before <fcntl.h>.  */
+#endif
+#include <fcntl.h>
+#include <bits/wordsize.h>
+
+extern __typeof(fcntl) __libc_fcntl;
+libc_hidden_proto(__libc_fcntl)
+
+int __fcntl_nocancel (int fd, int cmd, ...)
+{
+	va_list ap;
+	void *arg;
+
+	va_start (ap, cmd);
+	arg = va_arg (ap, void *);
+	va_end (ap);
+
+# if __WORDSIZE == 32
+	if (cmd == F_GETLK64 || cmd == F_SETLK64 || cmd == F_SETLKW64) {
+#  if defined __UCLIBC_HAS_LFS__ && defined __NR_fcntl64
+		return INLINE_SYSCALL (fcntl64, 3, fd, cmd, arg);
+#  else
+		__set_errno(ENOSYS);
+		return -1;
+#  endif
+	}
+# endif
+	return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
+}
+libc_hidden_def(__fcntl_nocancel)
+
+int __libc_fcntl (int fd, int cmd, ...)
+{
+	va_list ap;
+	void *arg;
+
+	va_start (ap, cmd);
+	arg = va_arg (ap, void *);
+	va_end (ap);
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	if (SINGLE_THREAD_P || (cmd != F_SETLKW && cmd != F_SETLKW64))
+# if defined __UCLIBC_HAS_LFS__ && defined __NR_fcntl64
+		return INLINE_SYSCALL (fcntl64, 3, fd, cmd, arg);
+# else
+		return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
+# endif
+
+	int oldtype = LIBC_CANCEL_ASYNC ();
+
+# if defined __UCLIBC_HAS_LFS__ && defined __NR_fcntl64
+	int result = INLINE_SYSCALL (fcntl64, 3, fd, cmd, arg);
+# else
+	int result = INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
+# endif
+
+	LIBC_CANCEL_RESET (oldtype);
+
+	return result;
+#else
+# if __WORDSIZE == 32
+	if (cmd == F_GETLK64 || cmd == F_SETLK64 || cmd == F_SETLKW64) {
+#  if defined __UCLIBC_HAS_LFS__ && defined __NR_fcntl64
+		return INLINE_SYSCALL (fcntl64, 3, fd, cmd, arg);
+#  else
+		__set_errno(ENOSYS);
+		return -1;
+#  endif
+	}
+# endif
+	return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
+#endif
+}
+libc_hidden_def(__libc_fcntl)
+
+libc_hidden_proto(fcntl)
+weak_alias(__libc_fcntl,fcntl)
+libc_hidden_weak(fcntl)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_fcntl64.c b/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_fcntl64.c
new file mode 100644
index 0000000..e8782e9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_fcntl64.c
@@ -0,0 +1,30 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * __syscall_fcntl64() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <stdarg.h>
+#include <fcntl.h>
+
+#if defined __UCLIBC_HAS_LFS__ && defined __NR_fcntl64
+
+#define __NR___syscall_fcntl64 __NR_fcntl64
+static __inline__ _syscall3(int, __syscall_fcntl64, int, fd, int, cmd, long, arg)
+int fcntl64(int fd, int cmd, ...)
+{
+	long arg;
+	va_list list;
+
+	va_start(list, cmd);
+	arg = va_arg(list, long);
+	va_end(list);
+
+	return (__syscall_fcntl64(fd, cmd, arg));
+}
+libc_hidden_def(fcntl64)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_rt_sigaction.c b/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_rt_sigaction.c
new file mode 100644
index 0000000..006b38a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_rt_sigaction.c
@@ -0,0 +1,22 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * __syscall_rt_sigaction() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+#ifdef __NR_rt_sigaction
+#include <signal.h>
+
+int __syscall_rt_sigaction (int __signum, const struct sigaction *__act,
+							struct sigaction *__oldact, size_t __size);
+
+#define __NR___syscall_rt_sigaction __NR_rt_sigaction
+_syscall4(int, __syscall_rt_sigaction, int, signum,
+		  const struct sigaction *, act, struct sigaction *, oldact,
+		  size_t, size)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_sigaction.c b/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_sigaction.c
new file mode 100644
index 0000000..ae0f01e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/__syscall_sigaction.c
@@ -0,0 +1,19 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * __syscall_sigaction() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+#ifndef __NR_rt_sigaction
+#define __NR___syscall_sigaction __NR_sigaction
+#include <signal.h>
+int __syscall_sigaction (int __signum, const struct sigaction *__act, struct sigaction *__oldact) attribute_hidden;
+_syscall3(int, __syscall_sigaction, int, signum, const struct sigaction *,
+		  act, struct sigaction *, oldact)
+#endif
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/_exit.c b/ap/build/uClibc/libc/sysdeps/linux/common/_exit.c
new file mode 100644
index 0000000..51117d1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/_exit.c
@@ -0,0 +1,34 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * exit syscall for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <features.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <sysdep.h>
+#endif
+
+
+void attribute_noreturn _exit(int status)
+{
+	/* The loop is added only to keep gcc happy. */
+	while(1)
+	{
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+# ifdef __NR_exit_group
+		INLINE_SYSCALL(exit_group, 1, status);
+# endif
+#endif
+		INLINE_SYSCALL(exit, 1, status);
+	}
+}
+libc_hidden_def(_exit)
+weak_alias(_exit,_Exit)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/access.c b/ap/build/uClibc/libc/sysdeps/linux/common/access.c
new file mode 100644
index 0000000..a075d42
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/access.c
@@ -0,0 +1,12 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * access() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+_syscall2(int, access, const char *, pathname, int, mode)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/acct.c b/ap/build/uClibc/libc/sysdeps/linux/common/acct.c
new file mode 100644
index 0000000..e0a4320
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/acct.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * acct() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
+_syscall1(int, acct, const char *, filename)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/adjtimex.c b/ap/build/uClibc/libc/sysdeps/linux/common/adjtimex.c
new file mode 100644
index 0000000..45cb384
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/adjtimex.c
@@ -0,0 +1,18 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * adjtimex() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/timex.h>
+
+
+_syscall1(int, adjtimex, struct timex *, buf)
+libc_hidden_def(adjtimex)
+#if defined __UCLIBC_NTP_LEGACY__
+strong_alias(adjtimex,ntp_adjtime)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/alarm.c b/ap/build/uClibc/libc/sysdeps/linux/common/alarm.c
new file mode 100644
index 0000000..cfd68fe
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/alarm.c
@@ -0,0 +1,39 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * alarm() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+
+#ifdef __NR_alarm
+_syscall1(unsigned int, alarm, unsigned int, seconds)
+#else
+#include <sys/time.h>
+
+
+unsigned int alarm(unsigned int seconds)
+{
+	struct itimerval old, new;
+	unsigned int retval;
+
+	new.it_value.tv_usec = 0;
+	new.it_interval.tv_sec = 0;
+	new.it_interval.tv_usec = 0;
+	new.it_value.tv_sec = (long int) seconds;
+	if (setitimer(ITIMER_REAL, &new, &old) < 0) {
+		return 0;
+	}
+	retval = old.it_value.tv_sec;
+	if (old.it_value.tv_usec) {
+		++retval;
+	}
+	return retval;
+}
+#endif
+libc_hidden_def(alarm)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/arch_prctl.c b/ap/build/uClibc/libc/sysdeps/linux/common/arch_prctl.c
new file mode 100644
index 0000000..5816f53
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/arch_prctl.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * arch_prctl() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+#ifdef __NR_arch_prctl
+extern int arch_prctl(int code, unsigned long addr);
+_syscall2(int, arch_prctl, int, code, unsigned long, addr)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bdflush.c b/ap/build/uClibc/libc/sysdeps/linux/common/bdflush.c
new file mode 100644
index 0000000..c2a05ed
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bdflush.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * bdflush() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/kdaemon.h>
+
+#ifdef __NR_bdflush
+_syscall2(int, bdflush, int, __func, long int, __data)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/atomic.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/atomic.h
new file mode 100644
index 0000000..6245130
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/atomic.h
@@ -0,0 +1,43 @@
+/* Copyright (C) 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _BITS_ATOMIC_H
+#define _BITS_ATOMIC_H	1
+
+/* We have by default no support for atomic operations.  So define
+   them non-atomic.  If this is a problem somebody will have to come
+   up with real definitions.  */
+
+/* The only basic operation needed is compare and exchange.  */
+#define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
+  ({ __typeof (mem) __gmemp = (mem);				      \
+     __typeof (*mem) __gret = *__gmemp;				      \
+     __typeof (*mem) __gnewval = (newval);			      \
+								      \
+     if (__gret == (oldval))					      \
+       *__gmemp = __gnewval;					      \
+     __gret; })
+
+#define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
+  ({ __typeof (mem) __gmemp = (mem);				      \
+     __typeof (*mem) __gnewval = (newval);			      \
+								      \
+     *__gmemp == (oldval) ? (*__gmemp = __gnewval, 0) : 1; })
+
+#endif	/* bits/atomic.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/byteswap-common.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/byteswap-common.h
new file mode 100644
index 0000000..8586ed0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/byteswap-common.h
@@ -0,0 +1,108 @@
+/* Macros to swap the order of bytes in integer values.
+   Copyright (C) 1997,1998,2000,2001,2002,2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if !defined _BYTESWAP_H && !defined _NETINET_IN_H
+# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
+#endif
+
+#ifndef _BITS_BYTESWAP_H
+#define _BITS_BYTESWAP_H 1
+
+/* Swap bytes in 16 bit value.  */
+#define __bswap_constant_16(x) \
+     ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))
+
+#ifndef __bswap_non_constant_16
+# define __bswap_non_constant_16(x) __bswap_constant_16(x)
+#endif
+#ifdef __GNUC__
+# define __bswap_16(x) \
+    (__extension__							      \
+     ({ unsigned short int __bsv, __bsx = (x);				      \
+	if (__builtin_constant_p (__bsx))				      \
+	  __bsv = __bswap_constant_16 (__bsx);				      \
+	else								      \
+	  __bsv = __bswap_non_constant_16 (__bsx);			      \
+	__bsv; }))
+#else
+static __inline unsigned short int
+__bswap_16 (unsigned short int __bsx)
+{
+  return __bswap_constant_16 (__bsx);
+}
+#endif
+
+/* Swap bytes in 32 bit value.  */
+#define __bswap_constant_32(x) \
+     ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >>  8) |	      \
+      (((x) & 0x0000ff00u) <<  8) | (((x) & 0x000000ffu) << 24))
+
+#ifndef __bswap_non_constant_32
+# define __bswap_non_constant_32(x) __bswap_constant_32(x)
+#endif
+#ifdef __GNUC__
+# define __bswap_32(x) \
+    (__extension__							      \
+     ({ unsigned int __bsv, __bsx = (x);				      \
+	if (__builtin_constant_p (__bsx))				      \
+	  __bsv = __bswap_constant_32 (__bsx);				      \
+	else								      \
+	  __bsv = __bswap_non_constant_32 (__bsx);			      \
+	__bsv; }))
+#else
+static __inline unsigned int
+__bswap_32 (unsigned int __bsx)
+{
+  return __bswap_constant_32 (__bsx);
+}
+#endif
+
+#if defined __GNUC__ && __GNUC__ >= 2
+/* Swap bytes in 64 bit value.  */
+# define __bswap_constant_64(x) \
+     ((((x) & 0xff00000000000000ull) >> 56)				      \
+      | (((x) & 0x00ff000000000000ull) >> 40)				      \
+      | (((x) & 0x0000ff0000000000ull) >> 24)				      \
+      | (((x) & 0x000000ff00000000ull) >> 8)				      \
+      | (((x) & 0x00000000ff000000ull) << 8)				      \
+      | (((x) & 0x0000000000ff0000ull) << 24)				      \
+      | (((x) & 0x000000000000ff00ull) << 40)				      \
+      | (((x) & 0x00000000000000ffull) << 56))
+
+# ifndef __bswap_non_constant_64
+#  define __bswap_non_constant_64(x) \
+     (__extension__							      \
+      ({ union { __extension__ unsigned long long int __ll;		      \
+		 unsigned int __l[2]; } __w, __r;			      \
+	 __w.__ll = (x);						      \
+	 __r.__l[0] = __bswap_non_constant_32 (__w.__l[1]);		      \
+	 __r.__l[1] = __bswap_non_constant_32 (__w.__l[0]);		      \
+	 __r.__ll; }))
+# endif
+# define __bswap_64(x) \
+     (__extension__							      \
+      ({ __extension__ unsigned long long int __ll;			      \
+         if (__builtin_constant_p (x))					      \
+	   __ll = __bswap_constant_64 (x);				      \
+	 else								      \
+	   __ll = __bswap_non_constant_64 (x);				      \
+	 __ll; }))
+#endif
+
+#endif /* _BITS_BYTESWAP_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/byteswap.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/byteswap.h
new file mode 100644
index 0000000..3f02506
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/byteswap.h
@@ -0,0 +1 @@
+#include <bits/byteswap-common.h>
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/cmathcalls.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/cmathcalls.h
new file mode 100644
index 0000000..762c1e3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/cmathcalls.h
@@ -0,0 +1,181 @@
+/* Prototype declarations for complex math functions;
+   helper file for <complex.h>.
+   Copyright (C) 1997, 1998, 2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* NOTE: Because of the special way this file is used by <complex.h>, this
+   file must NOT be protected from multiple inclusion as header files
+   usually are.
+
+   This file provides prototype declarations for the math functions.
+   Most functions are declared using the macro:
+
+   __MATHCALL (NAME, (ARGS...));
+
+   This means there is a function `NAME' returning `double' and a function
+   `NAMEf' returning `float'.  Each place `_Mdouble_' appears in the
+   prototype, that is actually `double' in the prototype for `NAME' and
+   `float' in the prototype for `NAMEf'.  Reentrant variant functions are
+   called `NAME_r' and `NAMEf_r'.
+
+   Functions returning other types like `int' are declared using the macro:
+
+   __MATHDECL (TYPE, NAME, (ARGS...));
+
+   This is just like __MATHCALL but for a function returning `TYPE'
+   instead of `_Mdouble_'.  In all of these cases, there is still
+   both a `NAME' and a `NAMEf' that takes `float' arguments.  */
+
+#ifndef _COMPLEX_H
+#error "Never use <bits/cmathcalls.h> directly; include <complex.h> instead."
+#endif
+
+#define _Mdouble_complex_ _Mdouble_ _Complex
+
+
+/* Trigonometric functions.  */
+
+/* Arc cosine of Z.  */
+__MATHCALL (cacos, (_Mdouble_complex_ __z));
+libm_hidden_proto(cacos)
+/* Arc sine of Z.  */
+__MATHCALL (casin, (_Mdouble_complex_ __z));
+libm_hidden_proto(casin)
+/* Arc tangent of Z.  */
+__MATHCALL (catan, (_Mdouble_complex_ __z));
+libm_hidden_proto(catan)
+
+/* Cosine of Z.  */
+__MATHCALL (ccos, (_Mdouble_complex_ __z));
+libm_hidden_proto(ccos)
+/* Sine of Z.  */
+__MATHCALL (csin, (_Mdouble_complex_ __z));
+libm_hidden_proto(csin)
+/* Tangent of Z.  */
+__MATHCALL (ctan, (_Mdouble_complex_ __z));
+libm_hidden_proto(ctan)
+
+
+/* Hyperbolic functions.  */
+
+/* Hyperbolic arc cosine of Z.  */
+__MATHCALL (cacosh, (_Mdouble_complex_ __z));
+libm_hidden_proto(cacosh)
+/* Hyperbolic arc sine of Z.  */
+__MATHCALL (casinh, (_Mdouble_complex_ __z));
+libm_hidden_proto(casinh)
+/* Hyperbolic arc tangent of Z.  */
+__MATHCALL (catanh, (_Mdouble_complex_ __z));
+libm_hidden_proto(catanh)
+
+/* Hyperbolic cosine of Z.  */
+__MATHCALL (ccosh, (_Mdouble_complex_ __z));
+libm_hidden_proto(ccosh)
+/* Hyperbolic sine of Z.  */
+__MATHCALL (csinh, (_Mdouble_complex_ __z));
+libm_hidden_proto(ccosh)
+/* Hyperbolic tangent of Z.  */
+__MATHCALL (ctanh, (_Mdouble_complex_ __z));
+libm_hidden_proto(ctanh)
+
+
+/* Exponential and logarithmic functions.  */
+
+/* Exponential function of Z.  */
+__MATHCALL (cexp, (_Mdouble_complex_ __z));
+libm_hidden_proto(cexp)
+
+/* Natural logarithm of Z.  */
+__MATHCALL (clog, (_Mdouble_complex_ __z));
+libm_hidden_proto(clog)
+
+#ifdef __USE_GNU
+/* The base 10 logarithm is not defined by the standard but to implement
+   the standard C++ library it is handy.  */
+__MATHCALL (clog10, (_Mdouble_complex_ __z));
+libm_hidden_proto(clog10)
+#endif
+
+/* Power functions.  */
+
+/* Return X to the Y power.  */
+__MATHCALL (cpow, (_Mdouble_complex_ __x, _Mdouble_complex_ __y));
+libm_hidden_proto(cpow)
+
+/* Return the square root of Z.  */
+__MATHCALL (csqrt, (_Mdouble_complex_ __z));
+libm_hidden_proto(csqrt)
+
+
+/* Absolute value, conjugates, and projection.  */
+
+/* Absolute value of Z.  */
+__MATHDECL (_Mdouble_,cabs, (_Mdouble_complex_ __z));
+libm_hidden_proto(cabs)
+
+/* Argument value of Z.  */
+__MATHDECL (_Mdouble_,carg, (_Mdouble_complex_ __z));
+libm_hidden_proto(carg)
+
+/* Complex conjugate of Z.  */
+__MATHCALL (conj, (_Mdouble_complex_ __z));
+libm_hidden_proto(conj)
+
+/* Projection of Z onto the Riemann sphere.  */
+__MATHCALL (cproj, (_Mdouble_complex_ __z));
+libm_hidden_proto(cproj)
+
+
+/* Decomposing complex values.  */
+
+/* Imaginary part of Z.  */
+__MATHDECL (_Mdouble_,cimag, (_Mdouble_complex_ __z));
+libm_hidden_proto(cimag)
+
+/* Real part of Z.  */
+__MATHDECL (_Mdouble_,creal, (_Mdouble_complex_ __z));
+libm_hidden_proto(creal)
+
+
+/* Now some optimized versions.  GCC has handy notations for these
+   functions.  Recent GCC handles these as builtin functions so does
+   not need inlines.  */
+#if defined __GNUC__ && !__GNUC_PREREQ (2, 97) && defined __OPTIMIZE__
+
+/* Imaginary part of Z.  */
+__extern_inline _Mdouble_
+__MATH_PRECNAME(cimag) (_Mdouble_complex_ __z) __THROW
+{
+  return __imag__ __z;
+}
+
+/* Real part of Z.  */
+__extern_inline _Mdouble_
+__MATH_PRECNAME(creal) (_Mdouble_complex_ __z) __THROW
+{
+  return __real__ __z;
+}
+
+/* Complex conjugate of Z.  */
+__extern_inline _Mdouble_complex_
+__MATH_PRECNAME(conj) (_Mdouble_complex_ __z) __THROW
+{
+  return __extension__ ~__z;
+}
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/confname.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/confname.h
new file mode 100644
index 0000000..97ddd47
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/confname.h
@@ -0,0 +1,681 @@
+/* `sysconf', `pathconf', and `confstr' NAME values.  Generic version.
+   Copyright (C) 1993,1995-1998,2000,2001,2003,2004,2007,2009
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _UNISTD_H
+# error "Never use <bits/confname.h> directly; include <unistd.h> instead."
+#endif
+
+/* Values for the NAME argument to `pathconf' and `fpathconf'.  */
+enum
+  {
+    _PC_LINK_MAX,
+#define	_PC_LINK_MAX			_PC_LINK_MAX
+    _PC_MAX_CANON,
+#define	_PC_MAX_CANON			_PC_MAX_CANON
+    _PC_MAX_INPUT,
+#define	_PC_MAX_INPUT			_PC_MAX_INPUT
+    _PC_NAME_MAX,
+#define	_PC_NAME_MAX			_PC_NAME_MAX
+    _PC_PATH_MAX,
+#define	_PC_PATH_MAX			_PC_PATH_MAX
+    _PC_PIPE_BUF,
+#define	_PC_PIPE_BUF			_PC_PIPE_BUF
+    _PC_CHOWN_RESTRICTED,
+#define	_PC_CHOWN_RESTRICTED		_PC_CHOWN_RESTRICTED
+    _PC_NO_TRUNC,
+#define	_PC_NO_TRUNC			_PC_NO_TRUNC
+    _PC_VDISABLE,
+#define _PC_VDISABLE			_PC_VDISABLE
+    _PC_SYNC_IO,
+#define	_PC_SYNC_IO			_PC_SYNC_IO
+    _PC_ASYNC_IO,
+#define	_PC_ASYNC_IO			_PC_ASYNC_IO
+    _PC_PRIO_IO,
+#define	_PC_PRIO_IO			_PC_PRIO_IO
+    _PC_SOCK_MAXBUF,
+#define	_PC_SOCK_MAXBUF			_PC_SOCK_MAXBUF
+    _PC_FILESIZEBITS,
+#define _PC_FILESIZEBITS		_PC_FILESIZEBITS
+    _PC_REC_INCR_XFER_SIZE,
+#define _PC_REC_INCR_XFER_SIZE		_PC_REC_INCR_XFER_SIZE
+    _PC_REC_MAX_XFER_SIZE,
+#define _PC_REC_MAX_XFER_SIZE		_PC_REC_MAX_XFER_SIZE
+    _PC_REC_MIN_XFER_SIZE,
+#define _PC_REC_MIN_XFER_SIZE		_PC_REC_MIN_XFER_SIZE
+    _PC_REC_XFER_ALIGN,
+#define _PC_REC_XFER_ALIGN		_PC_REC_XFER_ALIGN
+    _PC_ALLOC_SIZE_MIN,
+#define _PC_ALLOC_SIZE_MIN		_PC_ALLOC_SIZE_MIN
+    _PC_SYMLINK_MAX,
+#define _PC_SYMLINK_MAX			_PC_SYMLINK_MAX
+    _PC_2_SYMLINKS
+#define _PC_2_SYMLINKS			_PC_2_SYMLINKS
+  };
+
+/* Values for the argument to `sysconf'.  */
+enum
+  {
+    _SC_ARG_MAX,
+#define	_SC_ARG_MAX			_SC_ARG_MAX
+    _SC_CHILD_MAX,
+#define	_SC_CHILD_MAX			_SC_CHILD_MAX
+    _SC_CLK_TCK,
+#define	_SC_CLK_TCK			_SC_CLK_TCK
+    _SC_NGROUPS_MAX,
+#define	_SC_NGROUPS_MAX			_SC_NGROUPS_MAX
+    _SC_OPEN_MAX,
+#define	_SC_OPEN_MAX			_SC_OPEN_MAX
+    _SC_STREAM_MAX,
+#define	_SC_STREAM_MAX			_SC_STREAM_MAX
+    _SC_TZNAME_MAX,
+#define	_SC_TZNAME_MAX			_SC_TZNAME_MAX
+    _SC_JOB_CONTROL,
+#define	_SC_JOB_CONTROL			_SC_JOB_CONTROL
+    _SC_SAVED_IDS,
+#define	_SC_SAVED_IDS			_SC_SAVED_IDS
+    _SC_REALTIME_SIGNALS,
+#define	_SC_REALTIME_SIGNALS		_SC_REALTIME_SIGNALS
+    _SC_PRIORITY_SCHEDULING,
+#define	_SC_PRIORITY_SCHEDULING		_SC_PRIORITY_SCHEDULING
+    _SC_TIMERS,
+#define	_SC_TIMERS			_SC_TIMERS
+    _SC_ASYNCHRONOUS_IO,
+#define	_SC_ASYNCHRONOUS_IO		_SC_ASYNCHRONOUS_IO
+    _SC_PRIORITIZED_IO,
+#define	_SC_PRIORITIZED_IO		_SC_PRIORITIZED_IO
+    _SC_SYNCHRONIZED_IO,
+#define	_SC_SYNCHRONIZED_IO		_SC_SYNCHRONIZED_IO
+    _SC_FSYNC,
+#define	_SC_FSYNC			_SC_FSYNC
+    _SC_MAPPED_FILES,
+#define	_SC_MAPPED_FILES		_SC_MAPPED_FILES
+    _SC_MEMLOCK,
+#define	_SC_MEMLOCK			_SC_MEMLOCK
+    _SC_MEMLOCK_RANGE,
+#define	_SC_MEMLOCK_RANGE		_SC_MEMLOCK_RANGE
+    _SC_MEMORY_PROTECTION,
+#define	_SC_MEMORY_PROTECTION		_SC_MEMORY_PROTECTION
+    _SC_MESSAGE_PASSING,
+#define	_SC_MESSAGE_PASSING		_SC_MESSAGE_PASSING
+    _SC_SEMAPHORES,
+#define	_SC_SEMAPHORES			_SC_SEMAPHORES
+    _SC_SHARED_MEMORY_OBJECTS,
+#define	_SC_SHARED_MEMORY_OBJECTS	_SC_SHARED_MEMORY_OBJECTS
+    _SC_AIO_LISTIO_MAX,
+#define	_SC_AIO_LISTIO_MAX		_SC_AIO_LISTIO_MAX
+    _SC_AIO_MAX,
+#define	_SC_AIO_MAX			_SC_AIO_MAX
+    _SC_AIO_PRIO_DELTA_MAX,
+#define	_SC_AIO_PRIO_DELTA_MAX		_SC_AIO_PRIO_DELTA_MAX
+    _SC_DELAYTIMER_MAX,
+#define	_SC_DELAYTIMER_MAX		_SC_DELAYTIMER_MAX
+    _SC_MQ_OPEN_MAX,
+#define	_SC_MQ_OPEN_MAX			_SC_MQ_OPEN_MAX
+    _SC_MQ_PRIO_MAX,
+#define	_SC_MQ_PRIO_MAX			_SC_MQ_PRIO_MAX
+    _SC_VERSION,
+#define	_SC_VERSION			_SC_VERSION
+    _SC_PAGESIZE,
+#define	_SC_PAGESIZE			_SC_PAGESIZE
+#define	_SC_PAGE_SIZE			_SC_PAGESIZE
+    _SC_RTSIG_MAX,
+#define	_SC_RTSIG_MAX			_SC_RTSIG_MAX
+    _SC_SEM_NSEMS_MAX,
+#define	_SC_SEM_NSEMS_MAX		_SC_SEM_NSEMS_MAX
+    _SC_SEM_VALUE_MAX,
+#define	_SC_SEM_VALUE_MAX		_SC_SEM_VALUE_MAX
+    _SC_SIGQUEUE_MAX,
+#define	_SC_SIGQUEUE_MAX		_SC_SIGQUEUE_MAX
+    _SC_TIMER_MAX,
+#define	_SC_TIMER_MAX			_SC_TIMER_MAX
+
+    /* Values for the argument to `sysconf'
+       corresponding to _POSIX2_* symbols.  */
+    _SC_BC_BASE_MAX,
+#define	_SC_BC_BASE_MAX			_SC_BC_BASE_MAX
+    _SC_BC_DIM_MAX,
+#define	_SC_BC_DIM_MAX			_SC_BC_DIM_MAX
+    _SC_BC_SCALE_MAX,
+#define	_SC_BC_SCALE_MAX		_SC_BC_SCALE_MAX
+    _SC_BC_STRING_MAX,
+#define	_SC_BC_STRING_MAX		_SC_BC_STRING_MAX
+    _SC_COLL_WEIGHTS_MAX,
+#define	_SC_COLL_WEIGHTS_MAX		_SC_COLL_WEIGHTS_MAX
+    _SC_EQUIV_CLASS_MAX,
+#define	_SC_EQUIV_CLASS_MAX		_SC_EQUIV_CLASS_MAX
+    _SC_EXPR_NEST_MAX,
+#define	_SC_EXPR_NEST_MAX		_SC_EXPR_NEST_MAX
+    _SC_LINE_MAX,
+#define	_SC_LINE_MAX			_SC_LINE_MAX
+    _SC_RE_DUP_MAX,
+#define	_SC_RE_DUP_MAX			_SC_RE_DUP_MAX
+    _SC_CHARCLASS_NAME_MAX,
+#define	_SC_CHARCLASS_NAME_MAX		_SC_CHARCLASS_NAME_MAX
+
+    _SC_2_VERSION,
+#define	_SC_2_VERSION			_SC_2_VERSION
+    _SC_2_C_BIND,
+#define	_SC_2_C_BIND			_SC_2_C_BIND
+    _SC_2_C_DEV,
+#define	_SC_2_C_DEV			_SC_2_C_DEV
+    _SC_2_FORT_DEV,
+#define	_SC_2_FORT_DEV			_SC_2_FORT_DEV
+    _SC_2_FORT_RUN,
+#define	_SC_2_FORT_RUN			_SC_2_FORT_RUN
+    _SC_2_SW_DEV,
+#define	_SC_2_SW_DEV			_SC_2_SW_DEV
+    _SC_2_LOCALEDEF,
+#define	_SC_2_LOCALEDEF			_SC_2_LOCALEDEF
+
+    _SC_PII,
+#define	_SC_PII				_SC_PII
+    _SC_PII_XTI,
+#define	_SC_PII_XTI			_SC_PII_XTI
+    _SC_PII_SOCKET,
+#define	_SC_PII_SOCKET			_SC_PII_SOCKET
+    _SC_PII_INTERNET,
+#define	_SC_PII_INTERNET		_SC_PII_INTERNET
+    _SC_PII_OSI,
+#define	_SC_PII_OSI			_SC_PII_OSI
+    _SC_POLL,
+#define	_SC_POLL			_SC_POLL
+    _SC_SELECT,
+#define	_SC_SELECT			_SC_SELECT
+    _SC_UIO_MAXIOV,
+#define	_SC_UIO_MAXIOV			_SC_UIO_MAXIOV
+    _SC_IOV_MAX = _SC_UIO_MAXIOV,
+#define _SC_IOV_MAX			_SC_IOV_MAX
+    _SC_PII_INTERNET_STREAM,
+#define	_SC_PII_INTERNET_STREAM		_SC_PII_INTERNET_STREAM
+    _SC_PII_INTERNET_DGRAM,
+#define	_SC_PII_INTERNET_DGRAM		_SC_PII_INTERNET_DGRAM
+    _SC_PII_OSI_COTS,
+#define	_SC_PII_OSI_COTS		_SC_PII_OSI_COTS
+    _SC_PII_OSI_CLTS,
+#define	_SC_PII_OSI_CLTS		_SC_PII_OSI_CLTS
+    _SC_PII_OSI_M,
+#define	_SC_PII_OSI_M			_SC_PII_OSI_M
+    _SC_T_IOV_MAX,
+#define	_SC_T_IOV_MAX			_SC_T_IOV_MAX
+
+    /* Values according to POSIX 1003.1c (POSIX threads).  */
+    _SC_THREADS,
+#define	_SC_THREADS			_SC_THREADS
+    _SC_THREAD_SAFE_FUNCTIONS,
+#define _SC_THREAD_SAFE_FUNCTIONS	_SC_THREAD_SAFE_FUNCTIONS
+    _SC_GETGR_R_SIZE_MAX,
+#define	_SC_GETGR_R_SIZE_MAX		_SC_GETGR_R_SIZE_MAX
+    _SC_GETPW_R_SIZE_MAX,
+#define	_SC_GETPW_R_SIZE_MAX		_SC_GETPW_R_SIZE_MAX
+    _SC_LOGIN_NAME_MAX,
+#define	_SC_LOGIN_NAME_MAX		_SC_LOGIN_NAME_MAX
+    _SC_TTY_NAME_MAX,
+#define	_SC_TTY_NAME_MAX		_SC_TTY_NAME_MAX
+    _SC_THREAD_DESTRUCTOR_ITERATIONS,
+#define	_SC_THREAD_DESTRUCTOR_ITERATIONS _SC_THREAD_DESTRUCTOR_ITERATIONS
+    _SC_THREAD_KEYS_MAX,
+#define	_SC_THREAD_KEYS_MAX		_SC_THREAD_KEYS_MAX
+    _SC_THREAD_STACK_MIN,
+#define	_SC_THREAD_STACK_MIN		_SC_THREAD_STACK_MIN
+    _SC_THREAD_THREADS_MAX,
+#define	_SC_THREAD_THREADS_MAX		_SC_THREAD_THREADS_MAX
+    _SC_THREAD_ATTR_STACKADDR,
+#define	_SC_THREAD_ATTR_STACKADDR	_SC_THREAD_ATTR_STACKADDR
+    _SC_THREAD_ATTR_STACKSIZE,
+#define	_SC_THREAD_ATTR_STACKSIZE	_SC_THREAD_ATTR_STACKSIZE
+    _SC_THREAD_PRIORITY_SCHEDULING,
+#define	_SC_THREAD_PRIORITY_SCHEDULING	_SC_THREAD_PRIORITY_SCHEDULING
+    _SC_THREAD_PRIO_INHERIT,
+#define	_SC_THREAD_PRIO_INHERIT		_SC_THREAD_PRIO_INHERIT
+    _SC_THREAD_PRIO_PROTECT,
+#define	_SC_THREAD_PRIO_PROTECT		_SC_THREAD_PRIO_PROTECT
+    _SC_THREAD_PROCESS_SHARED,
+#define	_SC_THREAD_PROCESS_SHARED	_SC_THREAD_PROCESS_SHARED
+
+    _SC_NPROCESSORS_CONF,
+#define _SC_NPROCESSORS_CONF		_SC_NPROCESSORS_CONF
+    _SC_NPROCESSORS_ONLN,
+#define _SC_NPROCESSORS_ONLN		_SC_NPROCESSORS_ONLN
+    _SC_PHYS_PAGES,
+#define _SC_PHYS_PAGES			_SC_PHYS_PAGES
+    _SC_AVPHYS_PAGES,
+#define _SC_AVPHYS_PAGES		_SC_AVPHYS_PAGES
+    _SC_ATEXIT_MAX,
+#define _SC_ATEXIT_MAX			_SC_ATEXIT_MAX
+    _SC_PASS_MAX,
+#define _SC_PASS_MAX			_SC_PASS_MAX
+
+    _SC_XOPEN_VERSION,
+#define _SC_XOPEN_VERSION		_SC_XOPEN_VERSION
+    _SC_XOPEN_XCU_VERSION,
+#define _SC_XOPEN_XCU_VERSION		_SC_XOPEN_XCU_VERSION
+    _SC_XOPEN_UNIX,
+#define _SC_XOPEN_UNIX			_SC_XOPEN_UNIX
+    _SC_XOPEN_CRYPT,
+#define _SC_XOPEN_CRYPT			_SC_XOPEN_CRYPT
+    _SC_XOPEN_ENH_I18N,
+#define _SC_XOPEN_ENH_I18N		_SC_XOPEN_ENH_I18N
+    _SC_XOPEN_SHM,
+#define _SC_XOPEN_SHM			_SC_XOPEN_SHM
+
+    _SC_2_CHAR_TERM,
+#define _SC_2_CHAR_TERM			_SC_2_CHAR_TERM
+    _SC_2_C_VERSION,
+#define _SC_2_C_VERSION			_SC_2_C_VERSION
+    _SC_2_UPE,
+#define _SC_2_UPE			_SC_2_UPE
+
+    _SC_XOPEN_XPG2,
+#define _SC_XOPEN_XPG2			_SC_XOPEN_XPG2
+    _SC_XOPEN_XPG3,
+#define _SC_XOPEN_XPG3			_SC_XOPEN_XPG3
+    _SC_XOPEN_XPG4,
+#define _SC_XOPEN_XPG4			_SC_XOPEN_XPG4
+
+    _SC_CHAR_BIT,
+#define	_SC_CHAR_BIT			_SC_CHAR_BIT
+    _SC_CHAR_MAX,
+#define	_SC_CHAR_MAX			_SC_CHAR_MAX
+    _SC_CHAR_MIN,
+#define	_SC_CHAR_MIN			_SC_CHAR_MIN
+    _SC_INT_MAX,
+#define	_SC_INT_MAX			_SC_INT_MAX
+    _SC_INT_MIN,
+#define	_SC_INT_MIN			_SC_INT_MIN
+    _SC_LONG_BIT,
+#define	_SC_LONG_BIT			_SC_LONG_BIT
+    _SC_WORD_BIT,
+#define	_SC_WORD_BIT			_SC_WORD_BIT
+    _SC_MB_LEN_MAX,
+#define	_SC_MB_LEN_MAX			_SC_MB_LEN_MAX
+    _SC_NZERO,
+#define	_SC_NZERO			_SC_NZERO
+    _SC_SSIZE_MAX,
+#define	_SC_SSIZE_MAX			_SC_SSIZE_MAX
+    _SC_SCHAR_MAX,
+#define	_SC_SCHAR_MAX			_SC_SCHAR_MAX
+    _SC_SCHAR_MIN,
+#define	_SC_SCHAR_MIN			_SC_SCHAR_MIN
+    _SC_SHRT_MAX,
+#define	_SC_SHRT_MAX			_SC_SHRT_MAX
+    _SC_SHRT_MIN,
+#define	_SC_SHRT_MIN			_SC_SHRT_MIN
+    _SC_UCHAR_MAX,
+#define	_SC_UCHAR_MAX			_SC_UCHAR_MAX
+    _SC_UINT_MAX,
+#define	_SC_UINT_MAX			_SC_UINT_MAX
+    _SC_ULONG_MAX,
+#define	_SC_ULONG_MAX			_SC_ULONG_MAX
+    _SC_USHRT_MAX,
+#define	_SC_USHRT_MAX			_SC_USHRT_MAX
+
+    _SC_NL_ARGMAX,
+#define	_SC_NL_ARGMAX			_SC_NL_ARGMAX
+    _SC_NL_LANGMAX,
+#define	_SC_NL_LANGMAX			_SC_NL_LANGMAX
+    _SC_NL_MSGMAX,
+#define	_SC_NL_MSGMAX			_SC_NL_MSGMAX
+    _SC_NL_NMAX,
+#define	_SC_NL_NMAX			_SC_NL_NMAX
+    _SC_NL_SETMAX,
+#define	_SC_NL_SETMAX			_SC_NL_SETMAX
+    _SC_NL_TEXTMAX,
+#define	_SC_NL_TEXTMAX			_SC_NL_TEXTMAX
+
+    _SC_XBS5_ILP32_OFF32,
+#define _SC_XBS5_ILP32_OFF32		_SC_XBS5_ILP32_OFF32
+    _SC_XBS5_ILP32_OFFBIG,
+#define _SC_XBS5_ILP32_OFFBIG		_SC_XBS5_ILP32_OFFBIG
+    _SC_XBS5_LP64_OFF64,
+#define _SC_XBS5_LP64_OFF64		_SC_XBS5_LP64_OFF64
+    _SC_XBS5_LPBIG_OFFBIG,
+#define _SC_XBS5_LPBIG_OFFBIG		_SC_XBS5_LPBIG_OFFBIG
+
+    _SC_XOPEN_LEGACY,
+#define _SC_XOPEN_LEGACY		_SC_XOPEN_LEGACY
+    _SC_XOPEN_REALTIME,
+#define _SC_XOPEN_REALTIME		_SC_XOPEN_REALTIME
+    _SC_XOPEN_REALTIME_THREADS,
+#define _SC_XOPEN_REALTIME_THREADS	_SC_XOPEN_REALTIME_THREADS
+
+    _SC_ADVISORY_INFO,
+#define _SC_ADVISORY_INFO		_SC_ADVISORY_INFO
+    _SC_BARRIERS,
+#define _SC_BARRIERS			_SC_BARRIERS
+    _SC_BASE,
+#define _SC_BASE			_SC_BASE
+    _SC_C_LANG_SUPPORT,
+#define _SC_C_LANG_SUPPORT		_SC_C_LANG_SUPPORT
+    _SC_C_LANG_SUPPORT_R,
+#define _SC_C_LANG_SUPPORT_R		_SC_C_LANG_SUPPORT_R
+    _SC_CLOCK_SELECTION,
+#define _SC_CLOCK_SELECTION		_SC_CLOCK_SELECTION
+    _SC_CPUTIME,
+#define _SC_CPUTIME			_SC_CPUTIME
+    _SC_THREAD_CPUTIME,
+#define _SC_THREAD_CPUTIME		_SC_THREAD_CPUTIME
+    _SC_DEVICE_IO,
+#define _SC_DEVICE_IO			_SC_DEVICE_IO
+    _SC_DEVICE_SPECIFIC,
+#define _SC_DEVICE_SPECIFIC		_SC_DEVICE_SPECIFIC
+    _SC_DEVICE_SPECIFIC_R,
+#define _SC_DEVICE_SPECIFIC_R		_SC_DEVICE_SPECIFIC_R
+    _SC_FD_MGMT,
+#define _SC_FD_MGMT			_SC_FD_MGMT
+    _SC_FIFO,
+#define _SC_FIFO			_SC_FIFO
+    _SC_PIPE,
+#define _SC_PIPE			_SC_PIPE
+    _SC_FILE_ATTRIBUTES,
+#define _SC_FILE_ATTRIBUTES		_SC_FILE_ATTRIBUTES
+    _SC_FILE_LOCKING,
+#define _SC_FILE_LOCKING		_SC_FILE_LOCKING
+    _SC_FILE_SYSTEM,
+#define _SC_FILE_SYSTEM			_SC_FILE_SYSTEM
+    _SC_MONOTONIC_CLOCK,
+#define _SC_MONOTONIC_CLOCK		_SC_MONOTONIC_CLOCK
+    _SC_MULTI_PROCESS,
+#define _SC_MULTI_PROCESS		_SC_MULTI_PROCESS
+    _SC_SINGLE_PROCESS,
+#define _SC_SINGLE_PROCESS		_SC_SINGLE_PROCESS
+    _SC_NETWORKING,
+#define _SC_NETWORKING			_SC_NETWORKING
+    _SC_READER_WRITER_LOCKS,
+#define _SC_READER_WRITER_LOCKS		_SC_READER_WRITER_LOCKS
+    _SC_SPIN_LOCKS,
+#define _SC_SPIN_LOCKS			_SC_SPIN_LOCKS
+    _SC_REGEXP,
+#define _SC_REGEXP			_SC_REGEXP
+    _SC_REGEX_VERSION,
+#define _SC_REGEX_VERSION		_SC_REGEX_VERSION
+    _SC_SHELL,
+#define _SC_SHELL			_SC_SHELL
+    _SC_SIGNALS,
+#define _SC_SIGNALS			_SC_SIGNALS
+    _SC_SPAWN,
+#define _SC_SPAWN			_SC_SPAWN
+    _SC_SPORADIC_SERVER,
+#define _SC_SPORADIC_SERVER		_SC_SPORADIC_SERVER
+    _SC_THREAD_SPORADIC_SERVER,
+#define _SC_THREAD_SPORADIC_SERVER	_SC_THREAD_SPORADIC_SERVER
+    _SC_SYSTEM_DATABASE,
+#define _SC_SYSTEM_DATABASE		_SC_SYSTEM_DATABASE
+    _SC_SYSTEM_DATABASE_R,
+#define _SC_SYSTEM_DATABASE_R		_SC_SYSTEM_DATABASE_R
+    _SC_TIMEOUTS,
+#define _SC_TIMEOUTS			_SC_TIMEOUTS
+    _SC_TYPED_MEMORY_OBJECTS,
+#define _SC_TYPED_MEMORY_OBJECTS	_SC_TYPED_MEMORY_OBJECTS
+    _SC_USER_GROUPS,
+#define _SC_USER_GROUPS			_SC_USER_GROUPS
+    _SC_USER_GROUPS_R,
+#define _SC_USER_GROUPS_R		_SC_USER_GROUPS_R
+    _SC_2_PBS,
+#define _SC_2_PBS			_SC_2_PBS
+    _SC_2_PBS_ACCOUNTING,
+#define _SC_2_PBS_ACCOUNTING		_SC_2_PBS_ACCOUNTING
+    _SC_2_PBS_LOCATE,
+#define _SC_2_PBS_LOCATE		_SC_2_PBS_LOCATE
+    _SC_2_PBS_MESSAGE,
+#define _SC_2_PBS_MESSAGE		_SC_2_PBS_MESSAGE
+    _SC_2_PBS_TRACK,
+#define _SC_2_PBS_TRACK			_SC_2_PBS_TRACK
+    _SC_SYMLOOP_MAX,
+#define _SC_SYMLOOP_MAX			_SC_SYMLOOP_MAX
+    _SC_STREAMS,
+#define _SC_STREAMS			_SC_STREAMS
+    _SC_2_PBS_CHECKPOINT,
+#define _SC_2_PBS_CHECKPOINT		_SC_2_PBS_CHECKPOINT
+
+    _SC_V6_ILP32_OFF32,
+#define _SC_V6_ILP32_OFF32		_SC_V6_ILP32_OFF32
+    _SC_V6_ILP32_OFFBIG,
+#define _SC_V6_ILP32_OFFBIG		_SC_V6_ILP32_OFFBIG
+    _SC_V6_LP64_OFF64,
+#define _SC_V6_LP64_OFF64		_SC_V6_LP64_OFF64
+    _SC_V6_LPBIG_OFFBIG,
+#define _SC_V6_LPBIG_OFFBIG		_SC_V6_LPBIG_OFFBIG
+
+    _SC_HOST_NAME_MAX,
+#define _SC_HOST_NAME_MAX		_SC_HOST_NAME_MAX
+    _SC_TRACE,
+#define _SC_TRACE			_SC_TRACE
+    _SC_TRACE_EVENT_FILTER,
+#define _SC_TRACE_EVENT_FILTER		_SC_TRACE_EVENT_FILTER
+    _SC_TRACE_INHERIT,
+#define _SC_TRACE_INHERIT		_SC_TRACE_INHERIT
+    _SC_TRACE_LOG,
+#define _SC_TRACE_LOG			_SC_TRACE_LOG
+
+    _SC_LEVEL1_ICACHE_SIZE,
+#define _SC_LEVEL1_ICACHE_SIZE		_SC_LEVEL1_ICACHE_SIZE
+    _SC_LEVEL1_ICACHE_ASSOC,
+#define _SC_LEVEL1_ICACHE_ASSOC		_SC_LEVEL1_ICACHE_ASSOC
+    _SC_LEVEL1_ICACHE_LINESIZE,
+#define _SC_LEVEL1_ICACHE_LINESIZE	_SC_LEVEL1_ICACHE_LINESIZE
+    _SC_LEVEL1_DCACHE_SIZE,
+#define _SC_LEVEL1_DCACHE_SIZE		_SC_LEVEL1_DCACHE_SIZE
+    _SC_LEVEL1_DCACHE_ASSOC,
+#define _SC_LEVEL1_DCACHE_ASSOC		_SC_LEVEL1_DCACHE_ASSOC
+    _SC_LEVEL1_DCACHE_LINESIZE,
+#define _SC_LEVEL1_DCACHE_LINESIZE	_SC_LEVEL1_DCACHE_LINESIZE
+    _SC_LEVEL2_CACHE_SIZE,
+#define _SC_LEVEL2_CACHE_SIZE		_SC_LEVEL2_CACHE_SIZE
+    _SC_LEVEL2_CACHE_ASSOC,
+#define _SC_LEVEL2_CACHE_ASSOC		_SC_LEVEL2_CACHE_ASSOC
+    _SC_LEVEL2_CACHE_LINESIZE,
+#define _SC_LEVEL2_CACHE_LINESIZE	_SC_LEVEL2_CACHE_LINESIZE
+    _SC_LEVEL3_CACHE_SIZE,
+#define _SC_LEVEL3_CACHE_SIZE		_SC_LEVEL3_CACHE_SIZE
+    _SC_LEVEL3_CACHE_ASSOC,
+#define _SC_LEVEL3_CACHE_ASSOC		_SC_LEVEL3_CACHE_ASSOC
+    _SC_LEVEL3_CACHE_LINESIZE,
+#define _SC_LEVEL3_CACHE_LINESIZE	_SC_LEVEL3_CACHE_LINESIZE
+    _SC_LEVEL4_CACHE_SIZE,
+#define _SC_LEVEL4_CACHE_SIZE		_SC_LEVEL4_CACHE_SIZE
+    _SC_LEVEL4_CACHE_ASSOC,
+#define _SC_LEVEL4_CACHE_ASSOC		_SC_LEVEL4_CACHE_ASSOC
+    _SC_LEVEL4_CACHE_LINESIZE,
+#define _SC_LEVEL4_CACHE_LINESIZE	_SC_LEVEL4_CACHE_LINESIZE
+    /* Leave room here, maybe we need a few more cache levels some day.  */
+
+    _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,
+#define _SC_IPV6			_SC_IPV6
+    _SC_RAW_SOCKETS,
+#define _SC_RAW_SOCKETS			_SC_RAW_SOCKETS
+
+    _SC_V7_ILP32_OFF32,
+#define _SC_V7_ILP32_OFF32		_SC_V7_ILP32_OFF32
+    _SC_V7_ILP32_OFFBIG,
+#define _SC_V7_ILP32_OFFBIG		_SC_V7_ILP32_OFFBIG
+    _SC_V7_LP64_OFF64,
+#define _SC_V7_LP64_OFF64		_SC_V7_LP64_OFF64
+    _SC_V7_LPBIG_OFFBIG,
+#define _SC_V7_LPBIG_OFFBIG		_SC_V7_LPBIG_OFFBIG
+
+    _SC_SS_REPL_MAX,
+#define _SC_SS_REPL_MAX			_SC_SS_REPL_MAX
+
+    _SC_TRACE_EVENT_NAME_MAX,
+#define _SC_TRACE_EVENT_NAME_MAX	_SC_TRACE_EVENT_NAME_MAX
+    _SC_TRACE_NAME_MAX,
+#define _SC_TRACE_NAME_MAX		_SC_TRACE_NAME_MAX
+    _SC_TRACE_SYS_MAX,
+#define _SC_TRACE_SYS_MAX		_SC_TRACE_SYS_MAX
+    _SC_TRACE_USER_EVENT_MAX,
+#define _SC_TRACE_USER_EVENT_MAX	_SC_TRACE_USER_EVENT_MAX
+
+    _SC_XOPEN_STREAMS,
+#define _SC_XOPEN_STREAMS		_SC_XOPEN_STREAMS
+
+    _SC_THREAD_ROBUST_PRIO_INHERIT,
+#define _SC_THREAD_ROBUST_PRIO_INHERIT	_SC_THREAD_ROBUST_PRIO_INHERIT
+    _SC_THREAD_ROBUST_PRIO_PROTECT
+#define _SC_THREAD_ROBUST_PRIO_PROTECT	_SC_THREAD_ROBUST_PRIO_PROTECT
+  };
+
+/* Values for the NAME argument to `confstr'.  */
+enum
+  {
+    _CS_PATH,			/* The default search path.  */
+#define _CS_PATH		_CS_PATH
+
+    _CS_V6_WIDTH_RESTRICTED_ENVS,
+#define _CS_V6_WIDTH_RESTRICTED_ENVS	_CS_V6_WIDTH_RESTRICTED_ENVS
+#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS	_CS_V6_WIDTH_RESTRICTED_ENVS
+
+    _CS_GNU_LIBC_VERSION,
+#define _CS_GNU_LIBC_VERSION	_CS_GNU_LIBC_VERSION
+    _CS_GNU_LIBPTHREAD_VERSION,
+#define _CS_GNU_LIBPTHREAD_VERSION	_CS_GNU_LIBPTHREAD_VERSION
+
+    _CS_V5_WIDTH_RESTRICTED_ENVS,
+#define _CS_V5_WIDTH_RESTRICTED_ENVS	_CS_V5_WIDTH_RESTRICTED_ENVS
+#define _CS_POSIX_V5_WIDTH_RESTRICTED_ENVS	_CS_V5_WIDTH_RESTRICTED_ENVS
+
+    _CS_V7_WIDTH_RESTRICTED_ENVS,
+#define _CS_V7_WIDTH_RESTRICTED_ENVS	_CS_V7_WIDTH_RESTRICTED_ENVS
+#define _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS	_CS_V7_WIDTH_RESTRICTED_ENVS
+
+# if (defined __USE_FILE_OFFSET64 || defined __USE_LARGEFILE64 \
+     || defined __USE_LARGEFILE)
+    _CS_LFS_CFLAGS = 1000,
+#define _CS_LFS_CFLAGS	_CS_LFS_CFLAGS
+    _CS_LFS_LDFLAGS,
+#define _CS_LFS_LDFLAGS	_CS_LFS_LDFLAGS
+    _CS_LFS_LIBS,
+#define _CS_LFS_LIBS		_CS_LFS_LIBS
+    _CS_LFS_LINTFLAGS,
+#define _CS_LFS_LINTFLAGS	_CS_LFS_LINTFLAGS
+    _CS_LFS64_CFLAGS,
+#define _CS_LFS64_CFLAGS	_CS_LFS64_CFLAGS
+    _CS_LFS64_LDFLAGS,
+#define _CS_LFS64_LDFLAGS	_CS_LFS64_LDFLAGS
+    _CS_LFS64_LIBS,
+#define _CS_LFS64_LIBS	_CS_LFS64_LIBS
+    _CS_LFS64_LINTFLAGS,
+#define _CS_LFS64_LINTFLAGS	_CS_LFS64_LINTFLAGS
+# endif
+
+# ifdef __USE_UNIX98
+    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
+#define _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS
+    _CS_XBS5_ILP32_OFF32_LDFLAGS,
+#define _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS
+    _CS_XBS5_ILP32_OFF32_LIBS,
+#define _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LIBS
+    _CS_XBS5_ILP32_OFF32_LINTFLAGS,
+#define _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFF32_LINTFLAGS
+    _CS_XBS5_ILP32_OFFBIG_CFLAGS,
+#define _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS
+    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,
+#define _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS
+    _CS_XBS5_ILP32_OFFBIG_LIBS,
+#define _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LIBS
+    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
+#define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
+    _CS_XBS5_LP64_OFF64_CFLAGS,
+#define _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_CFLAGS
+    _CS_XBS5_LP64_OFF64_LDFLAGS,
+#define _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS
+    _CS_XBS5_LP64_OFF64_LIBS,
+#define _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LIBS
+    _CS_XBS5_LP64_OFF64_LINTFLAGS,
+#define _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LP64_OFF64_LINTFLAGS
+    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,
+#define _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS
+    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
+#define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
+    _CS_XBS5_LPBIG_OFFBIG_LIBS,
+#define _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LIBS
+    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,
+#define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
+# endif
+
+# ifdef __USE_XOPEN2K
+    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,
+#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V6_ILP32_OFF32_CFLAGS
+    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,
+#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
+    _CS_POSIX_V6_ILP32_OFF32_LIBS,
+#define _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V6_ILP32_OFF32_LIBS
+    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,
+#define _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
+    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,
+#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
+    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,
+#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
+    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,
+#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V6_ILP32_OFFBIG_LIBS
+    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,
+#define _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
+    _CS_POSIX_V6_LP64_OFF64_CFLAGS,
+#define _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V6_LP64_OFF64_CFLAGS
+    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,
+#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V6_LP64_OFF64_LDFLAGS
+    _CS_POSIX_V6_LP64_OFF64_LIBS,
+#define _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V6_LP64_OFF64_LIBS
+    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,
+#define _CS_POSIX_V6_LP64_OFF64_LINTFLAGS _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
+    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,
+#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
+    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,
+#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
+    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,
+#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
+    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,
+#define _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
+# endif
+
+# ifdef __USE_XOPEN2K8
+    _CS_POSIX_V7_ILP32_OFF32_CFLAGS,
+#define _CS_POSIX_V7_ILP32_OFF32_CFLAGS _CS_POSIX_V7_ILP32_OFF32_CFLAGS
+    _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,
+#define _CS_POSIX_V7_ILP32_OFF32_LDFLAGS _CS_POSIX_V7_ILP32_OFF32_LDFLAGS
+    _CS_POSIX_V7_ILP32_OFF32_LIBS,
+#define _CS_POSIX_V7_ILP32_OFF32_LIBS _CS_POSIX_V7_ILP32_OFF32_LIBS
+    _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,
+#define _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS
+    _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,
+#define _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS
+    _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,
+#define _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS
+    _CS_POSIX_V7_ILP32_OFFBIG_LIBS,
+#define _CS_POSIX_V7_ILP32_OFFBIG_LIBS _CS_POSIX_V7_ILP32_OFFBIG_LIBS
+    _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,
+#define _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS
+    _CS_POSIX_V7_LP64_OFF64_CFLAGS,
+#define _CS_POSIX_V7_LP64_OFF64_CFLAGS _CS_POSIX_V7_LP64_OFF64_CFLAGS
+    _CS_POSIX_V7_LP64_OFF64_LDFLAGS,
+#define _CS_POSIX_V7_LP64_OFF64_LDFLAGS _CS_POSIX_V7_LP64_OFF64_LDFLAGS
+    _CS_POSIX_V7_LP64_OFF64_LIBS,
+#define _CS_POSIX_V7_LP64_OFF64_LIBS _CS_POSIX_V7_LP64_OFF64_LIBS
+    _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,
+#define _CS_POSIX_V7_LP64_OFF64_LINTFLAGS _CS_POSIX_V7_LP64_OFF64_LINTFLAGS
+    _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,
+#define _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS
+    _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,
+#define _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS
+    _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,
+#define _CS_POSIX_V7_LPBIG_OFFBIG_LIBS _CS_POSIX_V7_LPBIG_OFFBIG_LIBS
+    _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS
+#define _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS
+# endif
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/dirent.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/dirent.h
new file mode 100644
index 0000000..76794b0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/dirent.h
@@ -0,0 +1,53 @@
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _DIRENT_H
+# error "Never use <bits/dirent.h> directly; include <dirent.h> instead."
+#endif
+
+struct dirent
+  {
+#ifndef __USE_FILE_OFFSET64
+    __ino_t d_ino;
+    __off_t d_off;
+#else
+    __ino64_t d_ino;
+    __off64_t d_off;
+#endif
+    unsigned short int d_reclen;
+    unsigned char d_type;
+    char d_name[256];		/* We must not include limits.h! */
+  };
+
+#ifdef __USE_LARGEFILE64
+struct dirent64
+  {
+    __ino64_t d_ino;
+    __off64_t d_off;
+    unsigned short int d_reclen;
+    unsigned char d_type;
+    char d_name[256];		/* We must not include limits.h! */
+  };
+#endif
+
+#define d_fileno	d_ino	/* Backwards compatibility.  */
+
+#undef  _DIRENT_HAVE_D_NAMLEN
+#define _DIRENT_HAVE_D_RECLEN
+#define _DIRENT_HAVE_D_OFF
+#define _DIRENT_HAVE_D_TYPE
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/dlfcn.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/dlfcn.h
new file mode 100644
index 0000000..47b42ad
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/dlfcn.h
@@ -0,0 +1,67 @@
+/* System dependent definitions for run-time dynamic loading.
+   Copyright (C) 1996-2001, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _DLFCN_H
+# error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead."
+#endif
+
+/* The MODE argument to `dlopen' contains one of the following: */
+#define RTLD_LAZY	0x00001	/* Lazy function call binding.  */
+#define RTLD_NOW	0x00002	/* Immediate function call binding.  */
+#define RTLD_BINDING_MASK   0x3	/* Mask of binding time value.  */
+#define RTLD_NOLOAD	0x00004	/* Do not load the object.  */
+#if 0 /* uClibc doesnt support these */
+#define RTLD_DEEPBIND	0x00008	/* Use deep binding.  */
+#endif
+
+/* If the following bit is set in the MODE argument to `dlopen',
+   the symbols of the loaded object and its dependencies are made
+   visible as if the object were linked directly into the program.  */
+#define RTLD_GLOBAL	0x00100
+
+/* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL.
+   The implementation does this by default and so we can define the
+   value to zero.  */
+#define RTLD_LOCAL	0
+
+/* Do not delete object when closed.  */
+#define RTLD_NODELETE	0x01000
+
+#if 0 /*def __USE_GNU*/
+/* To support profiling of shared objects it is a good idea to call
+   the function found using `dlsym' using the following macro since
+   these calls do not use the PLT.  But this would mean the dynamic
+   loader has no chance to find out when the function is called.  The
+   macro applies the necessary magic so that profiling is possible.
+   Rewrite
+	foo = (*fctp) (arg1, arg2);
+   into
+        foo = DL_CALL_FCT (fctp, (arg1, arg2));
+*/
+# define DL_CALL_FCT(fctp, args) \
+  (_dl_mcount_wrapper_check ((void *) (fctp)), (*(fctp)) args)
+
+__BEGIN_DECLS
+
+/* This function calls the profiling functions.  */
+extern void _dl_mcount_wrapper_check (void *__selfpc) __THROW;
+
+__END_DECLS
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/elfclass.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/elfclass.h
new file mode 100644
index 0000000..180227d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/elfclass.h
@@ -0,0 +1,14 @@
+/* This file specifies the native word size of the machine, which indicates
+   the ELF file class used for executables and shared objects on this
+   machine.  */
+
+#ifndef _LINK_H
+# error "Never use <bits/elfclass.h> directly; include <link.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+#define __ELF_NATIVE_CLASS __WORDSIZE
+
+/* The entries in the .hash table always have a size of 32 bits.  */
+typedef uint32_t Elf_Symndx;
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/endian.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/endian.h
new file mode 100644
index 0000000..0086a1c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/endian.h
@@ -0,0 +1,18 @@
+/* This file should define __BYTE_ORDER as appropriate for the machine
+   in question.  See string/endian.h for how to define it.
+
+   If only the stub bits/endian.h applies to a particular configuration,
+   bytesex.h is generated by running a program on the host machine.
+   So if cross-compiling to a machine with a different byte order,
+   the bits/endian.h file for that machine must exist.  */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#error Machine byte order unknown.
+
+#if 0
+#define __BYTE_ORDER __BIG_ENDIAN
+#define __BYTE_ORDER __LITTLE_ENDIAN
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/environments.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/environments.h
new file mode 100644
index 0000000..548ea7f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/environments.h
@@ -0,0 +1,88 @@
+/* Copyright (C) 1999, 2001, 2004, 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _UNISTD_H
+# error "Never include this file directly.  Use <unistd.h> instead"
+#endif
+
+#include <bits/wordsize.h>
+
+/* This header should define the following symbols under the described
+   situations.  A value `1' means that the model is always supported,
+   `-1' means it is never supported.  Undefined means it cannot be
+   statically decided.
+
+   _POSIX_V7_ILP32_OFF32   32bit int, long, pointers, and off_t type
+   _POSIX_V7_ILP32_OFFBIG  32bit int, long, and pointers and larger off_t type
+
+   _POSIX_V7_LP64_OFF32	   64bit long and pointers and 32bit off_t type
+   _POSIX_V7_LPBIG_OFFBIG  64bit long and pointers and large off_t type
+
+   The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG,
+   _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32,
+   _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were
+   used in previous versions of the Unix standard and are available
+   only for compatibility.
+*/
+
+#if __WORDSIZE == 64
+
+/* We can never provide environments with 32-bit wide pointers.  */
+# define _POSIX_V7_ILP32_OFF32	-1
+# define _POSIX_V7_ILP32_OFFBIG	-1
+# define _POSIX_V6_ILP32_OFF32	-1
+# define _POSIX_V6_ILP32_OFFBIG	-1
+# define _XBS5_ILP32_OFF32	-1
+# define _XBS5_ILP32_OFFBIG	-1
+/* We also have no use (for now) for an environment with bigger pointers
+   and offsets.  */
+# define _POSIX_V7_LPBIG_OFFBIG	-1
+# define _POSIX_V6_LPBIG_OFFBIG	-1
+# define _XBS5_LPBIG_OFFBIG	-1
+
+/* By default we have 64-bit wide `long int', pointers and `off_t'.  */
+# define _POSIX_V7_LP64_OFF64	1
+# define _POSIX_V6_LP64_OFF64	1
+# define _XBS5_LP64_OFF64	1
+
+#else /* __WORDSIZE == 32 */
+
+/* By default we have 32-bit wide `int', `long int', pointers and `off_t'
+   and all platforms support LFS.  */
+# define _POSIX_V7_ILP32_OFF32	1
+# define _POSIX_V7_ILP32_OFFBIG	1
+# define _POSIX_V6_ILP32_OFF32	1
+# define _POSIX_V6_ILP32_OFFBIG	1
+# define _XBS5_ILP32_OFF32	1
+# define _XBS5_ILP32_OFFBIG	1
+
+/* We optionally provide an environment with the above size but an 64-bit
+   side `off_t'.  Therefore we don't define _POSIX_V7_ILP32_OFFBIG.  */
+
+/* We can never provide environments with 64-bit wide pointers.  */
+# define _POSIX_V7_LP64_OFF64	-1
+# define _POSIX_V7_LPBIG_OFFBIG	-1
+# define _POSIX_V6_LP64_OFF64	-1
+# define _POSIX_V6_LPBIG_OFFBIG	-1
+# define _XBS5_LP64_OFF64	-1
+# define _XBS5_LPBIG_OFFBIG	-1
+
+/* CFLAGS.  */
+#define __ILP32_OFFBIG_CFLAGS   "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
+
+#endif /* __WORDSIZE == 32 */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/epoll.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/epoll.h
new file mode 100644
index 0000000..0a49b97
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/epoll.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_EPOLL_H
+# error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
+#endif
+
+/* Flags to be passed to epoll_create1.  */
+enum
+  {
+    EPOLL_CLOEXEC = 02000000,
+#define EPOLL_CLOEXEC EPOLL_CLOEXEC
+    EPOLL_NONBLOCK = 00004000
+#define EPOLL_NONBLOCK EPOLL_NONBLOCK
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/errno.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/errno.h
new file mode 100644
index 0000000..0bf6354
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/errno.h
@@ -0,0 +1,62 @@
+/* Error constants.  Linux specific version.
+   Copyright (C) 1996, 1997, 1998, 1999, 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifdef _ERRNO_H
+
+# undef EDOM
+# undef EILSEQ
+# undef ERANGE
+# include <linux/errno.h>
+
+/* Linux has no ENOTSUP error code.  */
+# ifndef ENOTSUP
+#  define ENOTSUP EOPNOTSUPP
+# endif
+
+/* Older Linux versions also had no ECANCELED error code.  */
+# ifndef ECANCELED
+#  define ECANCELED	125
+# endif
+
+/* Support for error codes to support robust mutexes was added later, too.  */
+# ifndef EOWNERDEAD
+#  define EOWNERDEAD		130
+#  define ENOTRECOVERABLE	131
+# endif
+
+# ifndef __ASSEMBLER__
+/* Function to get address of global `errno' variable.  */
+extern int *__errno_location (void) __THROW __attribute__ ((__const__));
+libc_hidden_proto(__errno_location)
+
+#  ifdef __UCLIBC_HAS_THREADS__
+/* When using threads, errno is a per-thread value.  */
+#   define errno (*__errno_location ())
+#  endif
+# endif /* !__ASSEMBLER__ */
+#endif /* _ERRNO_H */
+
+#if !defined _ERRNO_H && defined __need_Emath
+/* This is ugly but the kernel header is not clean enough.  We must
+   define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is
+   defined.  */
+# define EDOM	33	/* Math argument out of domain of function.  */
+# define EILSEQ	84	/* Illegal byte sequence.  */
+# define ERANGE	34	/* Math result not representable.  */
+#endif /* !_ERRNO_H && __need_Emath */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/fcntl.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/fcntl.h
new file mode 100644
index 0000000..be40350
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/fcntl.h
@@ -0,0 +1,3 @@
+/* bits/fcntl.h is architecture specific.  */
+#error "This file must be supplied by every Linux architecture."
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/fenv.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/fenv.h
new file mode 100644
index 0000000..a9cb53b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/fenv.h
@@ -0,0 +1,56 @@
+/* Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _FENV_H
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+#endif
+
+
+/* Here should be the exception be defined:
+    FE_INVALID
+    FE_DIVBYZERO
+    FE_OVERFLOW
+    FE_UNDERFLOW
+    FE_INEXACT
+   We define no macro which signals no exception is supported.  */
+
+#define FE_ALL_EXCEPT 0
+
+
+/* Here should the rounding modes be defined:
+    FE_TONEAREST
+    FE_DOWNWARD
+    FE_UPWARD
+    FE_TOWARDZERO
+   We define no macro which signals no rounding mode is selectable.  */
+
+
+/* Type representing exception flags.  */
+typedef unsigned int fexcept_t;
+
+
+/* Type representing floating-point environment.  */
+typedef struct
+  {
+    fexcept_t __excepts;
+    /* XXX I don't know what else we should save.  */
+  }
+fenv_t;
+
+/* If the default argument is used we use this value.  */
+#define FE_DFL_ENV	((__const fenv_t *) -1l)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/fenvinline.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/fenvinline.h
new file mode 100644
index 0000000..42f77b5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/fenvinline.h
@@ -0,0 +1,8 @@
+/* This file provides inline versions of floating-pint environment
+   handling functions.  If there were any.  */
+
+#ifndef __NO_MATH_INLINES
+
+/* Here is where the code would go.  */
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/getopt.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/getopt.h
new file mode 100644
index 0000000..89bd332
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/getopt.h
@@ -0,0 +1,183 @@
+/* Declarations for getopt.
+   Copyright (C) 1989-1994,1996-1999,2001,2003,2004
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _GETOPT_H
+
+#include <features.h>
+
+#ifndef __need_getopt
+# define _GETOPT_H 1
+#endif
+
+/* If __GNU_LIBRARY__ is not already defined, either we are being used
+   standalone, or this is the first header included in the source file.
+   If we are being used with glibc, we need to include <features.h>, but
+   that does not exist if we are standalone.  So: if __GNU_LIBRARY__ is
+   not defined, include <ctype.h>, which will pull in <features.h> for us
+   if it's from glibc.  (Why ctype.h?  It's guaranteed to exist and it
+   doesn't flood the namespace with stuff the way some other headers do.)  */
+#if !defined __GNU_LIBRARY__
+# include <ctype.h>
+#endif
+
+#ifndef __THROW
+# ifndef __GNUC_PREREQ
+#  define __GNUC_PREREQ(maj, min) (0)
+# endif
+# if defined __cplusplus && __GNUC_PREREQ (2,8)
+#  define __THROW	throw ()
+# else
+#  define __THROW
+# endif
+#endif
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+/* For communication from `getopt' to the caller.
+   When `getopt' finds an option that takes an argument,
+   the argument value is returned here.
+   Also, when `ordering' is RETURN_IN_ORDER,
+   each non-option ARGV-element is returned here.  */
+
+extern char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+   This is used for communication to and from the caller
+   and for communication between successive calls to `getopt'.
+
+   On entry to `getopt', zero means this is the first call; initialize.
+
+   When `getopt' returns -1, this is the index of the first of the
+   non-option elements that the caller should itself scan.
+
+   Otherwise, `optind' communicates from one call to the next
+   how much of ARGV has been scanned so far.  */
+
+extern int optind;
+
+/* Callers store zero here to inhibit the error message `getopt' prints
+   for unrecognized options.  */
+
+extern int opterr;
+
+/* Set to an option character which was unrecognized.  */
+
+extern int optopt;
+
+#ifndef __need_getopt
+/* Describe the long-named options requested by the application.
+   The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
+   of `struct option' terminated by an element containing a name which is
+   zero.
+
+   The field `has_arg' is:
+   no_argument		(or 0) if the option does not take an argument,
+   required_argument	(or 1) if the option requires an argument,
+   optional_argument	(or 2) if the option takes an optional argument.
+
+   If the field `flag' is not NULL, it points to a variable that is set
+   to the value given in the field `val' when the option is found, but
+   left unchanged if the option is not found.
+
+   To have a long-named option do something other than set an `int' to
+   a compiled-in constant, such as set a value from `optarg', set the
+   option's `flag' field to zero and its `val' field to a nonzero
+   value (the equivalent single-letter option character, if there is
+   one).  For long options that have a zero `flag' field, `getopt'
+   returns the contents of the `val' field.  */
+
+struct option
+{
+  const char *name;
+  /* has_arg can't be an enum because some compilers complain about
+     type mismatches in all the code that assumes it is an int.  */
+  int has_arg;
+  int *flag;
+  int val;
+};
+
+/* Names for the values of the `has_arg' field of `struct option'.  */
+
+# define no_argument		0
+# define required_argument	1
+# define optional_argument	2
+#endif	/* need getopt */
+
+
+/* Get definitions and prototypes for functions to process the
+   arguments in ARGV (ARGC of them, minus the program name) for
+   options given in OPTS.
+
+   Return the option character from OPTS just read.  Return -1 when
+   there are no more options.  For unrecognized options, or options
+   missing arguments, `optopt' is set to the option letter, and '?' is
+   returned.
+
+   The OPTS string is a list of characters which are recognized option
+   letters, optionally followed by colons, specifying that that letter
+   takes an argument, to be placed in `optarg'.
+
+   If a letter in OPTS is followed by two colons, its argument is
+   optional.  This behavior is specific to the GNU `getopt'.
+
+   The argument `--' causes premature termination of argument
+   scanning, explicitly telling `getopt' that there are no more
+   options.
+
+   If OPTS begins with `--', then non-option arguments are treated as
+   arguments to the option '\0'.  This behavior is specific to the GNU
+   `getopt'.  */
+
+#if defined __GNU_LIBRARY__ || defined __UCLIBC__
+/* Many other libraries have conflicting prototypes for getopt, with
+   differences in the consts, in stdlib.h.  To avoid compilation
+   errors, only prototype getopt for the GNU C library.  */
+extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
+       __THROW;
+libc_hidden_proto(getopt)
+#else /* not __GNU_LIBRARY__ */
+extern int getopt ();
+libc_hidden_proto(getopt)
+#endif /* __GNU_LIBRARY__ */
+
+#if defined __UCLIBC_HAS_GNU_GETOPT__ || defined __UCLIBC_HAS_GETOPT_LONG__
+#ifndef __need_getopt
+extern int getopt_long (int ___argc, char *const *___argv,
+			const char *__shortopts,
+		        const struct option *__longopts, int *__longind)
+       __THROW;
+extern int getopt_long_only (int ___argc, char *const *___argv,
+			     const char *__shortopts,
+		             const struct option *__longopts, int *__longind)
+       __THROW;
+
+#endif
+#endif
+
+#ifdef	__cplusplus
+}
+#endif
+
+/* Make sure we later can get all the definitions and declarations.  */
+#undef __need_getopt
+
+#endif /* getopt.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/huge_val.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/huge_val.h
new file mode 100644
index 0000000..11ca11f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/huge_val.h
@@ -0,0 +1,55 @@
+/* `HUGE_VAL' constant for IEEE 754 machines (where it is infinity).
+   Used by <stdlib.h> and <math.h> functions for overflow.
+   Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000, 2004
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _MATH_H
+# error "Never use <bits/huge_val.h> directly; include <math.h> instead."
+#endif
+
+/* IEEE positive infinity (-HUGE_VAL is negative infinity).  */
+
+#if __GNUC_PREREQ(3,3)
+# define HUGE_VAL	(__builtin_huge_val())
+#elif __GNUC_PREREQ(2,96)
+# define HUGE_VAL	(__extension__ 0x1.0p2047)
+#elif defined __GNUC__
+
+# define HUGE_VAL \
+  (__extension__							      \
+   ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; })   \
+    { __l: 0x7ff0000000000000ULL }).__d)
+
+#else /* not GCC */
+
+# include <endian.h>
+
+typedef union { unsigned char __c[8]; double __d; } __huge_val_t;
+
+# if __BYTE_ORDER == __BIG_ENDIAN
+#  define __HUGE_VAL_bytes	{ 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }
+# endif
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+#  define __HUGE_VAL_bytes	{ 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
+# endif
+
+static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
+# define HUGE_VAL	(__huge_val.__d)
+
+#endif	/* GCC.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/huge_valf.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/huge_valf.h
new file mode 100644
index 0000000..1785342
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/huge_valf.h
@@ -0,0 +1,53 @@
+/* `HUGE_VALF' constant for IEEE 754 machines (where it is infinity).
+   Used by <stdlib.h> and <math.h> functions for overflow.
+   Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000, 2004
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _MATH_H
+# error "Never use <bits/huge_valf.h> directly; include <math.h> instead."
+#endif
+
+/* IEEE positive infinity (-HUGE_VAL is negative infinity).  */
+
+#if __GNUC_PREREQ(3,3)
+# define HUGE_VALF	(__builtin_huge_valf())
+#elif __GNUC_PREREQ(2,96)
+# define HUGE_VALF	(__extension__ 0x1.0p255f)
+#elif defined __GNUC__
+
+#   define HUGE_VALF \
+  (__extension__							      \
+   ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; })    \
+    { __l: 0x7f800000UL }).__d)
+
+#else /* not GCC */
+
+typedef union { unsigned char __c[4]; float __f; } __huge_valf_t;
+
+# if __BYTE_ORDER == __BIG_ENDIAN
+#  define __HUGE_VALF_bytes	{ 0x7f, 0x80, 0, 0 }
+# endif
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+#  define __HUGE_VALF_bytes	{ 0, 0, 0x80, 0x7f }
+# endif
+
+static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes };
+# define HUGE_VALF	(__huge_valf.__f)
+
+#endif	/* GCC.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/huge_vall.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/huge_vall.h
new file mode 100644
index 0000000..d5e8e22
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/huge_vall.h
@@ -0,0 +1,29 @@
+/* Default `HUGE_VALL' constant.
+   Used by <stdlib.h> and <math.h> functions for overflow.
+   Copyright (C) 1992, 1996, 1997, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _MATH_H
+# error "Never use <bits/huge_vall.h> directly; include <math.h> instead."
+#endif
+
+#if __GNUC_PREREQ(3,3)
+# define HUGE_VALL	(__builtin_huge_vall())
+#else
+# define HUGE_VALL	((long double) HUGE_VAL)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/in.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/in.h
new file mode 100644
index 0000000..1f2b817
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/in.h
@@ -0,0 +1,172 @@
+/* Copyright (C) 1991-1999, 2000, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* Linux version.  */
+
+#ifndef _NETINET_IN_H
+# error "Never use <bits/in.h> directly; include <netinet/in.h> instead."
+#endif
+
+/* Options for use with `getsockopt' and `setsockopt' at the IP level.
+   The first word in the comment at the right is the data type used;
+   "bool" means a boolean value stored in an `int'.  */
+#define        IP_OPTIONS      4       /* ip_opts; IP per-packet options.  */
+#define        IP_HDRINCL      3       /* int; Header is included with data.  */
+#define        IP_TOS          1       /* int; IP type of service and precedence.  */
+#define        IP_TTL          2       /* int; IP time to live.  */
+#define        IP_RECVOPTS     6       /* bool; Receive all IP options w/datagram.  */
+/* For BSD compatibility.  */
+#define        IP_RECVRETOPTS  IP_RETOPTS       /* bool; Receive IP options for response.  */
+#define        IP_RETOPTS      7       /* ip_opts; Set/get IP per-packet options.  */
+#define IP_MULTICAST_IF 32	/* in_addr; set/get IP multicast i/f */
+#define IP_MULTICAST_TTL 33	/* u_char; set/get IP multicast ttl */
+#define IP_MULTICAST_LOOP 34	/* i_char; set/get IP multicast loopback */
+#define IP_ADD_MEMBERSHIP 35	/* ip_mreq; add an IP group membership */
+#define IP_DROP_MEMBERSHIP 36	/* ip_mreq; drop an IP group membership */
+#define IP_UNBLOCK_SOURCE 37	/* ip_mreq_source: unblock data from source */
+#define IP_BLOCK_SOURCE 38	/* ip_mreq_source: block data from source */
+#define IP_ADD_SOURCE_MEMBERSHIP 39 /* ip_mreq_source: join source group */
+#define IP_DROP_SOURCE_MEMBERSHIP 40 /* ip_mreq_source: leave source group */
+#define IP_MSFILTER 41
+#define MCAST_JOIN_GROUP 42	/* group_req: join any-source group */
+#define MCAST_BLOCK_SOURCE 43	/* group_source_req: block from given group */
+#define MCAST_UNBLOCK_SOURCE 44	/* group_source_req: unblock from given group*/
+#define MCAST_LEAVE_GROUP 45	/* group_req: leave any-source group */
+#define MCAST_JOIN_SOURCE_GROUP 46 /* group_source_req: join source-spec gr */
+#define MCAST_LEAVE_SOURCE_GROUP 47 /* group_source_req: leave source-spec gr*/
+#define MCAST_MSFILTER 48
+
+#define MCAST_EXCLUDE   0
+#define MCAST_INCLUDE   1
+
+#define IP_ROUTER_ALERT    5	/* bool */
+#define IP_PKTINFO         8	/* bool */
+#define IP_PKTOPTIONS      9
+#define IP_PMTUDISC        10	/* obsolete name? */
+#define IP_MTU_DISCOVER    10	/* int; see below */
+#define IP_RECVERR         11	/* bool */
+#define IP_RECVTTL         12	/* bool */
+#define IP_RECVTOS         13	/* bool */
+
+
+/* IP_MTU_DISCOVER arguments.  */
+#define IP_PMTUDISC_DONT   0	/* Never send DF frames.  */
+#define IP_PMTUDISC_WANT   1	/* Use per route hints.  */
+#define IP_PMTUDISC_DO     2	/* Always DF.  */
+
+/* To select the IP level.  */
+#define SOL_IP	0
+
+#define IP_DEFAULT_MULTICAST_TTL        1
+#define IP_DEFAULT_MULTICAST_LOOP       1
+#define IP_MAX_MEMBERSHIPS              20
+
+/* Structure used to describe IP options for IP_OPTIONS and IP_RETOPTS.
+   The `ip_dst' field is used for the first-hop gateway when using a
+   source route (this gets put into the header proper).  */
+struct ip_opts
+  {
+    struct in_addr ip_dst;	/* First hop; zero without source route.  */
+    char ip_opts[40];		/* Actually variable in size.  */
+  };
+
+/* Like `struct ip_mreq' but including interface specification by index.  */
+struct ip_mreqn
+  {
+    struct in_addr imr_multiaddr;	/* IP multicast address of group */
+    struct in_addr imr_address;		/* local IP address of interface */
+    int	imr_ifindex;			/* Interface index */
+  };
+
+/* Structure used for IP_PKTINFO.  */
+struct in_pktinfo
+  {
+    int ipi_ifindex;			/* Interface index  */
+    struct in_addr ipi_spec_dst;	/* Routing destination address  */
+    struct in_addr ipi_addr;		/* Header destination address  */
+  };
+
+#ifdef __UCLIBC_HAS_IPV6__
+/* Options for use with `getsockopt' and `setsockopt' at the IPv6 level.
+   The first word in the comment at the right is the data type used;
+   "bool" means a boolean value stored in an `int'.  */
+#define IPV6_ADDRFORM		1
+#define IPV6_2292PKTINFO	2
+#define IPV6_2292HOPOPTS	3
+#define IPV6_2292DSTOPTS	4
+#define IPV6_2292RTHDR		5
+#define IPV6_2292PKTOPTIONS	6
+#define IPV6_CHECKSUM		7
+#define IPV6_2292HOPLIMIT	8
+
+#define SCM_SRCRT		IPV6_RXSRCRT
+
+#define IPV6_NEXTHOP		9
+#define IPV6_AUTHHDR		10
+#define IPV6_UNICAST_HOPS	16
+#define IPV6_MULTICAST_IF	17
+#define IPV6_MULTICAST_HOPS	18
+#define IPV6_MULTICAST_LOOP	19
+#define IPV6_JOIN_GROUP		20
+#define IPV6_LEAVE_GROUP	21
+#define IPV6_ROUTER_ALERT	22
+#define IPV6_MTU_DISCOVER	23
+#define IPV6_MTU		24
+#define IPV6_RECVERR		25
+#define IPV6_V6ONLY		26
+#define IPV6_JOIN_ANYCAST	27
+#define IPV6_LEAVE_ANYCAST	28
+#define IPV6_IPSEC_POLICY	34
+#define IPV6_XFRM_POLICY	35
+
+#define IPV6_RECVPKTINFO	49
+#define IPV6_PKTINFO		50
+#define IPV6_RECVHOPLIMIT	51
+#define IPV6_HOPLIMIT		52
+#define IPV6_RECVHOPOPTS	53
+#define IPV6_HOPOPTS		54
+#define IPV6_RTHDRDSTOPTS	55
+#define IPV6_RECVRTHDR		56
+#define IPV6_RTHDR		57
+#define IPV6_RECVDSTOPTS	58
+#define IPV6_DSTOPTS		59
+
+#define IPV6_RECVTCLASS		66
+#define IPV6_TCLASS		67
+
+/* Obsolete synonyms for the above.  */
+#define IPV6_ADD_MEMBERSHIP	IPV6_JOIN_GROUP
+#define IPV6_DROP_MEMBERSHIP	IPV6_LEAVE_GROUP
+#define IPV6_RXHOPOPTS		IPV6_HOPOPTS
+#define IPV6_RXDSTOPTS		IPV6_DSTOPTS
+
+/* IPV6_MTU_DISCOVER values.  */
+#define IPV6_PMTUDISC_DONT	0	/* Never send DF frames.  */
+#define IPV6_PMTUDISC_WANT	1	/* Use per route hints.  */
+#define IPV6_PMTUDISC_DO	2	/* Always DF.  */
+
+/* Socket level values for IPv6.  */
+#define SOL_IPV6        41
+#define SOL_ICMPV6      58
+
+/* Routing header options for IPv6.  */
+#define IPV6_RTHDR_LOOSE	0	/* Hop doesn't need to be neighbour. */
+#define IPV6_RTHDR_STRICT	1	/* Hop must be a neighbour.  */
+
+#define IPV6_RTHDR_TYPE_0	0	/* IPv6 Routing header type 0.  */
+#endif /* __UCLIBC_HAS_IPV6__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/inf.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/inf.h
new file mode 100644
index 0000000..1619f75
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/inf.h
@@ -0,0 +1,30 @@
+/* `INFINITY' constant for IEEE 754 machines.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _MATH_H
+# error "Never use <bits/inf.h> directly; include <math.h> instead."
+#endif
+
+/* IEEE positive infinity.  */
+
+#if __GNUC_PREREQ(3,3)
+# define INFINITY	(__builtin_inff())
+#else
+# define INFINITY	HUGE_VALF
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/initspin.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/initspin.h
new file mode 100644
index 0000000..a19ec07
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/initspin.h
@@ -0,0 +1,28 @@
+/* Generic definitions for spinlock initializers.
+   Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* Initial value of a spinlock.  Most platforms should use zero,
+   unless they only implement a "test and clear" operation instead of
+   the usual "test and set". */
+#define __LT_SPINLOCK_INIT 0
+
+/* Macros for lock initializers, using the above definition. */
+#define __LOCK_INITIALIZER { 0, __LT_SPINLOCK_INIT }
+#define __ALT_LOCK_INITIALIZER { 0, __LT_SPINLOCK_INIT }
+#define __ATOMIC_INITIALIZER { 0, __LT_SPINLOCK_INIT }
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/inotify.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/inotify.h
new file mode 100644
index 0000000..291f008
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/inotify.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2005-2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_INOTIFY_H
+# error "Never use <bits/inotify.h> directly; include <sys/inotify.h> instead."
+#endif
+
+/* Flags for the parameter of inotify_init1.  */
+enum
+  {
+    IN_CLOEXEC = 02000000,
+#define IN_CLOEXEC IN_CLOEXEC
+    IN_NONBLOCK = 00004000
+#define IN_NONBLOCK IN_NONBLOCK
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/ioctl-types.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/ioctl-types.h
new file mode 100644
index 0000000..e856a04
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/ioctl-types.h
@@ -0,0 +1,78 @@
+/* Structure types for pre-termios terminal ioctls.  Linux version.
+   Copyright (C) 1996, 1997, 1999, 2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_IOCTL_H
+# error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead."
+#endif
+
+/* Get definition of constants for use with `ioctl'.  */
+#include <asm/ioctls.h>
+
+
+struct winsize
+  {
+    unsigned short int ws_row;
+    unsigned short int ws_col;
+    unsigned short int ws_xpixel;
+    unsigned short int ws_ypixel;
+  };
+
+#define NCC 8
+struct termio
+  {
+    unsigned short int c_iflag;		/* input mode flags */
+    unsigned short int c_oflag;		/* output mode flags */
+    unsigned short int c_cflag;		/* control mode flags */
+    unsigned short int c_lflag;		/* local mode flags */
+    unsigned char c_line;		/* line discipline */
+    unsigned char c_cc[NCC];		/* control characters */
+};
+
+/* modem lines */
+#define TIOCM_LE	0x001
+#define TIOCM_DTR	0x002
+#define TIOCM_RTS	0x004
+#define TIOCM_ST	0x008
+#define TIOCM_SR	0x010
+#define TIOCM_CTS	0x020
+#define TIOCM_CAR	0x040
+#define TIOCM_RNG	0x080
+#define TIOCM_DSR	0x100
+#define TIOCM_CD	TIOCM_CAR
+#define TIOCM_RI	TIOCM_RNG
+
+/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+
+/* line disciplines */
+#define N_TTY		0
+#define N_SLIP		1
+#define N_MOUSE		2
+#define N_PPP		3
+#define N_STRIP		4
+#define N_AX25		5
+#define N_X25		6	/* X.25 async  */
+#define N_6PACK		7
+#define N_MASC		8	/* Mobitex module  */
+#define N_R3964		9	/* Simatic R3964 module  */
+#define N_PROFIBUS_FDL	10	/* Profibus  */
+#define N_IRDA		11	/* Linux IR  */
+#define N_SMSBLOCK	12	/* SMS block mode  */
+#define N_HDLC		13	/* synchronous HDLC  */
+#define N_SYNC_PPP	14	/* synchronous PPP  */
+#define	N_HCI		15	/* Bluetooth HCI UART  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/ioctls.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/ioctls.h
new file mode 100644
index 0000000..268c0e4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/ioctls.h
@@ -0,0 +1,109 @@
+/* Copyright (C) 1996, 1997, 1998, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_IOCTL_H
+# error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead."
+#endif
+
+/* Use the definitions from the kernel header files.  */
+#include <asm/ioctls.h>
+
+/* Routing table calls.  */
+#define SIOCADDRT	0x890B		/* add routing table entry	*/
+#define SIOCDELRT	0x890C		/* delete routing table entry	*/
+#define SIOCRTMSG	0x890D		/* call to routing system	*/
+
+/* Socket configuration controls. */
+#define SIOCGIFNAME	0x8910		/* get iface name		*/
+#define SIOCSIFLINK	0x8911		/* set iface channel		*/
+#define SIOCGIFCONF	0x8912		/* get iface list		*/
+#define SIOCGIFFLAGS	0x8913		/* get flags			*/
+#define SIOCSIFFLAGS	0x8914		/* set flags			*/
+#define SIOCGIFADDR	0x8915		/* get PA address		*/
+#define SIOCSIFADDR	0x8916		/* set PA address		*/
+#define SIOCGIFDSTADDR	0x8917		/* get remote PA address	*/
+#define SIOCSIFDSTADDR	0x8918		/* set remote PA address	*/
+#define SIOCGIFBRDADDR	0x8919		/* get broadcast PA address	*/
+#define SIOCSIFBRDADDR	0x891a		/* set broadcast PA address	*/
+#define SIOCGIFNETMASK	0x891b		/* get network PA mask		*/
+#define SIOCSIFNETMASK	0x891c		/* set network PA mask		*/
+#define SIOCGIFMETRIC	0x891d		/* get metric			*/
+#define SIOCSIFMETRIC	0x891e		/* set metric			*/
+#define SIOCGIFMEM	0x891f		/* get memory address (BSD)	*/
+#define SIOCSIFMEM	0x8920		/* set memory address (BSD)	*/
+#define SIOCGIFMTU	0x8921		/* get MTU size			*/
+#define SIOCSIFMTU	0x8922		/* set MTU size			*/
+#define SIOCSIFNAME	0x8923		/* set interface name		*/
+#define	SIOCSIFHWADDR	0x8924		/* set hardware address		*/
+#define SIOCGIFENCAP	0x8925		/* get/set encapsulations       */
+#define SIOCSIFENCAP	0x8926
+#define SIOCGIFHWADDR	0x8927		/* Get hardware address		*/
+#define SIOCGIFSLAVE	0x8929		/* Driver slaving support	*/
+#define SIOCSIFSLAVE	0x8930
+#define SIOCADDMULTI	0x8931		/* Multicast address lists	*/
+#define SIOCDELMULTI	0x8932
+#define SIOCGIFINDEX	0x8933		/* name -> if_index mapping	*/
+#define SIOGIFINDEX	SIOCGIFINDEX	/* misprint compatibility :-)	*/
+#define SIOCSIFPFLAGS	0x8934		/* set/get extended flags set	*/
+#define SIOCGIFPFLAGS	0x8935
+#define SIOCDIFADDR	0x8936		/* delete PA address		*/
+#define	SIOCSIFHWBROADCAST	0x8937	/* set hardware broadcast addr	*/
+#define SIOCGIFCOUNT	0x8938		/* get number of devices */
+
+#define SIOCGIFBR	0x8940		/* Bridging support		*/
+#define SIOCSIFBR	0x8941		/* Set bridging options		*/
+
+#define SIOCGIFTXQLEN	0x8942		/* Get the tx queue length	*/
+#define SIOCSIFTXQLEN	0x8943		/* Set the tx queue length	*/
+
+
+/* ARP cache control calls. */
+		    /*  0x8950 - 0x8952  * obsolete calls, don't re-use */
+#define SIOCDARP	0x8953		/* delete ARP table entry	*/
+#define SIOCGARP	0x8954		/* get ARP table entry		*/
+#define SIOCSARP	0x8955		/* set ARP table entry		*/
+
+/* RARP cache control calls. */
+#define SIOCDRARP	0x8960		/* delete RARP table entry	*/
+#define SIOCGRARP	0x8961		/* get RARP table entry		*/
+#define SIOCSRARP	0x8962		/* set RARP table entry		*/
+
+/* Driver configuration calls */
+
+#define SIOCGIFMAP	0x8970		/* Get device parameters	*/
+#define SIOCSIFMAP	0x8971		/* Set device parameters	*/
+
+/* DLCI configuration calls */
+
+#define SIOCADDDLCI	0x8980		/* Create new DLCI device	*/
+#define SIOCDELDLCI	0x8981		/* Delete DLCI device		*/
+
+/* Device private ioctl calls.  */
+
+/* These 16 ioctls are available to devices via the do_ioctl() device
+   vector.  Each device should include this file and redefine these
+   names as their own. Because these are device dependent it is a good
+   idea _NOT_ to issue them to random objects and hope.  */
+
+#define SIOCDEVPRIVATE	0x89F0	/* to 89FF */
+
+/*
+ *	These 16 ioctl calls are protocol private
+ */
+
+#define SIOCPROTOPRIVATE 0x89E0 /* to 89EF */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/ipc.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/ipc.h
new file mode 100644
index 0000000..f1a043f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/ipc.h
@@ -0,0 +1,56 @@
+/* Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_IPC_H
+# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Mode bits for `msgget', `semget', and `shmget'.  */
+#define IPC_CREAT	01000		/* Create key if key does not exist. */
+#define IPC_EXCL	02000		/* Fail if key exists.  */
+#define IPC_NOWAIT	04000		/* Return error on wait.  */
+
+/* Control commands for `msgctl', `semctl', and `shmctl'.  */
+#define IPC_RMID	0		/* Remove identifier.  */
+#define IPC_SET		1		/* Set `ipc_perm' options.  */
+#define IPC_STAT	2		/* Get `ipc_perm' options.  */
+#ifdef __USE_GNU
+# define IPC_INFO	3		/* See ipcs.  */
+#endif
+
+/* Special key values.  */
+#define IPC_PRIVATE	((__key_t) 0)	/* Private key.  */
+
+
+/* Data structure used to pass permission information to IPC operations.  */
+struct ipc_perm
+  {
+    __key_t __key;			/* Key.  */
+    __uid_t uid;			/* Owner's user ID.  */
+    __gid_t gid;			/* Owner's group ID.  */
+    __uid_t cuid;			/* Creator's user ID.  */
+    __gid_t cgid;			/* Creator's group ID.  */
+    unsigned short int mode;		/* Read/write permission.  */
+    unsigned short int __pad1;
+    unsigned short int __seq;		/* Sequence number.  */
+    unsigned short int __pad2;
+    unsigned long int __unused1;
+    unsigned long int __unused2;
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel-features.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel-features.h
new file mode 100644
index 0000000..5ea85d2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel-features.h
@@ -0,0 +1,500 @@
+/* Set flags signalling availability of kernel features based on given
+   kernel version number.
+   Copyright (C) 1999-2003, 2004, 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* This file must not contain any C code.  At least it must be protected
+   to allow using the file also in assembler files.  */
+
+#if defined __mips__
+# include <sgidefs.h>
+#endif
+
+#include <linux/version.h>
+#define __LINUX_KERNEL_VERSION		LINUX_VERSION_CODE
+
+/* We assume for __LINUX_KERNEL_VERSION the same encoding used in
+   linux/version.h.  I.e., the major, minor, and subminor all get a
+   byte with the major number being in the highest byte.  This means
+   we can do numeric comparisons.
+
+   In the following we will define certain symbols depending on
+   whether the describes kernel feature is available in the kernel
+   version given by __LINUX_KERNEL_VERSION.  We are not always exactly
+   recording the correct versions in which the features were
+   introduced.  If somebody cares these values can afterwards be
+   corrected.  Most of the numbers here are set corresponding to
+   2.2.0.  */
+
+/* `getcwd' system call.  */
+#if __LINUX_KERNEL_VERSION >= 131584
+# define __ASSUME_GETCWD_SYSCALL	1
+#endif
+
+/* When was `poll' introduced?  */
+#if __LINUX_KERNEL_VERSION >= 131584
+# define __ASSUME_POLL_SYSCALL          1
+#endif
+
+/* Real-time signal became usable in 2.1.70.  */
+#if __LINUX_KERNEL_VERSION >= 131398
+# define __ASSUME_REALTIME_SIGNALS	1
+#endif
+
+/* When were the `pread'/`pwrite' syscalls introduced?  */
+#if __LINUX_KERNEL_VERSION >= 131584
+# define __ASSUME_PREAD_SYSCALL		1
+# define __ASSUME_PWRITE_SYSCALL	1
+#endif
+
+/* When was `poll' introduced?  */
+#if __LINUX_KERNEL_VERSION >= 131584
+# define __ASSUME_POLL_SYSCALL		1
+#endif
+
+/* The `lchown' syscall was introduced in 2.1.80.  */
+#if __LINUX_KERNEL_VERSION >= 131408
+# define __ASSUME_LCHOWN_SYSCALL	1
+#endif
+
+/* When did the `setresuid' sysall became available?  */
+#if __LINUX_KERNEL_VERSION >= 131584 && !defined __sparc__
+# define __ASSUME_SETRESUID_SYSCALL	1
+#endif
+
+/* The SIOCGIFNAME ioctl is available starting with 2.1.50.  */
+#if __LINUX_KERNEL_VERSION >= 131408
+# define __ASSUME_SIOCGIFNAME		1
+#endif
+
+/* MSG_NOSIGNAL was at least available with Linux 2.2.0.  */
+#if __LINUX_KERNEL_VERSION >= 131584
+# define __ASSUME_MSG_NOSIGNAL		1
+#endif
+
+/* On x86 another `getrlimit' syscall was added in 2.3.25.  */
+#if __LINUX_KERNEL_VERSION >= 131865 && defined __i386__
+# define __ASSUME_NEW_GETRLIMIT_SYSCALL	1
+#endif
+
+/* On x86 the truncate64/ftruncate64 syscalls were introduced in 2.3.31.  */
+#if __LINUX_KERNEL_VERSION >= 131871 && defined __i386__
+# define __ASSUME_TRUNCATE64_SYSCALL	1
+#endif
+
+/* On x86 the mmap2 syscall was introduced in 2.3.31.  */
+#if __LINUX_KERNEL_VERSION >= 131871 && defined __i386__
+# define __ASSUME_MMAP2_SYSCALL	1
+#endif
+
+/* On x86 the stat64/lstat64/fstat64 syscalls were introduced in 2.3.34.  */
+#if __LINUX_KERNEL_VERSION >= 131874 && defined __i386__
+# define __ASSUME_STAT64_SYSCALL	1
+#endif
+
+/* On sparc and ARM the truncate64/ftruncate64/mmap2/stat64/lstat64/fstat64
+   syscalls were introduced in 2.3.35.  */
+#if __LINUX_KERNEL_VERSION >= 131875 && (defined __sparc__ || defined __arm__)
+# define __ASSUME_TRUNCATE64_SYSCALL	1
+# define __ASSUME_MMAP2_SYSCALL		1
+# define __ASSUME_STAT64_SYSCALL	1
+#endif
+
+/* I know for sure that getrlimit are in 2.3.35 on powerpc.  */
+#if __LINUX_KERNEL_VERSION >= 131875 && defined __powerpc__
+# define __ASSUME_NEW_GETRLIMIT_SYSCALL	1
+#endif
+
+/* I know for sure that these are in 2.3.35 on powerpc. But PowerPC64 does not
+   support separate 64-bit syscalls, already 64-bit */
+#if __LINUX_KERNEL_VERSION >= 131875 && defined __powerpc__ \
+    && !defined __powerpc64__
+# define __ASSUME_TRUNCATE64_SYSCALL	1
+# define __ASSUME_STAT64_SYSCALL	1
+#endif
+
+/* Linux 2.3.39 introduced 32bit UID/GIDs.  Some platforms had 32
+   bit type all along.  */
+#if __LINUX_KERNEL_VERSION >= 131879 || defined __powerpc__ || defined __mips__
+# define __ASSUME_32BITUIDS		1
+#endif
+
+/* Linux 2.3.39 sparc added setresuid.  */
+#if __LINUX_KERNEL_VERSION >= 131879 && defined __sparc__
+# define __ASSUME_SETRESUID_SYSCALL	1
+#endif
+
+#if __LINUX_KERNEL_VERSION >= 131879
+# define __ASSUME_SETRESGID_SYSCALL	1
+#endif
+
+/* Linux 2.3.39 introduced IPC64.  Except for powerpc.  */
+#if __LINUX_KERNEL_VERSION >= 131879 && !defined __powerpc__
+# define __ASSUME_IPC64		1
+#endif
+
+/* MIPS platforms had IPC64 all along.  */
+#if defined __mips__
+# define __ASSUME_IPC64		1
+#endif
+
+/* We can use the LDTs for threading with Linux 2.3.99 and newer.  */
+#if __LINUX_KERNEL_VERSION >= 131939
+# define __ASSUME_LDT_WORKS		1
+#endif
+
+/* Linux 2.4.0 on PPC introduced a correct IPC64. But PowerPC64 does not
+   support a separate 64-bit sys call, already 64-bit */
+#if __LINUX_KERNEL_VERSION >= 132096 && defined __powerpc__ \
+    && !defined __powerpc64__
+# define __ASSUME_IPC64			1
+#endif
+
+/* SH kernels got stat64, mmap2, and truncate64 during 2.4.0-test.  */
+#if __LINUX_KERNEL_VERSION >= 132096 && defined __sh__
+# define __ASSUME_TRUNCATE64_SYSCALL	1
+# define __ASSUME_MMAP2_SYSCALL		1
+# define __ASSUME_STAT64_SYSCALL	1
+#endif
+
+/* The changed st_ino field appeared in 2.4.0-test6.  But we cannot
+   distinguish this version from other 2.4.0 releases.  Therefore play
+   save and assume it available is for 2.4.1 and up.  However, SH is lame,
+   and still does not have a 64-bit inode field.  */
+#if __LINUX_KERNEL_VERSION >= 132097 && !defined __alpha__ && !defined __sh__
+# define __ASSUME_ST_INO_64_BIT		1
+#endif
+
+/* To support locking of large files a new fcntl() syscall was introduced
+   in 2.4.0-test7.  We test for 2.4.1 for the earliest version we know
+   the syscall is available.  */
+#if __LINUX_KERNEL_VERSION >= 132097 && (defined __i386__ || defined __sparc__)
+# define __ASSUME_FCNTL64		1
+#endif
+
+/* The AT_CLKTCK auxiliary vector entry was introduction in the 2.4.0
+   series.  */
+#if __LINUX_KERNEL_VERSION >= 132097
+# define __ASSUME_AT_CLKTCK		1
+#endif
+
+/* Arm got fcntl64 in 2.4.4, PowerPC and SH have it also in 2.4.4 (I
+   don't know when it got introduced).  But PowerPC64 does not support
+   separate FCNTL64 call, FCNTL is already 64-bit */
+#if __LINUX_KERNEL_VERSION >= 132100 \
+    && (defined __arm__ || defined __powerpc__ || defined __sh__) \
+    && !defined __powerpc64__
+# define __ASSUME_FCNTL64		1
+#endif
+
+/* The getdents64 syscall was introduced in 2.4.0-test7.  We test for
+   2.4.1 for the earliest version we know the syscall is available.  */
+#if __LINUX_KERNEL_VERSION >= 132097
+# define __ASSUME_GETDENTS64_SYSCALL	1
+#endif
+
+/* When did O_DIRECTORY became available?  Early in 2.3 but when?
+   Be safe, use 2.3.99.  */
+#if __LINUX_KERNEL_VERSION >= 131939
+# define __ASSUME_O_DIRECTORY		1
+#endif
+
+/* Starting with one of the 2.4.0 pre-releases the Linux kernel passes
+   up the page size information.  */
+#if __LINUX_KERNEL_VERSION >= 132097
+# define __ASSUME_AT_PAGESIZE		1
+#endif
+
+/* Starting with at least 2.4.0 the kernel passes the uid/gid unconditionally
+   up to the child.  */
+#if __LINUX_KERNEL_VERSION >= 132097
+# define __ASSUME_AT_XID		1
+#endif
+
+/* Starting with 2.4.5 kernels PPC passes the AUXV in the standard way
+   and the vfork syscall made it into the official kernel.  */
+#if __LINUX_KERNEL_VERSION >= (132096+5) && defined __powerpc__
+# define __ASSUME_STD_AUXV		1
+# define __ASSUME_VFORK_SYSCALL		1
+#endif
+
+/* Starting with 2.4.5 kernels the mmap2 syscall made it into the official
+   kernel.  But PowerPC64 does not support a separate MMAP2 call.  */
+#if __LINUX_KERNEL_VERSION >= (132096+5) && defined __powerpc__ \
+    && !defined __powerpc64__
+# define __ASSUME_MMAP2_SYSCALL		1
+#endif
+
+/* Starting with 2.4.21 PowerPC implements the new prctl syscall.
+   This allows applications to get/set the Floating Point Exception Mode.  */
+#if __LINUX_KERNEL_VERSION >= (132096+21) && defined __powerpc__
+# define __ASSUME_NEW_PRCTL_SYSCALL		1
+#endif
+
+/* Starting with 2.4.21 the PowerPC32 clone syscall works as expected.  */
+#if __LINUX_KERNEL_VERSION >= (132096+21) && defined __powerpc__ \
+    && !defined __powerpc64__
+# define __ASSUME_FIXED_CLONE_SYSCALL		1
+#endif
+
+/* Starting with 2.4.21 PowerPC64 implements the new rt_sigreturn syscall.
+   The new rt_sigreturn takes an ucontext pointer allowing rt_sigreturn
+   to be used in the set/swapcontext implementation.  */
+#if __LINUX_KERNEL_VERSION >= (132096+21) && defined __powerpc64__
+# define __ASSUME_NEW_RT_SIGRETURN_SYSCALL		1
+#endif
+
+/* On x86, the set_thread_area syscall was introduced in 2.5.29, but its
+   semantics was changed in 2.5.30, and again after 2.5.31.  */
+#if __LINUX_KERNEL_VERSION >= 132384 && defined __i386__
+# define __ASSUME_SET_THREAD_AREA_SYSCALL	1
+#endif
+
+/* The vfork syscall on x86 and arm was definitely available in 2.4.  */
+#if __LINUX_KERNEL_VERSION >= 132097 && (defined __i386__ || defined __arm__)
+# define __ASSUME_VFORK_SYSCALL		1
+#endif
+
+/* There are an infinite number of PA-RISC kernel versions numbered
+   2.4.0.  But they've not really been released as such.  We require
+   and expect the final version here.  */
+#ifdef __hppa__
+# define __ASSUME_32BITUIDS		1
+# define __ASSUME_TRUNCATE64_SYSCALL	1
+# define __ASSUME_MMAP2_SYSCALL		1
+# define __ASSUME_STAT64_SYSCALL	1
+# define __ASSUME_IPC64			1
+# define __ASSUME_ST_INO_64_BIT		1
+# define __ASSUME_FCNTL64		1
+# define __ASSUME_GETDENTS64_SYSCALL	1
+#endif
+
+/* Alpha switched to a 64-bit timeval sometime before 2.2.0.  */
+#if __LINUX_KERNEL_VERSION >= 131584 && defined __alpha__
+# define __ASSUME_TIMEVAL64		1
+#endif
+
+#if defined __mips__ && _MIPS_SIM == _ABIN32
+# define __ASSUME_FCNTL64		1
+#endif
+
+/* The late 2.5 kernels saw a lot of new CLONE_* flags.  Summarize
+   their availability with one define.  The changes were made first
+   for i386 and the have to be done separately for the other archs.
+   For i386 we pick 2.5.50 as the first version with support.  */
+#if __LINUX_KERNEL_VERSION >= 132402 && defined __i386__
+# define __ASSUME_CLONE_THREAD_FLAGS	1
+#endif
+
+/* Support for various CLOEXEC and NONBLOCK flags was added for x86,
+   x86-64, PPC, IA-64, SPARC< and S390 in 2.6.23.  */
+#if __LINUX_KERNEL_VERSION >= 0x020617 \
+    && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
+	|| defined __ia64__ || defined __sparc__ || defined __s390__)
+# define __ASSUME_O_CLOEXEC 1
+#endif
+
+/* Support for various CLOEXEC and NONBLOCK flags was added for x86,
+ *    x86-64, PPC, IA-64, and SPARC in 2.6.27.  */
+#if __LINUX_KERNEL_VERSION >= 0x02061b \
+    && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
+        || defined __ia64__ || defined __sparc__ || defined __s390__)
+/* # define __ASSUME_SOCK_CLOEXEC  1 */
+/* # define __ASSUME_IN_NONBLOCK   1 */
+# define __ASSUME_PIPE2         1
+/* # define __ASSUME_EVENTFD2      1 */
+/* # define __ASSUME_SIGNALFD4     1 */
+#endif
+
+
+/* These features were surely available with 2.4.12.  */
+#if __LINUX_KERNEL_VERSION >= 132108 && defined __mc68000__
+# define __ASSUME_MMAP2_SYSCALL		1
+# define __ASSUME_TRUNCATE64_SYSCALL	1
+# define __ASSUME_STAT64_SYSCALL	1
+# define __ASSUME_FCNTL64		1
+# define __ASSUME_VFORK_SYSCALL		1
+#endif
+
+/* Beginning with 2.5.63 support for realtime and monotonic clocks and
+   timers based on them is available.  */
+#if __LINUX_KERNEL_VERSION >= 132415
+# define __ASSUME_POSIX_TIMERS		1
+#endif
+
+/* Beginning with 2.6.12 the clock and timer supports CPU clocks.  */
+#if __LINUX_KERNEL_VERSION >= 0x2060c
+# define __ASSUME_POSIX_CPU_TIMERS      1
+#endif
+
+/* The late 2.5 kernels saw a lot of new CLONE_* flags.  Summarize
+   their availability with one define.  The changes were made first
+   for i386 and the have to be done separately for the other archs.
+   For ia64, s390*, PPC, x86-64 we pick 2.5.64 as the first version
+   with support.  */
+#if __LINUX_KERNEL_VERSION >= 132416 \
+    && (defined __ia64__ || defined __s390__ || defined __powerpc__ \
+	|| defined __x86_64__ || defined __sh__)
+# define __ASSUME_CLONE_THREAD_FLAGS	1
+#endif
+
+/* With kernel 2.4.17 we always have netlink support.  */
+#if __LINUX_KERNEL_VERSION >= (132096+17)
+# define __ASSUME_NETLINK_SUPPORT	1
+#endif
+
+/* The requeue futex functionality was introduced in 2.5.70.  */
+#if __LINUX_KERNEL_VERSION >= 132422
+# define __ASSUME_FUTEX_REQUEUE	1
+#endif
+
+/* The statfs64 syscalls are available in 2.5.74.  */
+#if __LINUX_KERNEL_VERSION >= 132426
+# define __ASSUME_STATFS64	1
+#endif
+
+/* Starting with at least 2.5.74 the kernel passes the setuid-like exec
+   flag unconditionally up to the child.  */
+#if __LINUX_KERNEL_VERSION >= 132426
+# define __ASSUME_AT_SECURE	1
+#endif
+
+/* Starting with the 2.5.75 kernel the kernel fills in the correct value
+   in the si_pid field passed as part of the siginfo_t struct to signal
+   handlers.  */
+#if __LINUX_KERNEL_VERSION >= 132427
+# define __ASSUME_CORRECT_SI_PID	1
+#endif
+
+/* The tgkill syscall was instroduced for i386 in 2.5.75.  For Alpha
+   it was introduced in 2.6.0-test1 which unfortunately cannot be
+   distinguished from 2.6.0.  On x86-64, ppc, and ppc64 it was
+   introduced in 2.6.0-test3. */
+#if (__LINUX_KERNEL_VERSION >= 132427 && defined __i386__) \
+    || (__LINUX_KERNEL_VERSION >= 132609 && defined __alpha__) \
+    || (__LINUX_KERNEL_VERSION >= 132609 && defined __x86_64__) \
+    || (__LINUX_KERNEL_VERSION >= 132609 && defined __powerpc__) \
+    || (__LINUX_KERNEL_VERSION >= 132609 && defined __sh__)
+# define __ASSUME_TGKILL	1
+#endif
+
+/* The utimes syscall has been available for some architectures
+   forever.  For x86 it was introduced after 2.5.75, for x86-64,
+   ppc, and ppc64 it was introduced in 2.6.0-test3.  */
+#if defined __alpha__ || defined __ia64__ || defined __hppa__ \
+    || defined __sparc__ \
+    || (__LINUX_KERNEL_VERSION > 132427 && defined __i386__) \
+    || (__LINUX_KERNEL_VERSION > 132609 && defined __x86_64__) \
+    || (__LINUX_KERNEL_VERSION >= 132609 && defined __powerpc__) \
+    || (__LINUX_KERNEL_VERSION >= 132609 && defined __sh__)
+# define __ASSUME_UTIMES	1
+#endif
+
+// XXX Disabled for now since the semantics we want is not achieved.
+#if 0
+/* The CLONE_STOPPED flag was introduced in the 2.6.0-test1 series.  */
+#if __LINUX_KERNEL_VERSION >= 132609
+# define __ASSUME_CLONE_STOPPED	1
+#endif
+#endif
+
+/* The fixed version of the posix_fadvise64 syscall appeared in
+   2.6.0-test3.  At least for x86.  Powerpc support appeared in
+   2.6.2, but for 32-bit userspace only.  */
+#if (__LINUX_KERNEL_VERSION >= 132609 && defined __i386__) \
+    || (__LINUX_KERNEL_VERSION >= 132610 && defined __powerpc__ \
+       && !defined __powerpc64__)
+# define __ASSUME_FADVISE64_64_SYSCALL	1
+#endif
+
+/* The PROT_GROWSDOWN/PROT_GROWSUP flags were introduced in the 2.6.0-test
+   series.  */
+#if __LINUX_KERNEL_VERSION >= 132609
+# define __ASSUME_PROT_GROWSUPDOWN	1
+#endif
+
+/* Starting with 2.6.0 PowerPC adds signal/swapcontext support for Vector
+   SIMD (AKA Altivec, VMX) instructions and register state.  This changes
+   the overall size of the sigcontext and adds the swapcontext syscall.  */
+#if __LINUX_KERNEL_VERSION >= 132608 && defined __powerpc__
+# define __ASSUME_SWAPCONTEXT_SYSCALL	1
+#endif
+
+/* The CLONE_DETACHED flag is not necessary in 2.6.2 kernels, it is
+   implied.  */
+#if __LINUX_KERNEL_VERSION >= 132610
+# define __ASSUME_NO_CLONE_DETACHED	1
+#endif
+
+/* Starting with version 2.6.4-rc1 the getdents syscall returns d_type
+   information as well and in between 2.6.5 and 2.6.8 most compat wrappers
+   were fixed too.  Except s390{,x} which was fixed in 2.6.11.  */
+#if (__LINUX_KERNEL_VERSION >= 0x020608 && !defined __s390__) \
+    || (__LINUX_KERNEL_VERSION >= 0x02060b && defined __s390__)
+# define __ASSUME_GETDENTS32_D_TYPE	1
+#endif
+
+/* Starting with version 2.5.3, the initial location returned by `brk'
+   after exec is always rounded up to the next page.  */
+#if __LINUX_KERNEL_VERSION >= 132355
+# define __ASSUME_BRK_PAGE_ROUNDED	1
+#endif
+
+/* Starting with version 2.6.9, the waitid system call is available.
+   Except for powerpc and powerpc64, where it is available in 2.6.12.  */
+#if (__LINUX_KERNEL_VERSION >= 0x020609 && !defined __powerpc__) \
+    || (__LINUX_KERNEL_VERSION >= 0x02060c && defined __powerpc__)
+# define __ASSUME_WAITID_SYSCALL	1
+#endif
+
+/* Starting with version 2.6.9, SSI_IEEE_RAISE_EXCEPTION exists.  */
+#if __LINUX_KERNEL_VERSION >= 0x020609 && defined __alpha__
+#define __ASSUME_IEEE_RAISE_EXCEPTION	1
+#endif
+
+/* Support for the accept4 syscall was added in 2.6.28.  */
+#if __LINUX_KERNEL_VERSION >= 0x02061c \
+    && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
+        || defined __sparc__ || defined __s390__)
+# define __ASSUME_ACCEPT4       1
+#endif
+
+/* Support for the accept4 syscall for alpha was added after 2.6.33-rc1.  */
+#if __LINUX_KERNEL_VERSION >= 0x020621 && defined __alpha__
+# define __ASSUME_ACCEPT4       1
+#endif
+
+/* Support for the FUTEX_CLOCK_REALTIME flag was added in 2.6.29.  */
+#if __LINUX_KERNEL_VERSION >= 0x02061d
+# define __ASSUME_FUTEX_CLOCK_REALTIME	1
+#endif
+
+/* Support for PI futexes was added in 2.6.18.  */
+#if __LINUX_KERNEL_VERSION >= 0x020612
+# define __ASSUME_FUTEX_LOCK_PI	1
+#endif
+
+/* Support for private futexes was added in 2.6.22.  */
+#if __LINUX_KERNEL_VERSION >= 0x020616
+# define __ASSUME_PRIVATE_FUTEX	1
+#endif
+
+/* getcpu is a syscall for x86-64 since 3.1.  */
+#if defined __x86_64__ && __LINUX_KERNEL_VERSION >= 0x030100
+# define __ASSUME_GETCPU_SYSCALL        1
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel_sigaction.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel_sigaction.h
new file mode 100644
index 0000000..0a35ac8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel_sigaction.h
@@ -0,0 +1,36 @@
+#ifndef _BITS_SIGACTION_STRUCT_H
+#define _BITS_SIGACTION_STRUCT_H
+
+/* This file provides whatever this particular arch's kernel thinks
+ * the sigaction struct should look like... */
+
+
+#if defined(__ia64__)
+
+#undef HAVE_SA_RESTORER
+
+#else
+
+#define HAVE_SA_RESTORER
+/* This is the sigaction structure from the Linux 2.1.20 kernel.  */
+struct old_kernel_sigaction {
+	__sighandler_t k_sa_handler;
+	unsigned long sa_mask;
+	unsigned long sa_flags;
+	void (*sa_restorer)(void);
+};
+/* In uclibc, userspace struct sigaction is identical to
+ * "new" struct kernel_sigaction (one from the Linux 2.1.68 kernel).
+ * See sigaction.h
+ */
+
+extern int __syscall_sigaction(int, const struct old_kernel_sigaction *,
+	struct old_kernel_sigaction *);
+
+#endif
+
+
+extern int __syscall_rt_sigaction(int, const struct sigaction *,
+	struct sigaction *, size_t);
+
+#endif /* _BITS_SIGACTION_STRUCT_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel_stat.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel_stat.h
new file mode 100644
index 0000000..571c08f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel_stat.h
@@ -0,0 +1,2 @@
+/* bits/kernel_stat.h is architecture specific.  */
+#error "This file must be supplied by every Linux architecture."
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel_types.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel_types.h
new file mode 100644
index 0000000..1c23ebf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/kernel_types.h
@@ -0,0 +1,20 @@
+#ifndef _BITS_KERNEL_TYPES_H
+#define _BITS_KERNEL_TYPES_H
+
+/* Sigh.  We need to carefully wrap this one...  No guarantees
+ * that the asm/posix_types.h kernel header is working.  Many
+ * arches have broken headers that introduce tons of gratuitous
+ * conflicts with uClibc's namespace.   See bits/kernel_types.h
+ * for i386, arm, etc for examples... */
+#warning You really should include a proper bits/kernel_types.h for your architecture
+
+#ifndef __GLIBC__
+#define __GLIBC__ 2
+#include <asm/posix_types.h>
+#undef __GLIBC__
+#else
+#include <asm/posix_types.h>
+#endif
+
+
+#endif /* _BITS_KERNEL_TYPES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/local_lim.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/local_lim.h
new file mode 100644
index 0000000..a263b5d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/local_lim.h
@@ -0,0 +1,95 @@
+/* Minimum guaranteed maximum values for system limits.  Linux version.
+   Copyright (C) 1993-1998,2000,2002-2004,2008 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* The kernel header pollutes the namespace with the NR_OPEN symbol
+   and defines LINK_MAX although filesystems have different maxima.  A
+   similar thing is true for OPEN_MAX: the limit can be changed at
+   runtime and therefore the macro must not be defined.  Remove this
+   after including the header if necessary.  */
+#ifndef NR_OPEN
+# define __undef_NR_OPEN
+#endif
+#ifndef LINK_MAX
+# define __undef_LINK_MAX
+#endif
+#ifndef OPEN_MAX
+# define __undef_OPEN_MAX
+#endif
+#ifndef ARG_MAX
+# define __undef_ARG_MAX
+#endif
+
+/* The kernel sources contain a file with all the needed information.  */
+#include <linux/limits.h>
+
+/* Have to remove NR_OPEN?  */
+#ifdef __undef_NR_OPEN
+# undef NR_OPEN
+# undef __undef_NR_OPEN
+#endif
+/* Have to remove LINK_MAX?  */
+#ifdef __undef_LINK_MAX
+# undef LINK_MAX
+# undef __undef_LINK_MAX
+#endif
+/* Have to remove OPEN_MAX?  */
+#ifdef __undef_OPEN_MAX
+# undef OPEN_MAX
+# undef __undef_OPEN_MAX
+#endif
+/* Have to remove ARG_MAX?  */
+#ifdef __undef_ARG_MAX
+# undef ARG_MAX
+# undef __undef_ARG_MAX
+#endif
+
+/* The number of data keys per process.  */
+#define _POSIX_THREAD_KEYS_MAX	128
+/* This is the value this implementation supports.  */
+#define PTHREAD_KEYS_MAX	1024
+
+/* Controlling the iterations of destructors for thread-specific data.  */
+#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS	4
+/* Number of iterations this implementation does.  */
+#define PTHREAD_DESTRUCTOR_ITERATIONS	_POSIX_THREAD_DESTRUCTOR_ITERATIONS
+
+/* The number of threads per process.  */
+#define _POSIX_THREAD_THREADS_MAX	64
+
+/* Maximum amount by which a process can descrease its asynchronous I/O
+   priority level.  */
+#define AIO_PRIO_DELTA_MAX	20
+
+/* Minimum size for a thread.  We are free to choose a reasonable value.  */
+#define PTHREAD_STACK_MIN	16384
+
+/* Maximum number of timer expiration overruns.  */
+#define DELAYTIMER_MAX	2147483647
+
+/* Maximum tty name length.  */
+#define TTY_NAME_MAX		32
+
+/* Maximum login name length.  This is arbitrary.  */
+#define LOGIN_NAME_MAX		256
+
+/* Maximum host name length.  */
+#define HOST_NAME_MAX		64
+
+/* Maximum message queue priority level.  */
+#define MQ_PRIO_MAX		32768
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/locale.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/locale.h
new file mode 100644
index 0000000..50064b5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/locale.h
@@ -0,0 +1,44 @@
+/* Definition of locale category symbol values.
+   Copyright (C) 2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if !defined _LOCALE_H && !defined _LANGINFO_H
+# error "Never use <bits/locale.h> directly; include <locale.h> instead."
+#endif
+
+#ifndef _BITS_LOCALE_H
+#define _BITS_LOCALE_H	1
+
+enum
+{
+  __LC_CTYPE = 0,
+  __LC_NUMERIC = 1,
+  __LC_TIME = 2,
+  __LC_COLLATE = 3,
+  __LC_MONETARY = 4,
+  __LC_MESSAGES = 5,
+  __LC_ALL = 6,
+  __LC_PAPER = 7,
+  __LC_NAME = 8,
+  __LC_ADDRESS = 9,
+  __LC_TELEPHONE = 10,
+  __LC_MEASUREMENT = 11,
+  __LC_IDENTIFICATION = 12
+};
+
+#endif	/* bits/locale.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/mathcalls.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mathcalls.h
new file mode 100644
index 0000000..013d2b2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mathcalls.h
@@ -0,0 +1,380 @@
+/* Prototype declarations for math functions; helper file for <math.h>.
+   Copyright (C) 1996-2002, 2003, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* NOTE: Because of the special way this file is used by <math.h>, this
+   file must NOT be protected from multiple inclusion as header files
+   usually are.
+
+   This file provides prototype declarations for the math functions.
+   Most functions are declared using the macro:
+
+   __MATHCALL (NAME,[_r], (ARGS...))
+
+   This means there is a function `NAME' returning `double' and a function
+   `NAMEf' returning `float'.  Each place `_Mdouble_' appears in the
+   prototype, that is actually `double' in the prototype for `NAME' and
+   `float' in the prototype for `NAMEf'.  Reentrant variant functions are
+   called `NAME_r' and `NAMEf_r'.
+
+   Functions returning other types like `int' are declared using the macro:
+
+   __MATHDECL (TYPE, NAME,[_r], (ARGS...))
+
+   This is just like __MATHCALL but for a function returning `TYPE'
+   instead of `_Mdouble_'.  In all of these cases, there is still
+   both a `NAME' and a `NAMEf' that takes `float' arguments.
+
+   Note that there must be no whitespace before the argument passed for
+   NAME, to make token pasting work with -traditional.  */
+
+#ifndef _MATH_H
+# error "Never include <bits/mathcalls.h> directly; include <math.h> instead."
+#endif
+
+
+/* __MATHCALLX(type,function,[suffix],args,attrib) and
+ * __MATHCALLI(type,function,[suffix],args) include libm_hidden_def
+ * (for "double" versions only, xxxf and xxxl do not get this treatment).
+ *
+ * __MATHDECL(type,function,[suffix],args) does not.
+ * __MATHCALL(function,[suffix],args) also does not
+ * (it is just a shortcut to __MATHDECL(_Mdouble_,function,[suffix],args)).
+ *
+ * __MATHDECL_PRIV(type,function,[suffix],args,attrib)
+ * includes libm_hidden_def (always) and declares __foo, not foo.
+ */
+
+
+/* Trigonometric functions.  */
+
+_Mdouble_BEGIN_NAMESPACE
+/* Arc cosine of X.  */
+__MATHCALLI (acos,, (_Mdouble_ __x))
+/* Arc sine of X.  */
+__MATHCALLI (asin,, (_Mdouble_ __x))
+/* Arc tangent of X.  */
+__MATHCALLI (atan,, (_Mdouble_ __x))
+/* Arc tangent of Y/X.  */
+__MATHCALLI (atan2,, (_Mdouble_ __y, _Mdouble_ __x))
+
+/* Cosine of X.  */
+__MATHCALLI (cos,, (_Mdouble_ __x))
+/* Sine of X.  */
+__MATHCALLI (sin,, (_Mdouble_ __x))
+/* Tangent of X.  */
+__MATHCALLI (tan,, (_Mdouble_ __x))
+
+/* Hyperbolic functions.  */
+
+/* Hyperbolic cosine of X.  */
+__MATHCALLI (cosh,, (_Mdouble_ __x))
+/* Hyperbolic sine of X.  */
+__MATHCALLI (sinh,, (_Mdouble_ __x))
+/* Hyperbolic tangent of X.  */
+__MATHCALLI (tanh,, (_Mdouble_ __x))
+_Mdouble_END_NAMESPACE
+
+#if defined __USE_GNU
+/* Cosine and sine of X.  */
+__MATHDECL (void,sincos,,
+	    (_Mdouble_ __x, _Mdouble_ *__sinx, _Mdouble_ *__cosx))
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Hyperbolic arc cosine of X.  */
+__MATHCALLI (acosh,, (_Mdouble_ __x))
+/* Hyperbolic arc sine of X.  */
+__MATHCALLI (asinh,, (_Mdouble_ __x))
+/* Hyperbolic arc tangent of X.  */
+__MATHCALLI (atanh,, (_Mdouble_ __x))
+__END_NAMESPACE_C99
+#endif
+
+/* Exponential and logarithmic functions.  */
+
+_Mdouble_BEGIN_NAMESPACE
+/* Exponential function of X.  */
+__MATHCALLI (exp,, (_Mdouble_ __x))
+
+/* Break VALUE into a normalized fraction and an integral power of 2.  */
+__MATHCALLI (frexp,, (_Mdouble_ __x, int *__exponent))
+
+/* X times (two to the EXP power).  */
+__MATHCALLI (ldexp,, (_Mdouble_ __x, int __exponent))
+
+/* Natural logarithm of X.  */
+__MATHCALLI (log,, (_Mdouble_ __x))
+
+/* Base-ten logarithm of X.  */
+__MATHCALLI (log10,, (_Mdouble_ __x))
+
+/* Break VALUE into integral and fractional parts.  */
+__MATHCALLI (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr))
+_Mdouble_END_NAMESPACE
+
+#if 0 /*def __USE_GNU*/
+/* A function missing in all standards: compute exponent to base ten.  */
+__MATHCALL (exp10,, (_Mdouble_ __x))
+/* Another name occasionally used.  */
+__MATHCALL (pow10,, (_Mdouble_ __x))
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return exp(X) - 1.  */
+__MATHCALLI (expm1,, (_Mdouble_ __x))
+
+/* Return log(1 + X).  */
+__MATHCALLI (log1p,, (_Mdouble_ __x))
+
+/* Return the base 2 signed integral exponent of X.  */
+__MATHCALLI (logb,, (_Mdouble_ __x))
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Compute base-2 exponential of X.  */
+__MATHCALLI (exp2,, (_Mdouble_ __x))
+
+/* Compute base-2 logarithm of X.  */
+__MATHCALL (log2,, (_Mdouble_ __x))
+__END_NAMESPACE_C99
+#endif
+
+
+/* Power functions.  */
+
+_Mdouble_BEGIN_NAMESPACE
+/* Return X to the Y power.  */
+__MATHCALLI (pow,, (_Mdouble_ __x, _Mdouble_ __y))
+
+/* Return the square root of X.  */
+__MATHCALLI (sqrt,, (_Mdouble_ __x))
+_Mdouble_END_NAMESPACE
+
+#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return `sqrt(X*X + Y*Y)'.  */
+__MATHCALLI (hypot,, (_Mdouble_ __x, _Mdouble_ __y))
+__END_NAMESPACE_C99
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return the cube root of X.  */
+__MATHCALLI (cbrt,, (_Mdouble_ __x))
+__END_NAMESPACE_C99
+#endif
+
+
+/* Nearest integer, absolute value, and remainder functions.  */
+
+_Mdouble_BEGIN_NAMESPACE
+/* Smallest integral value not less than X.  */
+__MATHCALLX (ceil,, (_Mdouble_ __x), (__const__))
+
+/* Absolute value of X.  */
+__MATHCALLX (fabs,, (_Mdouble_ __x), (__const__))
+
+/* Largest integer not greater than X.  */
+__MATHCALLX (floor,, (_Mdouble_ __x), (__const__))
+
+/* Floating-point modulo remainder of X/Y.  */
+__MATHCALLI (fmod,, (_Mdouble_ __x, _Mdouble_ __y))
+
+
+/* Return 0 if VALUE is finite or NaN, +1 if it
+   is +Infinity, -1 if it is -Infinity.  */
+__MATHDECL_PRIV (int,isinf,, (_Mdouble_ __value), (__const__))
+
+/* Return nonzero if VALUE is finite and not NaN.  */
+__MATHDECL_PRIV (int,finite,, (_Mdouble_ __value), (__const__))
+_Mdouble_END_NAMESPACE
+
+#ifdef __USE_MISC
+#if 0
+/* Return 0 if VALUE is finite or NaN, +1 if it
+   is +Infinity, -1 if it is -Infinity.  */
+__MATHDECL_PRIV (int,isinf,, (_Mdouble_ __value), (__const__))
+
+/* Return nonzero if VALUE is finite and not NaN.  */
+__MATHDECL_PRIV (int,finite,, (_Mdouble_ __value), (__const__))
+#endif
+/* Return the remainder of X/Y.  */
+__MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y))
+
+
+/* Return the fractional part of X after dividing out `ilogb (X)'.  */
+__MATHCALL (significand,, (_Mdouble_ __x))
+#endif /* Use misc.  */
+
+#if defined __USE_MISC || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return X with its signed changed to Y's.  */
+__MATHCALLX (copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__))
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return representation of NaN for double type.  */
+__MATHCALLX (nan,, (__const char *__tagb), (__const__))
+__END_NAMESPACE_C99
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
+/* Return nonzero if VALUE is not a number.  */
+__BEGIN_NAMESPACE_C99
+__MATHDECL_PRIV (int,isnan,, (_Mdouble_ __value), (__const__))
+__END_NAMESPACE_C99
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN
+# ifdef __DO_XSI_MATH__
+/* Bessel functions.  */
+__MATHCALL (j0,, (_Mdouble_))
+__MATHCALL (j1,, (_Mdouble_))
+__MATHCALL (jn,, (int, _Mdouble_))
+__MATHCALL (y0,, (_Mdouble_))
+__MATHCALL (y1,, (_Mdouble_))
+__MATHCALL (yn,, (int, _Mdouble_))
+# endif
+#endif
+
+
+#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Error and gamma functions.  */
+__MATHCALLI (erf,, (_Mdouble_))
+__MATHCALLI (erfc,, (_Mdouble_))
+__MATHCALLI (lgamma,, (_Mdouble_))
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* True gamma function.  */
+__MATHCALLI (tgamma,, (_Mdouble_))
+__END_NAMESPACE_C99
+#endif
+
+#if defined __USE_MISC || defined __USE_XOPEN
+/* Obsolete alias for `lgamma'.  */
+__MATHCALL (gamma,, (_Mdouble_))
+#endif
+
+#ifdef __USE_MISC
+/* Reentrant version of lgamma.  This function uses the global variable
+   `signgam'.  The reentrant version instead takes a pointer and stores
+   the value through it.  */
+__MATHCALL (lgamma,_r, (_Mdouble_, int *__signgamp))
+#endif
+
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Return the integer nearest X in the direction of the
+   prevailing rounding mode.  */
+__MATHCALLI (rint,, (_Mdouble_ __x))
+
+/* Return X + epsilon if X < Y, X - epsilon if X > Y.  */
+__MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__))
+# if defined __USE_ISOC99 && !defined __LDBL_COMPAT
+__MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__))
+# endif
+
+/* Return the remainder of integer divison X / Y with infinite precision.  */
+__MATHCALLI (remainder,, (_Mdouble_ __x, _Mdouble_ __y))
+
+# if defined __USE_MISC || defined __USE_ISOC99
+/* Return X times (2 to the Nth power).  */
+__MATHCALLI (scalbn,, (_Mdouble_ __x, int __n))
+# endif
+
+/* Return the binary exponent of X, which must be nonzero.  */
+__MATHDECLI (int,ilogb,, (_Mdouble_ __x))
+#endif
+
+#ifdef __USE_ISOC99
+/* Return X times (2 to the Nth power).  */
+__MATHCALLI (scalbln,, (_Mdouble_ __x, long int __n))
+
+/* Round X to integral value in floating-point format using current
+   rounding direction, but do not raise inexact exception.  */
+__MATHCALLI (nearbyint,, (_Mdouble_ __x))
+
+/* Round X to nearest integral value, rounding halfway cases away from
+   zero.  */
+__MATHCALLX (round,, (_Mdouble_ __x), (__const__))
+
+/* Round X to the integral value in floating-point format nearest but
+   not larger in magnitude.  */
+__MATHCALLX (trunc,, (_Mdouble_ __x), (__const__))
+
+/* Compute remainder of X and Y and put in *QUO a value with sign of x/y
+   and magnitude congruent `mod 2^n' to the magnitude of the integral
+   quotient x/y, with n >= 3.  */
+__MATHCALLI (remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo))
+
+
+/* Conversion functions.  */
+
+/* Round X to nearest integral value according to current rounding
+   direction.  */
+__MATHDECLI (long int,lrint,, (_Mdouble_ __x))
+__MATHDECLI (long long int,llrint,, (_Mdouble_ __x))
+
+/* Round X to nearest integral value, rounding halfway cases away from
+   zero.  */
+__MATHDECLI (long int,lround,, (_Mdouble_ __x))
+__MATHDECLI (long long int,llround,, (_Mdouble_ __x))
+
+
+/* Return positive difference between X and Y.  */
+__MATHCALLI (fdim,, (_Mdouble_ __x, _Mdouble_ __y))
+
+/* Return maximum numeric value from X and Y.  */
+__MATHCALLI (fmax,, (_Mdouble_ __x, _Mdouble_ __y))
+
+/* Return minimum numeric value from X and Y.  */
+__MATHCALLI (fmin,, (_Mdouble_ __x, _Mdouble_ __y))
+
+
+/* Classify given number.  */
+__MATHDECL_PRIV (int, fpclassify,, (_Mdouble_ __value), (__const__))
+
+/* Test for negative number.  */
+__MATHDECL_PRIV (int, signbit,, (_Mdouble_ __value), (__const__))
+
+
+/* Multiply-add function computed as a ternary operation.  */
+__MATHCALLI (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z))
+#endif /* Use ISO C99.  */
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
+__END_NAMESPACE_C99
+#endif
+
+#if (defined __USE_MISC || defined __USE_XOPEN_EXTENDED) \
+	&& defined __UCLIBC_SUSV3_LEGACY__
+/* Return X times (2 to the Nth power).  */
+__MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n))
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/mathdef.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mathdef.h
new file mode 100644
index 0000000..00c6724
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mathdef.h
@@ -0,0 +1,43 @@
+/* Copyright (C) 1997, 1998, 1999, 2000, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if !defined _MATH_H && !defined _COMPLEX_H
+# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
+#endif
+
+#if defined  __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
+# define _MATH_H_MATHDEF	1
+
+/* Normally, there is no long double type and the `float' and `double'
+   expressions are evaluated as `double'.  */
+typedef double float_t;		/* `float' expressions are evaluated as
+				   `double'.  */
+typedef double double_t;	/* `double' expressions are evaluated as
+				   `double'.  */
+
+/* The values returned by `ilogb' for 0 and NaN respectively.  */
+# define FP_ILOGB0	(-2147483647)
+# define FP_ILOGBNAN	2147483647
+
+#endif	/* ISO C99 */
+
+#ifndef __NO_LONG_DOUBLE_MATH
+/* Signal that we do not really have a `long double'.  The disables the
+   declaration of all the `long double' function variants.  */
+# define __NO_LONG_DOUBLE_MATH	1
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/mathinline.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mathinline.h
new file mode 100644
index 0000000..5498af6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mathinline.h
@@ -0,0 +1,12 @@
+/* This file should provide inline versions of math functions.
+
+   Surround GCC-specific parts with #ifdef __GNUC__, and use `extern __inline'.
+
+   This file should define __MATH_INLINES if functions are actually defined as
+   inlines.  */
+
+#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
+
+/* Here goes the real code.  */
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/mman-common.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mman-common.h
new file mode 100644
index 0000000..f00cb1a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mman-common.h
@@ -0,0 +1,109 @@
+/* Definitions for POSIX memory map interface.  Linux/generic version.
+   Copyright (C) 1997,2000,2003,2005,2006,2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_MMAN_H
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
+#endif
+
+/* The following definitions basically come from the kernel headers.
+   But the kernel header is not namespace clean.  */
+
+
+/* Protections are chosen from these bits, OR'd together.  The
+   implementation does not necessarily support PROT_EXEC or PROT_WRITE
+   without PROT_READ.  The only guarantees are that no writing will be
+   allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
+
+#define PROT_READ	0x1		/* Page can be read.  */
+#define PROT_WRITE	0x2		/* Page can be written.  */
+#define PROT_EXEC	0x4		/* Page can be executed.  */
+#define PROT_NONE	0x0		/* Page can not be accessed.  */
+#define PROT_GROWSDOWN	0x01000000	/* Extend change to start of
+					   growsdown vma (mprotect only).  */
+#define PROT_GROWSUP	0x02000000	/* Extend change to start of
+					   growsup vma (mprotect only).  */
+
+/* Sharing types (must choose one and only one of these).  */
+#define MAP_SHARED	0x01		/* Share changes.  */
+#define MAP_PRIVATE	0x02		/* Changes are private.  */
+#ifdef __USE_MISC
+# define MAP_TYPE	0x0f		/* Mask for type of mapping.  */
+#endif
+
+/* Other flags.  */
+#define MAP_FIXED	0x10		/* Interpret addr exactly.  */
+#ifdef __USE_MISC
+# define MAP_FILE	0
+# define MAP_ANONYMOUS	0x20		/* Don't use a file.  */
+# define MAP_ANON	MAP_ANONYMOUS
+#endif
+
+/* These are Linux-specific.  */
+#ifdef __USE_MISC
+# define MAP_GROWSDOWN	0x00100		/* Stack-like segment.  */
+# define MAP_DENYWRITE	0x00800		/* ETXTBSY */
+# define MAP_EXECUTABLE	0x01000		/* Mark it as an executable.  */
+# define MAP_LOCKED	0x02000		/* Lock the mapping.  */
+# define MAP_NORESERVE	0x04000		/* Don't check for reservations.  */
+# define MAP_POPULATE	0x08000		/* Populate (prefault) pagetables.  */
+# define MAP_NONBLOCK	0x10000		/* Do not block on IO.  */
+# define MAP_STACK	0x20000		/* Allocation is for a stack.  */
+# define MAP_UNINITIALIZE 0x4000000     /* For anonymous mmap, memory could
+					   be uninitialized. */
+#endif
+
+/* Flags to `msync'.  */
+#define MS_ASYNC	1		/* Sync memory asynchronously.  */
+#define MS_SYNC		4		/* Synchronous memory sync.  */
+#define MS_INVALIDATE	2		/* Invalidate the caches.  */
+
+/* Flags for `mlockall'.  */
+#define MCL_CURRENT	1		/* Lock all currently mapped pages.  */
+#define MCL_FUTURE	2		/* Lock all additions to address
+					   space.  */
+
+/* Flags for `mremap'.  */
+#ifdef __USE_GNU
+# define MREMAP_MAYMOVE	1
+# define MREMAP_FIXED	2
+#endif
+
+/* Advice to `madvise'.  */
+#ifdef __USE_BSD
+# define MADV_NORMAL	  0	/* No further special treatment.  */
+# define MADV_RANDOM	  1	/* Expect random page references.  */
+# define MADV_SEQUENTIAL  2	/* Expect sequential page references.  */
+# define MADV_WILLNEED	  3	/* Will need these pages.  */
+# define MADV_DONTNEED	  4	/* Don't need these pages.  */
+# define MADV_REMOVE	  9	/* Remove these pages and resources.  */
+# define MADV_DONTFORK	  10	/* Do not inherit across fork.  */
+# define MADV_DOFORK	  11	/* Do inherit across fork.  */
+# define MADV_MERGEABLE	  12	/* KSM may merge identical pages.  */
+# define MADV_UNMERGEABLE 13	/* KSM may not merge identical pages.  */
+# define MADV_HWPOISON	  100	/* Poison a page for testing.  */
+#endif
+
+/* The POSIX people had to invent similar names for the same things.  */
+#ifdef __USE_XOPEN2K
+# define POSIX_MADV_NORMAL	0 /* No further special treatment.  */
+# define POSIX_MADV_RANDOM	1 /* Expect random page references.  */
+# define POSIX_MADV_SEQUENTIAL	2 /* Expect sequential page references.  */
+# define POSIX_MADV_WILLNEED	3 /* Will need these pages.  */
+# define POSIX_MADV_DONTNEED	4 /* Don't need these pages.  */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/mman.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mman.h
new file mode 100644
index 0000000..11b8e2a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mman.h
@@ -0,0 +1 @@
+#include <bits/mman-common.h>
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/mqueue.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mqueue.h
new file mode 100644
index 0000000..df528f8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/mqueue.h
@@ -0,0 +1,32 @@
+/* Copyright (C) 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _MQUEUE_H
+# error "Never use <bits/mqueue.h> directly; include <mqueue.h> instead."
+#endif
+
+typedef int mqd_t;
+
+struct mq_attr
+{
+  long int mq_flags;	/* Message queue flags.  */
+  long int mq_maxmsg;	/* Maximum number of messages.  */
+  long int mq_msgsize;	/* Maximum message size.  */
+  long int mq_curmsgs;	/* Number of messages currently queued.  */
+  long int __pad[4];
+};
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/msq.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/msq.h
new file mode 100644
index 0000000..32a49b5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/msq.h
@@ -0,0 +1,77 @@
+/* Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_MSG_H
+# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Define options for message queue functions.  */
+#define MSG_NOERROR	010000	/* no error if message is too big */
+#ifdef __USE_GNU
+# define MSG_EXCEPT	020000	/* recv any msg except of specified type */
+#endif
+
+/* Types used in the structure definition.  */
+typedef unsigned long int msgqnum_t;
+typedef unsigned long int msglen_t;
+
+
+/* Structure of record for one message inside the kernel.
+   The type `struct msg' is opaque.  */
+struct msqid_ds
+{
+  struct ipc_perm msg_perm;	/* structure describing operation permission */
+  __time_t msg_stime;		/* time of last msgsnd command */
+  unsigned long int __unused1;
+  __time_t msg_rtime;		/* time of last msgrcv command */
+  unsigned long int __unused2;
+  __time_t msg_ctime;		/* time of last change */
+  unsigned long int __unused3;
+  unsigned long int __msg_cbytes; /* current number of bytes on queue */
+  msgqnum_t msg_qnum;		/* number of messages currently on queue */
+  msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
+  __pid_t msg_lspid;		/* pid of last msgsnd() */
+  __pid_t msg_lrpid;		/* pid of last msgrcv() */
+  unsigned long int __unused4;
+  unsigned long int __unused5;
+};
+
+#ifdef __USE_MISC
+
+# define msg_cbytes	__msg_cbytes
+
+/* ipcs ctl commands */
+# define MSG_STAT 11
+# define MSG_INFO 12
+
+/* buffer for msgctl calls IPC_INFO, MSG_INFO */
+struct msginfo
+  {
+    int msgpool;
+    int msgmap;
+    int msgmax;
+    int msgmnb;
+    int msgmni;
+    int msgssz;
+    int msgtql;
+    unsigned short int msgseg;
+  };
+
+#endif /* __USE_MISC */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/nan.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/nan.h
new file mode 100644
index 0000000..bae97f2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/nan.h
@@ -0,0 +1,53 @@
+/* `NAN' constant for IEEE 754 machines.
+   Copyright (C) 1992,1996,1997,1999,2004,2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _MATH_H
+# error "Never use <bits/nan.h> directly; include <math.h> instead."
+#endif
+
+
+/* IEEE Not A Number.  */
+
+#if __GNUC_PREREQ(3,3)
+
+# define NAN	(__builtin_nanf (""))
+
+#elif defined __GNUC__
+
+# define NAN \
+  (__extension__							      \
+   ((union { unsigned __l __attribute__ ((__mode__ (__SI__))); float __d; })  \
+    { __l: 0x7fc00000UL }).__d)
+
+#else
+
+# include <endian.h>
+
+# if __BYTE_ORDER == __BIG_ENDIAN
+#  define __nan_bytes		{ 0x7f, 0xc0, 0, 0 }
+# endif
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+#  define __nan_bytes		{ 0, 0, 0xc0, 0x7f }
+# endif
+
+static union { unsigned char __c[4]; float __d; } __nan_union
+    __attribute_used__ = { __nan_bytes };
+# define NAN	(__nan_union.__d)
+
+#endif	/* GCC.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/netdb.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/netdb.h
new file mode 100644
index 0000000..41dc731
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/netdb.h
@@ -0,0 +1,33 @@
+/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _NETDB_H
+# error "Never include <bits/netdb.h> directly; use <netdb.h> instead."
+#endif
+
+
+/* Description of data base entry for a single network.  NOTE: here a
+   poor assumption is made.  The network number is expected to fit
+   into an unsigned long int variable.  */
+struct netent
+{
+  char *n_name;			/* Official name of network.  */
+  char **n_aliases;		/* Alias list.  */
+  int n_addrtype;		/* Net address type.  */
+  uint32_t n_net;		/* Network number.  */
+};
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/poll.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/poll.h
new file mode 100644
index 0000000..d7996b4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/poll.h
@@ -0,0 +1,50 @@
+/* Copyright (C) 1997, 2001, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_POLL_H
+# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
+#endif
+
+/* Event types that can be polled for.  These bits may be set in `events'
+   to indicate the interesting event types; they will appear in `revents'
+   to indicate the status of the file descriptor.  */
+#define POLLIN		0x001		/* There is data to read.  */
+#define POLLPRI		0x002		/* There is urgent data to read.  */
+#define POLLOUT		0x004		/* Writing now will not block.  */
+
+#ifdef __USE_XOPEN
+/* These values are defined in XPG4.2.  */
+# define POLLRDNORM	0x040		/* Normal data may be read.  */
+# define POLLRDBAND	0x080		/* Priority data may be read.  */
+# define POLLWRNORM	0x100		/* Writing now will not block.  */
+# define POLLWRBAND	0x200		/* Priority data may be written.  */
+#endif
+
+#ifdef __USE_GNU
+/* These are extensions for Linux.  */
+# define POLLMSG	0x400
+# define POLLREMOVE	0x1000
+# define POLLRDHUP	0x2000
+#endif
+
+/* Event types always implicitly polled for.  These bits need not be set in
+   `events', but they will appear in `revents' to indicate the status of
+   the file descriptor.  */
+#define POLLERR		0x008		/* Error condition.  */
+#define POLLHUP		0x010		/* Hung up.  */
+#define POLLNVAL	0x020		/* Invalid polling request.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/posix1_lim.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/posix1_lim.h
new file mode 100644
index 0000000..3c86dce
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/posix1_lim.h
@@ -0,0 +1,169 @@
+/* Copyright (C) 1991-1993,96,98,2000-2003,2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/*
+ *	POSIX Standard: 2.9.2 Minimum Values	Added to <limits.h>
+ *
+ *	Never include this file directly; use <limits.h> instead.
+ */
+
+#ifndef	_BITS_POSIX1_LIM_H
+#define	_BITS_POSIX1_LIM_H	1
+
+
+/* These are the standard-mandated minimum values.  */
+
+/* Minimum number of operations in one list I/O call.  */
+#define _POSIX_AIO_LISTIO_MAX	2
+
+/* Minimal number of outstanding asynchronous I/O operations.  */
+#define _POSIX_AIO_MAX		1
+
+/* Maximum length of arguments to `execve', including environment.  */
+#define	_POSIX_ARG_MAX		4096
+
+/* Maximum simultaneous processes per real user ID.  */
+#ifdef __USE_XOPEN2K
+# define _POSIX_CHILD_MAX	25
+#else
+# define _POSIX_CHILD_MAX	6
+#endif
+
+/* Minimal number of timer expiration overruns.  */
+#define _POSIX_DELAYTIMER_MAX	32
+
+/* Maximum length of a host name (not including the terminating null)
+   as returned from the GETHOSTNAME function.  */
+#define _POSIX_HOST_NAME_MAX	255
+
+/* Maximum link count of a file.  */
+#define	_POSIX_LINK_MAX		8
+
+/* Maximum length of login name.  */
+#define	_POSIX_LOGIN_NAME_MAX	9
+
+/* Number of bytes in a terminal canonical input queue.  */
+#define	_POSIX_MAX_CANON	255
+
+/* Number of bytes for which space will be
+   available in a terminal input queue.  */
+#define	_POSIX_MAX_INPUT	255
+
+/* Maximum number of message queues open for a process.  */
+#define _POSIX_MQ_OPEN_MAX	8
+
+/* Maximum number of supported message priorities.  */
+#define _POSIX_MQ_PRIO_MAX	32
+
+/* Number of bytes in a filename.  */
+#define	_POSIX_NAME_MAX		14
+
+/* Number of simultaneous supplementary group IDs per process.  */
+#ifdef __USE_XOPEN2K
+# define _POSIX_NGROUPS_MAX	8
+#else
+# define _POSIX_NGROUPS_MAX	0
+#endif
+
+/* Number of files one process can have open at once.  */
+#ifdef __USE_XOPEN2K
+# define _POSIX_OPEN_MAX	20
+#else
+# define _POSIX_OPEN_MAX	16
+#endif
+
+/* Number of descriptors that a process may examine with `pselect' or
+   `select'.  */
+#define	_POSIX_FD_SETSIZE	_POSIX_OPEN_MAX
+
+/* Number of bytes in a pathname.  */
+#define	_POSIX_PATH_MAX		256
+
+/* Number of bytes than can be written atomically to a pipe.  */
+#define	_POSIX_PIPE_BUF		512
+
+/* The number of repeated occurrences of a BRE permitted by the
+   REGEXEC and REGCOMP functions when using the interval notation.  */
+#define _POSIX_RE_DUP_MAX	255
+
+/* Minimal number of realtime signals reserved for the application.  */
+#define _POSIX_RTSIG_MAX	8
+
+/* Number of semaphores a process can have.  */
+#define _POSIX_SEM_NSEMS_MAX	256
+
+/* Maximal value of a semaphore.  */
+#define _POSIX_SEM_VALUE_MAX	32767
+
+/* Number of pending realtime signals.  */
+#define _POSIX_SIGQUEUE_MAX	32
+
+/* Largest value of a `ssize_t'.  */
+#define	_POSIX_SSIZE_MAX	32767
+
+/* Number of streams a process can have open at once.  */
+#define	_POSIX_STREAM_MAX	8
+
+/* The number of bytes in a symbolic link.  */
+#define _POSIX_SYMLINK_MAX	255
+
+/* The number of symbolic links that can be traversed in the
+   resolution of a pathname in the absence of a loop.  */
+#define _POSIX_SYMLOOP_MAX	8
+
+/* Number of timer for a process.  */
+#define _POSIX_TIMER_MAX	32
+
+/* Maximum number of characters in a tty name.  */
+#define	_POSIX_TTY_NAME_MAX	9
+
+/* Maximum length of a timezone name (element of `tzname').  */
+#define	_POSIX_TZNAME_MAX	6
+
+/* Maximum number of connections that can be queued on a socket.  */
+#define	_POSIX_QLIMIT		1
+
+/* Maximum number of bytes that can be buffered on a socket for send
+   or receive.  */
+#define	_POSIX_HIWAT		_POSIX_PIPE_BUF
+
+/* Maximum number of elements in an `iovec' array.  */
+#define	_POSIX_UIO_MAXIOV	16
+
+/* Maximum clock resolution in nanoseconds.  */
+#define _POSIX_CLOCKRES_MIN	20000000
+
+
+/* Get the implementation-specific values for the above.  */
+#include <bits/local_lim.h>
+#include <bits/uClibc_local_lim.h>
+
+
+#ifndef	SSIZE_MAX
+# define SSIZE_MAX	LONG_MAX
+#endif
+
+
+/* This value is a guaranteed minimum maximum.
+   The current maximum can be got from `sysconf'.  */
+
+#ifndef	NGROUPS_MAX
+# define NGROUPS_MAX	8
+#endif
+
+#endif	/* bits/posix1_lim.h  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/posix2_lim.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/posix2_lim.h
new file mode 100644
index 0000000..24483a0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/posix2_lim.h
@@ -0,0 +1,91 @@
+/* Copyright (C) 1991, 1996, 1999, 2000, 2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/*
+ * Never include this file directly; include <limits.h> instead.
+ */
+
+#ifndef	_BITS_POSIX2_LIM_H
+#define	_BITS_POSIX2_LIM_H	1
+
+
+/* The maximum `ibase' and `obase' values allowed by the `bc' utility.  */
+#define	_POSIX2_BC_BASE_MAX		99
+
+/* The maximum number of elements allowed in an array by the `bc' utility.  */
+#define	_POSIX2_BC_DIM_MAX		2048
+
+/* The maximum `scale' value allowed by the `bc' utility.  */
+#define	_POSIX2_BC_SCALE_MAX		99
+
+/* The maximum length of a string constant accepted by the `bc' utility.  */
+#define	_POSIX2_BC_STRING_MAX		1000
+
+/* The maximum number of weights that can be assigned to an entry of
+   the LC_COLLATE `order' keyword in the locale definition file.  */
+#define	_POSIX2_COLL_WEIGHTS_MAX	2
+
+/* The maximum number of expressions that can be nested
+   within parentheses by the `expr' utility.  */
+#define	_POSIX2_EXPR_NEST_MAX		32
+
+/* The maximum length, in bytes, of an input line.  */
+#define	_POSIX2_LINE_MAX		2048
+
+/* The maximum number of repeated occurrences of a regular expression
+   permitted when using the interval notation `\{M,N\}'.  */
+#define	_POSIX2_RE_DUP_MAX		255
+
+/* The maximum number of bytes in a character class name.  We have no
+   fixed limit, 2048 is a high number.  */
+#define	_POSIX2_CHARCLASS_NAME_MAX	14
+
+
+/* These values are implementation-specific,
+   and may vary within the implementation.
+   Their precise values can be obtained from sysconf.  */
+
+#ifndef	BC_BASE_MAX
+#define	BC_BASE_MAX		_POSIX2_BC_BASE_MAX
+#endif
+#ifndef	BC_DIM_MAX
+#define	BC_DIM_MAX		_POSIX2_BC_DIM_MAX
+#endif
+#ifndef	BC_SCALE_MAX
+#define	BC_SCALE_MAX		_POSIX2_BC_SCALE_MAX
+#endif
+#ifndef	BC_STRING_MAX
+#define	BC_STRING_MAX		_POSIX2_BC_STRING_MAX
+#endif
+#ifndef	COLL_WEIGHTS_MAX
+#define	COLL_WEIGHTS_MAX	255
+#endif
+#ifndef	EXPR_NEST_MAX
+#define	EXPR_NEST_MAX		_POSIX2_EXPR_NEST_MAX
+#endif
+#ifndef	LINE_MAX
+#define	LINE_MAX		_POSIX2_LINE_MAX
+#endif
+#ifndef	CHARCLASS_NAME_MAX
+#define	CHARCLASS_NAME_MAX	2048
+#endif
+
+/* This value is defined like this in regex.h.  */
+#define	RE_DUP_MAX (0x7fff)
+
+#endif	/* bits/posix2_lim.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/posix_opt.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/posix_opt.h
new file mode 100644
index 0000000..aa40eae
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/posix_opt.h
@@ -0,0 +1,190 @@
+/* Define POSIX options for Linux.
+   Copyright (C) 1996-2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef	_POSIX_OPT_H
+#define	_POSIX_OPT_H	1
+
+/* Job control is supported.  */
+#define	_POSIX_JOB_CONTROL	1
+
+/* Processes have a saved set-user-ID and a saved set-group-ID.  */
+#define	_POSIX_SAVED_IDS	1
+
+/* Priority scheduling is supported.  */
+#define	_POSIX_PRIORITY_SCHEDULING	200112L
+
+/* Synchronizing file data is supported.  */
+#define	_POSIX_SYNCHRONIZED_IO	200112L
+
+/* The fsync function is present.  */
+#define	_POSIX_FSYNC	200112L
+
+/* Mapping of files to memory is supported.  */
+#define	_POSIX_MAPPED_FILES	200112L
+
+/* Locking of all memory is supported.  */
+#define	_POSIX_MEMLOCK	200112L
+
+/* Locking of ranges of memory is supported.  */
+#define	_POSIX_MEMLOCK_RANGE	200112L
+
+/* Setting of memory protections is supported.  */
+#define	_POSIX_MEMORY_PROTECTION	200112L
+
+/* Only root can change owner of file.  */
+#define	_POSIX_CHOWN_RESTRICTED	1
+
+/* `c_cc' member of 'struct termios' structure can be disabled by
+   using the value _POSIX_VDISABLE.  */
+#define	_POSIX_VDISABLE	'\0'
+
+/* Filenames are not silently truncated.  */
+#define	_POSIX_NO_TRUNC	1
+
+/* X/Open realtime support is available.  */
+#define _XOPEN_REALTIME	1
+
+/* XPG4.2 shared memory is supported.  */
+#define	_XOPEN_SHM	1
+
+/* Tell we have POSIX threads.  */
+#define _POSIX_THREADS	200112L
+
+/* We have the reentrant functions described in POSIX.  */
+#define _POSIX_REENTRANT_FUNCTIONS      1
+#define _POSIX_THREAD_SAFE_FUNCTIONS	200112L
+
+/* We provide priority scheduling for threads.  */
+#define _POSIX_THREAD_PRIORITY_SCHEDULING	200112L
+
+/* We support user-defined stack sizes.  */
+#define _POSIX_THREAD_ATTR_STACKSIZE	200112L
+
+/* We support user-defined stacks.  */
+#define _POSIX_THREAD_ATTR_STACKADDR	200112L
+
+#ifdef __UCLIBC_HAS_REALTIME__
+/* We support POSIX.1b semaphores.  */
+#define _POSIX_SEMAPHORES	200112L
+#endif
+
+/* Real-time signals are supported.  */
+#define _POSIX_REALTIME_SIGNALS	200112L
+
+/* We support asynchronous I/O.  */
+#define _POSIX_ASYNCHRONOUS_IO	200112L
+#define _POSIX_ASYNC_IO		1
+/* Alternative name for Unix98.  */
+#define _LFS_ASYNCHRONOUS_IO	1
+/* Support for prioritization is also available.  */
+#define _POSIX_PRIORITIZED_IO	200112L
+
+/* The LFS support in asynchronous I/O is also available.  */
+#define _LFS64_ASYNCHRONOUS_IO	1
+
+#ifdef __UCLIBC_HAS_LFS__
+/* The rest of the LFS is also available.  */
+#define _LFS_LARGEFILE		1
+#define _LFS64_LARGEFILE	1
+#define _LFS64_STDIO		1
+#endif
+
+/* POSIX shared memory objects are implemented.  */
+#define _POSIX_SHARED_MEMORY_OBJECTS	200112L
+
+/* CPU-time clocks support needs to be checked at runtime.  */
+#define _POSIX_CPUTIME	0
+
+/* Clock support in threads must be also checked at runtime.  */
+#define _POSIX_THREAD_CPUTIME	0
+
+#ifdef __UCLIBC_HAS_REGEX__
+/* GNU libc provides regular expression handling.  */
+#define _POSIX_REGEXP	1
+#endif
+
+/* Reader/Writer locks are available.  */
+#define _POSIX_READER_WRITER_LOCKS	200112L
+
+/* We have a POSIX shell.  */
+#define _POSIX_SHELL	1
+
+/* We support the Timeouts option.  */
+#define _POSIX_TIMEOUTS	200112L
+
+/* We support spinlocks.  */
+#define _POSIX_SPIN_LOCKS	200112L
+
+/* The `spawn' function family is supported.  */
+#if 0 /* no support in uClibc (yet) */
+#define _POSIX_SPAWN	200112L
+#endif
+
+/* We have POSIX timers.  */
+#define _POSIX_TIMERS	200112L
+
+/* The barrier functions are available.  */
+#define _POSIX_BARRIERS	200112L
+
+/* POSIX message queues are available.  */
+#define	_POSIX_MESSAGE_PASSING	200112L
+
+/* Thread process-shared synchronization is supported.  */
+#define _POSIX_THREAD_PROCESS_SHARED	200112L
+
+/* The monotonic clock might be available.  */
+#define _POSIX_MONOTONIC_CLOCK	0
+
+/* The clock selection interfaces are available.  */
+#define _POSIX_CLOCK_SELECTION	200112L
+
+/* Advisory information interfaces are available.  */
+#define _POSIX_ADVISORY_INFO	200112L
+
+#ifdef __UCLIBC_HAS_IPV6__
+/* IPv6 support is available.  */
+#define _POSIX_IPV6	200112L
+#endif
+
+#ifdef __UCLIBC_HAS_SOCKET__
+/* Raw socket support is available.  */
+#define _POSIX_RAW_SOCKETS	200112L
+#endif
+
+/* We have at least one terminal.  */
+#define _POSIX2_CHAR_TERM	200112L
+
+/* Neither process nor thread sporadic server interfaces is available.  */
+#define _POSIX_SPORADIC_SERVER	-1
+#define _POSIX_THREAD_SPORADIC_SERVER	-1
+
+/* trace.h is not available.  */
+#define _POSIX_TRACE	-1
+#define _POSIX_TRACE_EVENT_FILTER	-1
+#define _POSIX_TRACE_INHERIT	-1
+#define _POSIX_TRACE_LOG	-1
+
+/* Typed memory objects are not available.  */
+#define _POSIX_TYPED_MEMORY_OBJECTS	-1
+
+/* No support for priority inheritance or protection so far.  */
+#define _POSIX_THREAD_PRIO_INHERIT	-1
+#define _POSIX_THREAD_PRIO_PROTECT	-1
+
+#endif /* posix_opt.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/resource.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/resource.h
new file mode 100644
index 0000000..526cdaf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/resource.h
@@ -0,0 +1,225 @@
+/* Bit values & structures for resource limits.  Linux version.
+   Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_RESOURCE_H
+# error "Never use <bits/resource.h> directly; include <sys/resource.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Transmute defines to enumerations.  The macro re-definitions are
+   necessary because some programs want to test for operating system
+   features with #ifdef RUSAGE_SELF.  In ISO C the reflexive
+   definition is a no-op.  */
+
+/* Kinds of resource limit.  */
+enum __rlimit_resource
+{
+  /* Per-process CPU limit, in seconds.  */
+  RLIMIT_CPU = 0,
+#define RLIMIT_CPU RLIMIT_CPU
+
+  /* Largest file that can be created, in bytes.  */
+  RLIMIT_FSIZE = 1,
+#define	RLIMIT_FSIZE RLIMIT_FSIZE
+
+  /* Maximum size of data segment, in bytes.  */
+  RLIMIT_DATA = 2,
+#define	RLIMIT_DATA RLIMIT_DATA
+
+  /* Maximum size of stack segment, in bytes.  */
+  RLIMIT_STACK = 3,
+#define	RLIMIT_STACK RLIMIT_STACK
+
+  /* Largest core file that can be created, in bytes.  */
+  RLIMIT_CORE = 4,
+#define	RLIMIT_CORE RLIMIT_CORE
+
+  /* Largest resident set size, in bytes.
+     This affects swapping; processes that are exceeding their
+     resident set size will be more likely to have physical memory
+     taken from them.  */
+  __RLIMIT_RSS = 5,
+#define	RLIMIT_RSS __RLIMIT_RSS
+
+  /* Number of open files.  */
+  RLIMIT_NOFILE = 7,
+  __RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same.  */
+#define RLIMIT_NOFILE RLIMIT_NOFILE
+#define RLIMIT_OFILE __RLIMIT_OFILE
+
+  /* Address space limit.  */
+  RLIMIT_AS = 9,
+#define RLIMIT_AS RLIMIT_AS
+
+  /* Number of processes.  */
+  __RLIMIT_NPROC = 6,
+#define RLIMIT_NPROC __RLIMIT_NPROC
+
+  /* Locked-in-memory address space.  */
+  __RLIMIT_MEMLOCK = 8,
+#define RLIMIT_MEMLOCK __RLIMIT_MEMLOCK
+
+  /* Maximum number of file locks.  */
+  __RLIMIT_LOCKS = 10,
+#define RLIMIT_LOCKS __RLIMIT_LOCKS
+
+  /* Maximum number of pending signals.  */
+  __RLIMIT_SIGPENDING = 11,
+#define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING
+
+  /* Maximum bytes in POSIX message queues.  */
+  __RLIMIT_MSGQUEUE = 12,
+#define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE
+
+  /* Maximum nice priority allowed to raise to.
+     Nice levels 19 .. -20 correspond to 0 .. 39
+     values of this resource limit.  */
+  __RLIMIT_NICE = 13,
+#define RLIMIT_NICE __RLIMIT_NICE
+
+  /* Maximum realtime priority allowed for non-priviledged
+     processes.  */
+  __RLIMIT_RTPRIO = 14,
+#define RLIMIT_RTPRIO __RLIMIT_RTPRIO
+
+  __RLIMIT_NLIMITS = 15,
+  __RLIM_NLIMITS = __RLIMIT_NLIMITS
+#define RLIMIT_NLIMITS __RLIMIT_NLIMITS
+#define RLIM_NLIMITS __RLIM_NLIMITS
+};
+
+/* Value to indicate that there is no limit.  */
+#ifndef __USE_FILE_OFFSET64
+# define RLIM_INFINITY ((unsigned long int)(~0UL))
+#else
+# define RLIM_INFINITY 0xffffffffffffffffuLL
+#endif
+
+#ifdef __USE_LARGEFILE64
+# define RLIM64_INFINITY 0xffffffffffffffffuLL
+#endif
+
+/* We can represent all limits.  */
+#define RLIM_SAVED_MAX	RLIM_INFINITY
+#define RLIM_SAVED_CUR	RLIM_INFINITY
+
+
+/* Type for resource quantity measurement.  */
+#ifndef __USE_FILE_OFFSET64
+typedef __rlim_t rlim_t;
+#else
+typedef __rlim64_t rlim_t;
+#endif
+#ifdef __USE_LARGEFILE64
+typedef __rlim64_t rlim64_t;
+#endif
+
+struct rlimit
+  {
+    /* The current (soft) limit.  */
+    rlim_t rlim_cur;
+    /* The hard limit.  */
+    rlim_t rlim_max;
+  };
+
+#ifdef __USE_LARGEFILE64
+struct rlimit64
+  {
+    /* The current (soft) limit.  */
+    rlim64_t rlim_cur;
+    /* The hard limit.  */
+    rlim64_t rlim_max;
+ };
+#endif
+
+/* Whose usage statistics do you want?  */
+enum __rusage_who
+{
+  /* The calling process.  */
+  RUSAGE_SELF = 0,
+#define RUSAGE_SELF RUSAGE_SELF
+
+  /* All of its terminated child processes.  */
+  RUSAGE_CHILDREN = -1
+#define RUSAGE_CHILDREN RUSAGE_CHILDREN
+};
+
+#define __need_timeval
+#include <bits/time.h>		/* For `struct timeval'.  */
+
+/* Structure which says how much of each resource has been used.  */
+struct rusage
+  {
+    /* Total amount of user time used.  */
+    struct timeval ru_utime;
+    /* Total amount of system time used.  */
+    struct timeval ru_stime;
+    /* Maximum resident set size (in kilobytes).  */
+    long int ru_maxrss;
+    /* Amount of sharing of text segment memory
+       with other processes (kilobyte-seconds).  */
+    long int ru_ixrss;
+    /* Amount of data segment memory used (kilobyte-seconds).  */
+    long int ru_idrss;
+    /* Amount of stack memory used (kilobyte-seconds).  */
+    long int ru_isrss;
+    /* Number of soft page faults (i.e. those serviced by reclaiming
+       a page from the list of pages awaiting reallocation.  */
+    long int ru_minflt;
+    /* Number of hard page faults (i.e. those that required I/O).  */
+    long int ru_majflt;
+    /* Number of times a process was swapped out of physical memory.  */
+    long int ru_nswap;
+    /* Number of input operations via the file system.  Note: This
+       and `ru_oublock' do not include operations with the cache.  */
+    long int ru_inblock;
+    /* Number of output operations via the file system.  */
+    long int ru_oublock;
+    /* Number of IPC messages sent.  */
+    long int ru_msgsnd;
+    /* Number of IPC messages received.  */
+    long int ru_msgrcv;
+    /* Number of signals delivered.  */
+    long int ru_nsignals;
+    /* Number of voluntary context switches, i.e. because the process
+       gave up the process before it had to (usually to wait for some
+       resource to be available).  */
+    long int ru_nvcsw;
+    /* Number of involuntary context switches, i.e. a higher priority process
+       became runnable or the current process used up its time slice.  */
+    long int ru_nivcsw;
+  };
+
+/* Priority limits.  */
+#define PRIO_MIN	-20	/* Minimum priority a process can have.  */
+#define PRIO_MAX	20	/* Maximum priority a process can have.  */
+
+/* The type of the WHICH argument to `getpriority' and `setpriority',
+   indicating what flavor of entity the WHO argument specifies.  */
+enum __priority_which
+{
+  PRIO_PROCESS = 0,		/* WHO is a process ID.  */
+#define PRIO_PROCESS PRIO_PROCESS
+  PRIO_PGRP = 1,		/* WHO is a process group ID.  */
+#define PRIO_PGRP PRIO_PGRP
+  PRIO_USER = 2			/* WHO is a user ID.  */
+#define PRIO_USER PRIO_USER
+};
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/sched.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sched.h
new file mode 100644
index 0000000..7d6273f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sched.h
@@ -0,0 +1,200 @@
+/* Definitions of constants and data structure for POSIX 1003.1b-1993
+   scheduling interface.
+   Copyright (C) 1996-1999,2001-2003,2005,2006,2007,2008
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef __need_schedparam
+
+#ifndef _SCHED_H
+# error "Never include <bits/sched.h> directly; use <sched.h> instead."
+#endif
+
+
+/* Scheduling algorithms.  */
+#define SCHED_OTHER	0
+#define SCHED_FIFO	1
+#define SCHED_RR	2
+#ifdef __USE_GNU
+# define SCHED_BATCH	3
+#endif
+
+#ifdef __USE_MISC
+/* Cloning flags.  */
+# define CSIGNAL       0x000000ff /* Signal mask to be sent at exit.  */
+# define CLONE_VM      0x00000100 /* Set if VM shared between processes.  */
+# define CLONE_FS      0x00000200 /* Set if fs info shared between processes.  */
+# define CLONE_FILES   0x00000400 /* Set if open files shared between processes.  */
+# define CLONE_SIGHAND 0x00000800 /* Set if signal handlers shared.  */
+# define CLONE_PTRACE  0x00002000 /* Set if tracing continues on the child.  */
+# define CLONE_VFORK   0x00004000 /* Set if the parent wants the child to
+				     wake it up on mm_release.  */
+# define CLONE_PARENT  0x00008000 /* Set if we want to have the same
+				     parent as the cloner.  */
+# define CLONE_THREAD  0x00010000 /* Set to add to same thread group.  */
+# define CLONE_NEWNS   0x00020000 /* Set to create new namespace.  */
+# define CLONE_SYSVSEM 0x00040000 /* Set to shared SVID SEM_UNDO semantics.  */
+# define CLONE_SETTLS  0x00080000 /* Set TLS info.  */
+# define CLONE_PARENT_SETTID 0x00100000 /* Store TID in userlevel buffer
+					   before MM copy.  */
+# define CLONE_CHILD_CLEARTID 0x00200000 /* Register exit futex and memory
+					    location to clear.  */
+# define CLONE_DETACHED 0x00400000 /* Create clone detached.  */
+# define CLONE_UNTRACED 0x00800000 /* Set if the tracing process can't
+				      force CLONE_PTRACE on this clone.  */
+# define CLONE_CHILD_SETTID 0x01000000 /* Store TID in userlevel buffer in
+					  the child.  */
+# define CLONE_STOPPED 0x02000000 /* Start in stopped state.  */
+# define CLONE_NEWUTS	0x04000000	/* New utsname group.  */
+# define CLONE_NEWIPC	0x08000000	/* New ipcs.  */
+# define CLONE_NEWUSER	0x10000000	/* New user namespace.  */
+# define CLONE_NEWPID	0x20000000	/* New pid namespace.  */
+# define CLONE_NEWNET	0x40000000	/* New network namespace.  */
+# define CLONE_IO	0x80000000	/* Clone I/O context.  */
+#endif
+
+/* The official definition.  */
+struct sched_param
+  {
+    int __sched_priority;
+  };
+
+__BEGIN_DECLS
+
+#ifdef __USE_MISC
+/* Clone current process.  */
+extern int clone (int (*__fn) (void *__arg), void *__child_stack,
+		  int __flags, void *__arg, ...) __THROW;
+
+/* Unshare the specified resources.  */
+extern int unshare (int __flags) __THROW;
+
+/* Get index of currently used CPU.  */
+extern int sched_getcpu (void) __THROW;
+#endif
+
+__END_DECLS
+
+#endif	/* need schedparam */
+
+#if !defined __defined_schedparam \
+    && (defined __need_schedparam || defined _SCHED_H)
+# define __defined_schedparam	1
+/* Data structure to describe a process' schedulability.  */
+struct __sched_param
+  {
+    int __sched_priority;
+  };
+# undef __need_schedparam
+#endif
+
+
+#if defined _SCHED_H && !defined __cpu_set_t_defined
+# define __cpu_set_t_defined
+/* Size definition for CPU sets.  */
+# define __CPU_SETSIZE	1024
+# define __NCPUBITS	(8 * sizeof (__cpu_mask))
+
+/* Type for array elements in 'cpu_set_t'.  */
+typedef unsigned long int __cpu_mask;
+
+/* Basic access functions.  */
+# define __CPUELT(cpu)	((cpu) / __NCPUBITS)
+# define __CPUMASK(cpu)	((__cpu_mask) 1 << ((cpu) % __NCPUBITS))
+
+/* Data structure to describe CPU mask.  */
+typedef struct
+{
+  __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS];
+} cpu_set_t;
+
+/* Access functions for CPU masks.  */
+# define __CPU_ZERO_S(setsize, cpusetp) \
+  do {									      \
+    size_t __i;								      \
+    size_t __imax = (setsize) / sizeof (__cpu_mask);			      \
+    __cpu_mask *__bits = (cpusetp)->__bits;				      \
+    for (__i = 0; __i < __imax; ++__i)					      \
+      __bits[__i] = 0;							      \
+  } while (0)
+# define __CPU_SET_S(cpu, setsize, cpusetp) \
+  (__extension__							      \
+   ({ size_t __cpu = (cpu);						      \
+      __cpu < 8 * (setsize)						      \
+      ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)]		      \
+	 |= __CPUMASK (__cpu))						      \
+      : 0; }))
+# define __CPU_CLR_S(cpu, setsize, cpusetp) \
+  (__extension__							      \
+   ({ size_t __cpu = (cpu);						      \
+      __cpu < 8 * (setsize)						      \
+      ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)]		      \
+	 &= ~__CPUMASK (__cpu))						      \
+      : 0; }))
+# define __CPU_ISSET_S(cpu, setsize, cpusetp) \
+  (__extension__							      \
+   ({ size_t __cpu = (cpu);						      \
+      __cpu < 8 * (setsize)						      \
+      ? ((((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)]	      \
+	  & __CPUMASK (__cpu))) != 0					      \
+      : 0; }))
+
+# define __CPU_COUNT_S(setsize, cpusetp) \
+  __sched_cpucount (setsize, cpusetp)
+
+# define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \
+  (__extension__							      \
+   ({ __cpu_mask *__arr1 = (cpusetp1)->__bits;				      \
+      __cpu_mask *__arr2 = (cpusetp2)->__bits;				      \
+      size_t __imax = (setsize) / sizeof (__cpu_mask);			      \
+      size_t __i;							      \
+      for (__i = 0; __i < __imax; ++__i)				      \
+	if (__arr1[__i] != __arr2[__i])					      \
+	  break;							      \
+      __i == __imax; }))
+
+# define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \
+  (__extension__							      \
+   ({ cpu_set_t *__dest = (destset);					      \
+      __cpu_mask *__arr1 = (srcset1)->__bits;				      \
+      __cpu_mask *__arr2 = (srcset2)->__bits;				      \
+      size_t __imax = (setsize) / sizeof (__cpu_mask);			      \
+      size_t __i;							      \
+      for (__i = 0; __i < __imax; ++__i)				      \
+	((__cpu_mask *) __dest->__bits)[__i] = __arr1[__i] op __arr2[__i];    \
+      __dest; }))
+
+# define __CPU_ALLOC_SIZE(count) \
+  ((((count) + __NCPUBITS - 1) / __NCPUBITS) * sizeof (__cpu_mask))
+# define __CPU_ALLOC(count) __sched_cpualloc (count)
+# define __CPU_FREE(cpuset) __sched_cpufree (cpuset)
+
+__BEGIN_DECLS
+
+extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
+  __THROW;
+#if 0 /* in uClibc we use macros */
+extern cpu_set_t *__sched_cpualloc (size_t __count) __THROW __wur;
+extern void __sched_cpufree (cpu_set_t *__set) __THROW;
+#else
+# define __sched_cpualloc(cnt) ((cpu_set_t *)malloc(__CPU_ALLOC_SIZE(cnt)))
+# define __sched_cpufree(__set) free(__set)
+#endif
+__END_DECLS
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/select.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/select.h
new file mode 100644
index 0000000..47e7ded
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/select.h
@@ -0,0 +1,35 @@
+/* Copyright (C) 1997, 1998, 2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_SELECT_H
+# error "Never use <bits/select.h> directly; include <sys/select.h> instead."
+#endif
+
+
+/* We don't use `memset' because this would require a prototype and
+   the array isn't too big.  */
+#define __FD_ZERO(s) \
+  do {									      \
+    unsigned int __i;							      \
+    fd_set *__arr = (s);						      \
+    for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i)	      \
+      __FDS_BITS (__arr)[__i] = 0;					      \
+  } while (0)
+#define __FD_SET(d, s)     (__FDS_BITS (s)[__FDELT(d)] |= __FDMASK(d))
+#define __FD_CLR(d, s)     (__FDS_BITS (s)[__FDELT(d)] &= ~__FDMASK(d))
+#define __FD_ISSET(d, s)   ((__FDS_BITS (s)[__FDELT(d)] & __FDMASK(d)) != 0)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/sem.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sem.h
new file mode 100644
index 0000000..6193501
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sem.h
@@ -0,0 +1,87 @@
+/* Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_SEM_H
+# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
+#endif
+
+#include <sys/types.h>
+
+/* Flags for `semop'.  */
+#define SEM_UNDO	0x1000		/* undo the operation on exit */
+
+/* Commands for `semctl'.  */
+#define GETPID		11		/* get sempid */
+#define GETVAL		12		/* get semval */
+#define GETALL		13		/* get all semval's */
+#define GETNCNT		14		/* get semncnt */
+#define GETZCNT		15		/* get semzcnt */
+#define SETVAL		16		/* set semval */
+#define SETALL		17		/* set all semval's */
+
+
+/* Data structure describing a set of semaphores.  */
+struct semid_ds
+{
+  struct ipc_perm sem_perm;		/* operation permission struct */
+  __time_t sem_otime;			/* last semop() time */
+  unsigned long int __unused1;
+  __time_t sem_ctime;			/* last time changed by semctl() */
+  unsigned long int __unused2;
+  unsigned long int sem_nsems;		/* number of semaphores in set */
+  unsigned long int __unused3;
+  unsigned long int __unused4;
+};
+
+/* The user should define a union like the following to use it for arguments
+   for `semctl'.
+
+   union semun
+   {
+     int val;				<= value for SETVAL
+     struct semid_ds *buf;		<= buffer for IPC_STAT & IPC_SET
+     unsigned short int *array;		<= array for GETALL & SETALL
+     struct seminfo *__buf;		<= buffer for IPC_INFO
+   };
+
+   Previous versions of this file used to define this union but this is
+   incorrect.  One can test the macro _SEM_SEMUN_UNDEFINED to see whether
+   one must define the union or not.  */
+#define _SEM_SEMUN_UNDEFINED	1
+
+#ifdef __USE_MISC
+
+/* ipcs ctl cmds */
+# define SEM_STAT 18
+# define SEM_INFO 19
+
+struct  seminfo
+{
+  int semmap;
+  int semmni;
+  int semmns;
+  int semmnu;
+  int semmsl;
+  int semopm;
+  int semume;
+  int semusz;
+  int semvmx;
+  int semaem;
+};
+
+#endif /* __USE_MISC */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/setjmp.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/setjmp.h
new file mode 100644
index 0000000..ad9f04d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/setjmp.h
@@ -0,0 +1,2 @@
+/* bits/setjmp.h is architecture specific.  */
+#error "This file must be supplied by every Linux architecture."
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/shm.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/shm.h
new file mode 100644
index 0000000..87ccd0f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/shm.h
@@ -0,0 +1,103 @@
+/* Copyright (C) 1995,1996,1997,2000,2002,2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_SHM_H
+# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Permission flag for shmget.  */
+#define SHM_R		0400		/* or S_IRUGO from <linux/stat.h> */
+#define SHM_W		0200		/* or S_IWUGO from <linux/stat.h> */
+
+/* Flags for `shmat'.  */
+#define SHM_RDONLY	010000		/* attach read-only else read-write */
+#define SHM_RND		020000		/* round attach address to SHMLBA */
+#define SHM_REMAP	040000		/* take-over region on attach */
+
+/* Commands for `shmctl'.  */
+#define SHM_LOCK	11		/* lock segment (root only) */
+#define SHM_UNLOCK	12		/* unlock segment (root only) */
+
+__BEGIN_DECLS
+
+/* Segment low boundary address multiple.  */
+#define SHMLBA		(__getpagesize ())
+extern int __getpagesize (void) __THROW __attribute__ ((__const__));
+
+
+/* Type to count number of attaches.  */
+typedef unsigned long int shmatt_t;
+
+/* Data structure describing a set of semaphores.  */
+struct shmid_ds
+  {
+    struct ipc_perm shm_perm;		/* operation permission struct */
+    size_t shm_segsz;			/* size of segment in bytes */
+    __time_t shm_atime;			/* time of last shmat() */
+    unsigned long int __unused1;
+    __time_t shm_dtime;			/* time of last shmdt() */
+    unsigned long int __unused2;
+    __time_t shm_ctime;			/* time of last change by shmctl() */
+    unsigned long int __unused3;
+    __pid_t shm_cpid;			/* pid of creator */
+    __pid_t shm_lpid;			/* pid of last shmop */
+    shmatt_t shm_nattch;		/* number of current attaches */
+    unsigned long int __unused4;
+    unsigned long int __unused5;
+  };
+
+#ifdef __USE_MISC
+
+/* ipcs ctl commands */
+# define SHM_STAT	13
+# define SHM_INFO	14
+
+/* shm_mode upper byte flags */
+# define SHM_DEST	01000	/* segment will be destroyed on last detach */
+# define SHM_LOCKED	02000   /* segment will not be swapped */
+# define SHM_HUGETLB	04000	/* segment is mapped via hugetlb */
+# define SHM_NORESERVE	010000	/* don't check for reservations */
+
+struct	shminfo
+  {
+    unsigned long int shmmax;
+    unsigned long int shmmin;
+    unsigned long int shmmni;
+    unsigned long int shmseg;
+    unsigned long int shmall;
+    unsigned long int __unused1;
+    unsigned long int __unused2;
+    unsigned long int __unused3;
+    unsigned long int __unused4;
+  };
+
+struct shm_info
+  {
+    int used_ids;
+    unsigned long int shm_tot;	/* total allocated shm */
+    unsigned long int shm_rss;	/* total resident shm */
+    unsigned long int shm_swp;	/* total swapped shm */
+    unsigned long int swap_attempts;
+    unsigned long int swap_successes;
+  };
+
+#endif /* __USE_MISC */
+
+__END_DECLS
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigaction.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigaction.h
new file mode 100644
index 0000000..7489aa8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigaction.h
@@ -0,0 +1,69 @@
+/* The proper definitions for Linux's sigaction.
+   Copyright (C) 1993-1999, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SIGNAL_H
+# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
+#endif
+
+/* Structure describing the action to be taken when a signal arrives.
+ * In uclibc, it is identical to "new" struct kernel_sigaction
+ * (one from the Linux 2.1.68 kernel).
+ * This minimizes amount of translation in sigaction().
+ */
+struct sigaction {
+#ifdef __USE_POSIX199309
+	union {
+		__sighandler_t sa_handler;
+		void (*sa_sigaction)(int, siginfo_t *, void *);
+	} __sigaction_handler;
+# define sa_handler     __sigaction_handler.sa_handler
+# define sa_sigaction   __sigaction_handler.sa_sigaction
+#else
+	__sighandler_t  sa_handler;
+#endif
+	unsigned long   sa_flags;
+	void            (*sa_restorer)(void);
+	sigset_t        sa_mask;
+};
+
+/* Bits in `sa_flags'.  */
+#define	SA_NOCLDSTOP  1		 /* Don't send SIGCHLD when children stop.  */
+#define SA_NOCLDWAIT  2		 /* Don't create zombie on child death.  */
+#define SA_SIGINFO    4		 /* Invoke signal-catching function with
+				    three arguments instead of one.  */
+#if defined __USE_UNIX98 || defined __USE_MISC
+# define SA_ONSTACK   0x08000000 /* Use signal stack by using `sa_restorer'. */
+# define SA_RESTART   0x10000000 /* Restart syscall on signal return.  */
+# define SA_NODEFER   0x40000000 /* Don't automatically block the signal when
+				    its handler is being executed.  */
+# define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler.  */
+#endif
+#ifdef __USE_MISC
+# define SA_INTERRUPT 0x20000000 /* Historical no-op.  */
+
+/* Some aliases for the SA_ constants.  */
+# define SA_NOMASK    SA_NODEFER
+# define SA_ONESHOT   SA_RESETHAND
+# define SA_STACK     SA_ONSTACK
+#endif
+
+/* Values for the HOW argument to `sigprocmask'.  */
+#define	SIG_BLOCK     0		 /* Block signals.  */
+#define	SIG_UNBLOCK   1		 /* Unblock signals.  */
+#define	SIG_SETMASK   2		 /* Set the set of blocked signals.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigcontext.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigcontext.h
new file mode 100644
index 0000000..35bf5bc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigcontext.h
@@ -0,0 +1,32 @@
+/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
+# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
+#ifndef sigcontext_struct
+/* Kernel headers before 2.1.1 define a struct sigcontext_struct, but
+   we need sigcontext.  */
+# define sigcontext_struct sigcontext
+
+# ifndef __user
+# define __user
+# endif
+# include <asm/sigcontext.h>
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigcontextinfo.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigcontextinfo.h
new file mode 100644
index 0000000..40305b4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigcontextinfo.h
@@ -0,0 +1,27 @@
+/* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* In general we cannot provide any information.  */
+#define SIGCONTEXT struct sigcontext *
+#define SIGCONTEXT_EXTRA_ARGS
+#define GET_PC(ctx)	((void *) 0)
+#define GET_FRAME(ctx)	((void *) 0)
+#define GET_STACK(ctx)	((void *) 0)
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+  (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/siginfo.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/siginfo.h
new file mode 100644
index 0000000..4ce319d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/siginfo.h
@@ -0,0 +1,313 @@
+/* siginfo_t, sigevent and constants.  Linux version.
+   Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if !defined _SIGNAL_H && !defined __need_siginfo_t \
+    && !defined __need_sigevent_t
+# error "Never include this file directly.  Use <signal.h> instead"
+#endif
+
+#include <bits/wordsize.h>
+
+#if (!defined __have_sigval_t \
+     && (defined _SIGNAL_H || defined __need_siginfo_t \
+	 || defined __need_sigevent_t))
+# define __have_sigval_t	1
+
+/* Type for data associated with a signal.  */
+typedef union sigval
+  {
+    int sival_int;
+    void *sival_ptr;
+  } sigval_t;
+#endif
+
+#if (!defined __have_siginfo_t \
+     && (defined _SIGNAL_H || defined __need_siginfo_t))
+# define __have_siginfo_t	1
+
+# define __SI_MAX_SIZE     128
+# if __WORDSIZE == 64
+#  define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 4)
+# else
+#  define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 3)
+# endif
+
+typedef struct siginfo
+  {
+    int si_signo;		/* Signal number.  */
+    int si_errno;		/* If non-zero, an errno value associated with
+				   this signal, as defined in <errno.h>.  */
+    int si_code;		/* Signal code.  */
+
+    union
+      {
+	int _pad[__SI_PAD_SIZE];
+
+	 /* kill().  */
+	struct
+	  {
+	    __pid_t si_pid;	/* Sending process ID.  */
+	    __uid_t si_uid;	/* Real user ID of sending process.  */
+	  } _kill;
+
+	/* POSIX.1b timers.  */
+	struct
+	  {
+	    int si_tid;		/* Timer ID.  */
+	    int si_overrun;	/* Overrun count.  */
+	    sigval_t si_sigval;	/* Signal value.  */
+	  } _timer;
+
+	/* POSIX.1b signals.  */
+	struct
+	  {
+	    __pid_t si_pid;	/* Sending process ID.  */
+	    __uid_t si_uid;	/* Real user ID of sending process.  */
+	    sigval_t si_sigval;	/* Signal value.  */
+	  } _rt;
+
+	/* SIGCHLD.  */
+	struct
+	  {
+	    __pid_t si_pid;	/* Which child.  */
+	    __uid_t si_uid;	/* Real user ID of sending process.  */
+	    int si_status;	/* Exit value or signal.  */
+	    __clock_t si_utime;
+	    __clock_t si_stime;
+	  } _sigchld;
+
+	/* SIGILL, SIGFPE, SIGSEGV, SIGBUS.  */
+	struct
+	  {
+	    void *si_addr;	/* Faulting insn/memory ref.  */
+	  } _sigfault;
+
+	/* SIGPOLL.  */
+	struct
+	  {
+	    long int si_band;	/* Band event for SIGPOLL.  */
+	    int si_fd;
+	  } _sigpoll;
+      } _sifields;
+  } siginfo_t;
+
+
+/* X/Open requires some more fields with fixed names.  */
+# define si_pid		_sifields._kill.si_pid
+# define si_uid		_sifields._kill.si_uid
+# define si_timerid	_sifields._timer.si_tid
+# define si_overrun	_sifields._timer.si_overrun
+# define si_status	_sifields._sigchld.si_status
+# define si_utime	_sifields._sigchld.si_utime
+# define si_stime	_sifields._sigchld.si_stime
+# define si_value	_sifields._rt.si_sigval
+# define si_int		_sifields._rt.si_sigval.sival_int
+# define si_ptr		_sifields._rt.si_sigval.sival_ptr
+# define si_addr	_sifields._sigfault.si_addr
+# define si_band	_sifields._sigpoll.si_band
+# define si_fd		_sifields._sigpoll.si_fd
+
+
+/* Values for `si_code'.  Positive values are reserved for kernel-generated
+   signals.  */
+enum
+{
+  SI_ASYNCNL = -60,		/* Sent by asynch name lookup completion.  */
+# define SI_ASYNCNL	SI_ASYNCNL
+  SI_TKILL = -6,		/* Sent by tkill.  */
+# define SI_TKILL	SI_TKILL
+  SI_SIGIO,			/* Sent by queued SIGIO. */
+# define SI_SIGIO	SI_SIGIO
+  SI_ASYNCIO,			/* Sent by AIO completion.  */
+# define SI_ASYNCIO	SI_ASYNCIO
+  SI_MESGQ,			/* Sent by real time mesq state change.  */
+# define SI_MESGQ	SI_MESGQ
+  SI_TIMER,			/* Sent by timer expiration.  */
+# define SI_TIMER	SI_TIMER
+  SI_QUEUE,			/* Sent by sigqueue.  */
+# define SI_QUEUE	SI_QUEUE
+  SI_USER,			/* Sent by kill, sigsend, raise.  */
+# define SI_USER	SI_USER
+  SI_KERNEL = 0x80		/* Send by kernel.  */
+#define SI_KERNEL	SI_KERNEL
+};
+
+
+/* `si_code' values for SIGILL signal.  */
+enum
+{
+  ILL_ILLOPC = 1,		/* Illegal opcode.  */
+# define ILL_ILLOPC	ILL_ILLOPC
+  ILL_ILLOPN,			/* Illegal operand.  */
+# define ILL_ILLOPN	ILL_ILLOPN
+  ILL_ILLADR,			/* Illegal addressing mode.  */
+# define ILL_ILLADR	ILL_ILLADR
+  ILL_ILLTRP,			/* Illegal trap. */
+# define ILL_ILLTRP	ILL_ILLTRP
+  ILL_PRVOPC,			/* Privileged opcode.  */
+# define ILL_PRVOPC	ILL_PRVOPC
+  ILL_PRVREG,			/* Privileged register.  */
+# define ILL_PRVREG	ILL_PRVREG
+  ILL_COPROC,			/* Coprocessor error.  */
+# define ILL_COPROC	ILL_COPROC
+  ILL_BADSTK			/* Internal stack error.  */
+# define ILL_BADSTK	ILL_BADSTK
+};
+
+/* `si_code' values for SIGFPE signal.  */
+enum
+{
+  FPE_INTDIV = 1,		/* Integer divide by zero.  */
+# define FPE_INTDIV	FPE_INTDIV
+  FPE_INTOVF,			/* Integer overflow.  */
+# define FPE_INTOVF	FPE_INTOVF
+  FPE_FLTDIV,			/* Floating point divide by zero.  */
+# define FPE_FLTDIV	FPE_FLTDIV
+  FPE_FLTOVF,			/* Floating point overflow.  */
+# define FPE_FLTOVF	FPE_FLTOVF
+  FPE_FLTUND,			/* Floating point underflow.  */
+# define FPE_FLTUND	FPE_FLTUND
+  FPE_FLTRES,			/* Floating point inexact result.  */
+# define FPE_FLTRES	FPE_FLTRES
+  FPE_FLTINV,			/* Floating point invalid operation.  */
+# define FPE_FLTINV	FPE_FLTINV
+  FPE_FLTSUB			/* Subscript out of range.  */
+# define FPE_FLTSUB	FPE_FLTSUB
+};
+
+/* `si_code' values for SIGSEGV signal.  */
+enum
+{
+  SEGV_MAPERR = 1,		/* Address not mapped to object.  */
+# define SEGV_MAPERR	SEGV_MAPERR
+  SEGV_ACCERR			/* Invalid permissions for mapped object.  */
+# define SEGV_ACCERR	SEGV_ACCERR
+};
+
+/* `si_code' values for SIGBUS signal.  */
+enum
+{
+  BUS_ADRALN = 1,		/* Invalid address alignment.  */
+# define BUS_ADRALN	BUS_ADRALN
+  BUS_ADRERR,			/* Non-existant physical address.  */
+# define BUS_ADRERR	BUS_ADRERR
+  BUS_OBJERR			/* Object specific hardware error.  */
+# define BUS_OBJERR	BUS_OBJERR
+};
+
+/* `si_code' values for SIGTRAP signal.  */
+enum
+{
+  TRAP_BRKPT = 1,		/* Process breakpoint.  */
+# define TRAP_BRKPT	TRAP_BRKPT
+  TRAP_TRACE			/* Process trace trap.  */
+# define TRAP_TRACE	TRAP_TRACE
+};
+
+/* `si_code' values for SIGCHLD signal.  */
+enum
+{
+  CLD_EXITED = 1,		/* Child has exited.  */
+# define CLD_EXITED	CLD_EXITED
+  CLD_KILLED,			/* Child was killed.  */
+# define CLD_KILLED	CLD_KILLED
+  CLD_DUMPED,			/* Child terminated abnormally.  */
+# define CLD_DUMPED	CLD_DUMPED
+  CLD_TRAPPED,			/* Traced child has trapped.  */
+# define CLD_TRAPPED	CLD_TRAPPED
+  CLD_STOPPED,			/* Child has stopped.  */
+# define CLD_STOPPED	CLD_STOPPED
+  CLD_CONTINUED			/* Stopped child has continued.  */
+# define CLD_CONTINUED	CLD_CONTINUED
+};
+
+/* `si_code' values for SIGPOLL signal.  */
+enum
+{
+  POLL_IN = 1,			/* Data input available.  */
+# define POLL_IN	POLL_IN
+  POLL_OUT,			/* Output buffers available.  */
+# define POLL_OUT	POLL_OUT
+  POLL_MSG,			/* Input message available.   */
+# define POLL_MSG	POLL_MSG
+  POLL_ERR,			/* I/O error.  */
+# define POLL_ERR	POLL_ERR
+  POLL_PRI,			/* High priority input available.  */
+# define POLL_PRI	POLL_PRI
+  POLL_HUP			/* Device disconnected.  */
+# define POLL_HUP	POLL_HUP
+};
+
+# undef __need_siginfo_t
+#endif	/* !have siginfo_t && (have _SIGNAL_H || need siginfo_t).  */
+
+
+#if (defined _SIGNAL_H || defined __need_sigevent_t) \
+    && !defined __have_sigevent_t
+# define __have_sigevent_t	1
+
+/* Structure to transport application-defined values with signals.  */
+# define __SIGEV_MAX_SIZE	64
+# if __WORDSIZE == 64
+#  define __SIGEV_PAD_SIZE	((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
+# else
+#  define __SIGEV_PAD_SIZE	((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
+# endif
+
+typedef struct sigevent
+  {
+    sigval_t sigev_value;
+    int sigev_signo;
+    int sigev_notify;
+
+    union
+      {
+	int _pad[__SIGEV_PAD_SIZE];
+
+	/* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the
+	   thread to receive the signal.  */
+	__pid_t _tid;
+
+	struct
+	  {
+	    void (*_function) (sigval_t);	/* Function to start.  */
+	    void *_attribute;			/* Really pthread_attr_t.  */
+	  } _sigev_thread;
+      } _sigev_un;
+  } sigevent_t;
+
+/* POSIX names to access some of the members.  */
+# define sigev_notify_function   _sigev_un._sigev_thread._function
+# define sigev_notify_attributes _sigev_un._sigev_thread._attribute
+
+/* `sigev_notify' values.  */
+enum
+{
+  SIGEV_SIGNAL = 0,		/* Notify via signal.  */
+# define SIGEV_SIGNAL	SIGEV_SIGNAL
+  SIGEV_NONE,			/* Other notification: meaningless.  */
+# define SIGEV_NONE	SIGEV_NONE
+  SIGEV_THREAD,			/* Deliver via thread creation.  */
+# define SIGEV_THREAD	SIGEV_THREAD
+
+  SIGEV_THREAD_ID = 4		/* Send signal to specific thread.  */
+#define SIGEV_THREAD_ID	SIGEV_THREAD_ID
+};
+
+#endif	/* have _SIGNAL_H.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/signalfd.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/signalfd.h
new file mode 100644
index 0000000..f2c0dde
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/signalfd.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2007-2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_SIGNALFD_H
+# error "Never use <bits/signalfd.h> directly; include <sys/signalfd.h> instead."
+#endif
+
+/* Flags for signalfd.  */
+enum
+  {
+    SFD_CLOEXEC = 02000000,
+#define SFD_CLOEXEC SFD_CLOEXEC
+    SFD_NONBLOCK = 00004000
+#define SFD_NONBLOCK SFD_NONBLOCK
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/signum.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/signum.h
new file mode 100644
index 0000000..81d38f5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/signum.h
@@ -0,0 +1,58 @@
+/* Signal number definitions.  Linux version.
+   Copyright (C) 1995,1996,1997,1998,1999,2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifdef	_SIGNAL_H
+
+#define	SIGHUP		1	/* Hangup (POSIX).  */
+#define	SIGINT		2	/* Interrupt (ANSI).  */
+#define	SIGQUIT		3	/* Quit (POSIX).  */
+#define	SIGILL		4	/* Illegal instruction (ANSI).  */
+#define	SIGTRAP		5	/* Trace trap (POSIX).  */
+#define	SIGABRT		6	/* Abort (ANSI).  */
+#define	SIGIOT		6	/* IOT trap (4.2 BSD).  */
+#define	SIGBUS		7	/* BUS error (4.2 BSD).  */
+#define	SIGFPE		8	/* Floating-point exception (ANSI).  */
+#define	SIGKILL		9	/* Kill, unblockable (POSIX).  */
+#define	SIGUSR1		10	/* User-defined signal 1 (POSIX).  */
+#define	SIGSEGV		11	/* Segmentation violation (ANSI).  */
+#define	SIGUSR2		12	/* User-defined signal 2 (POSIX).  */
+#define	SIGPIPE		13	/* Broken pipe (POSIX).  */
+#define	SIGALRM		14	/* Alarm clock (POSIX).  */
+#define	SIGTERM		15	/* Termination (ANSI).  */
+#define	SIGSTKFLT	16	/* Stack fault.  */
+#define	SIGCLD		SIGCHLD	/* Same as SIGCHLD (System V).  */
+#define	SIGCHLD		17	/* Child status has changed (POSIX).  */
+#define	SIGCONT		18	/* Continue (POSIX).  */
+#define	SIGSTOP		19	/* Stop, unblockable (POSIX).  */
+#define	SIGTSTP		20	/* Keyboard stop (POSIX).  */
+#define	SIGTTIN		21	/* Background read from tty (POSIX).  */
+#define	SIGTTOU		22	/* Background write to tty (POSIX).  */
+#define	SIGURG		23	/* Urgent condition on socket (4.2 BSD).  */
+#define	SIGXCPU		24	/* CPU limit exceeded (4.2 BSD).  */
+#define	SIGXFSZ		25	/* File size limit exceeded (4.2 BSD).  */
+#define	SIGVTALRM	26	/* Virtual alarm clock (4.2 BSD).  */
+#define	SIGPROF		27	/* Profiling alarm clock (4.2 BSD).  */
+#define	SIGWINCH	28	/* Window size change (4.3 BSD, Sun).  */
+#define	SIGPOLL		SIGIO	/* Pollable event occurred (System V).  */
+#define	SIGIO		29	/* I/O now possible (4.2 BSD).  */
+#define	SIGPWR		30	/* Power failure restart (System V).  */
+#define SIGSYS		31	/* Bad system call.  */
+#define SIGUNUSED	31
+
+#endif	/* <signal.h> included.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigset.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigset.h
new file mode 100644
index 0000000..4ef2231
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigset.h
@@ -0,0 +1,223 @@
+/* __sig_atomic_t, __sigset_t, and related definitions.  Linux version.
+   Copyright (C) 1991, 1992, 1994, 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef	_SIGSET_H_types
+# define _SIGSET_H_types	1
+
+typedef int __sig_atomic_t;
+
+/* A 'sigset_t' has a bit for each signal.
+ * glibc has space for 1024 signals (!), but most arches supported
+ * by Linux have 64 signals, and only MIPS has 128.
+ * There seems to be some historical baggage in sparc[64]
+ * where they might have (or had in the past) 32 signals only,
+ * I hope it's irrelevant now.
+ * Signal 0 does not exist, so we have signals 1..64, not 0..63.
+ * In uclibc, kernel and userspace sigset_t is always the same.
+ * BTW, struct sigaction is also the same on kernel and userspace side.
+ */
+#if defined(__mips__)
+# define _SIGSET_NWORDS	(128 / (8 * sizeof (unsigned long)))
+#else
+# define _SIGSET_NWORDS	(64 / (8 * sizeof (unsigned long)))
+#endif
+typedef struct {
+	unsigned long __val[_SIGSET_NWORDS];
+} __sigset_t;
+
+#endif
+
+
+/* We only want to define these functions if <signal.h> was actually
+   included; otherwise we were included just to define the types.  Since we
+   are namespace-clean, it wouldn't hurt to define extra macros.  But
+   trouble can be caused by functions being defined (e.g., any global
+   register vars declared later will cause compilation errors).  */
+
+#if !defined _SIGSET_H_fns && defined _SIGNAL_H
+# define _SIGSET_H_fns 1
+
+/* Return a mask that includes the bit for SIG only.  */
+/* Unsigned cast ensures shift/mask insns are used.  */
+# define __sigmask(sig) \
+  (((unsigned long) 1) << ((unsigned)((sig) - 1) % (8 * sizeof (unsigned long))))
+
+/* Return the word index for SIG.  */
+# define __sigword(sig)	((unsigned)((sig) - 1) / (8 * sizeof (unsigned long)))
+
+/* gcc 4.3.1 is not clever enough to optimize for _SIGSET_NWORDS == 1 and 2,
+ * which are about the only values which can be there */
+
+# if defined __GNUC__ && __GNUC__ >= 2
+#  define __sigemptyset(set) \
+(__extension__ ({ \
+	sigset_t *__set = (set);					\
+	if (_SIGSET_NWORDS <= 2) {					\
+		__set->__val[0] = 0;					\
+		if (_SIGSET_NWORDS == 2)				\
+			__set->__val[1] = 0;				\
+	} else {							\
+		int __cnt = _SIGSET_NWORDS;				\
+		while (--__cnt >= 0) __set->__val[__cnt] = 0;		\
+	}								\
+	0;								\
+}))
+#  define __sigfillset(set) \
+(__extension__ ({ \
+	sigset_t *__set = (set);					\
+	if (_SIGSET_NWORDS <= 2) {					\
+		__set->__val[0] = ~0UL;					\
+		if (_SIGSET_NWORDS == 2)				\
+			__set->__val[1] = ~0UL;				\
+	} else {							\
+		int __cnt = _SIGSET_NWORDS;				\
+		while (--__cnt >= 0) __set->__val[__cnt] = ~0UL;	\
+	}								\
+	0;								\
+}))
+
+#  ifdef __USE_GNU
+/* The POSIX does not specify for handling the whole signal set in one
+   command.  This is often wanted and so we define three more functions
+   here.  */
+#   define __sigisemptyset(set) \
+(__extension__ ({ \
+	long __ret;							\
+	const sigset_t *__set = (set);					\
+	if (_SIGSET_NWORDS == 1) {					\
+		__ret = __set->__val[0];				\
+	} else if (_SIGSET_NWORDS == 2) {				\
+		__ret = __set->__val[0] | __set->__val[1];		\
+	} else {							\
+		int __cnt = _SIGSET_NWORDS;				\
+		__ret = __set->__val[--__cnt];				\
+		while (!__ret && --__cnt >= 0)				\
+			__ret = __set->__val[__cnt];			\
+	}								\
+	__ret == 0;							\
+}))
+#   define __sigandset(dest, left, right) \
+(__extension__ ({ \
+	sigset_t *__dest = (dest);					\
+	const sigset_t *__left = (left);				\
+	const sigset_t *__right = (right);				\
+	if (_SIGSET_NWORDS <= 2) {					\
+		__dest->__val[0] = __left->__val[0] & __right->__val[0];\
+		if (_SIGSET_NWORDS == 2)				\
+			__dest->__val[1] = __left->__val[1] & __right->__val[1];\
+	} else {							\
+		int __cnt = _SIGSET_NWORDS;				\
+		while (--__cnt >= 0)					\
+			__dest->__val[__cnt] = (__left->__val[__cnt]	\
+					& __right->__val[__cnt]);	\
+	}								\
+	0;								\
+}))
+#   define __sigorset(dest, left, right) \
+(__extension__ ({ \
+	sigset_t *__dest = (dest);					\
+	const sigset_t *__left = (left);				\
+	const sigset_t *__right = (right);				\
+	if (_SIGSET_NWORDS <= 2) {					\
+		__dest->__val[0] = __left->__val[0] | __right->__val[0];\
+		if (_SIGSET_NWORDS == 2)				\
+			__dest->__val[1] = __left->__val[1] | __right->__val[1];\
+	} else {							\
+		int __cnt = _SIGSET_NWORDS;				\
+		while (--__cnt >= 0)					\
+			__dest->__val[__cnt] = (__left->__val[__cnt]	\
+					| __right->__val[__cnt]);	\
+	}								\
+	0;								\
+}))
+#  endif
+# endif
+
+/* These functions needn't check for a bogus signal number -- error
+   checking is done in the non __ versions.  */
+
+# if !defined __USE_EXTERN_INLINES || defined __PROVIDE_OUT_OF_LINE_SIGSETFN
+extern int __sigismember (__const __sigset_t *, int);
+libc_hidden_proto(__sigismember)
+extern int __sigaddset (__sigset_t *, int);
+libc_hidden_proto(__sigaddset)
+extern int __sigdelset (__sigset_t *, int);
+libc_hidden_proto(__sigdelset)
+# endif
+
+# ifdef __USE_EXTERN_INLINES
+#  undef _EXTERN_INLINE
+#  ifdef __PROVIDE_OUT_OF_LINE_SIGSETFN
+#   define _EXTERN_INLINE
+#  else /* normal case */
+    /* dropped extern below: otherwise every module with __USE_EXTERN_INLINES
+     * will have its own copy of out-of line function emitted. */
+#   define _EXTERN_INLINE /*extern*/ __always_inline
+#  endif
+#  define __SIGSETFN(NAME, BODY, CONST)					\
+_EXTERN_INLINE int							\
+NAME (CONST __sigset_t *__set, int __sig)				\
+{									\
+	unsigned long __mask = __sigmask (__sig);			\
+	unsigned __word = __sigword (__sig);				\
+	return BODY;							\
+}
+
+__SIGSETFN (__sigismember, (__set->__val[__word] & __mask) ? 1 : 0, __const)
+__SIGSETFN (__sigaddset, ((__set->__val[__word] |= __mask), 0), )
+__SIGSETFN (__sigdelset, ((__set->__val[__word] &= ~__mask), 0), )
+
+#  undef __SIGSETFN
+# endif
+
+# ifdef _LIBC
+/* It's far too much PITA to __USE_EXTERN_INLINES from within libc.
+ * Especially since we want to inline only calls with const sig,
+ * but __USE_EXTERN_INLINES will inline all calls!
+ */
+static __always_inline unsigned long
+const_sigismember(const __sigset_t *set, int sig)
+{
+	unsigned long mask = __sigmask(sig);
+	unsigned word = __sigword(sig);
+	return (set->__val[word] & mask);
+}
+#  define __sigismember(set, sig) \
+	(__builtin_constant_p(sig) ? (const_sigismember(set, sig) != 0) : __sigismember(set, sig))
+static __always_inline void
+const_sigaddset(__sigset_t *set, int sig)
+{
+	unsigned long mask = __sigmask(sig);
+	unsigned word = __sigword(sig);
+	set->__val[word] |= mask;
+}
+#  define __sigaddset(set, sig) \
+	(__builtin_constant_p(sig) ? (const_sigaddset(set, sig), 0)  : __sigaddset(set, sig))
+static __always_inline void
+const_sigdelset(__sigset_t *set, int sig)
+{
+	unsigned long mask = __sigmask(sig);
+	unsigned word = __sigword(sig);
+	set->__val[word] &= ~mask;
+}
+#  define __sigdelset(set, sig) \
+	(__builtin_constant_p(sig) ? (const_sigdelset(set, sig), 0) : __sigdelset(set, sig))
+# endif
+
+#endif /* ! _SIGSET_H_fns.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigstack.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigstack.h
new file mode 100644
index 0000000..2b3b321
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigstack.h
@@ -0,0 +1,57 @@
+/* sigstack, sigaltstack definitions.
+   Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SIGNAL_H
+# error "Never include this file directly.  Use <signal.h> instead"
+#endif
+
+
+#if defined __UCLIBC_SUSV4_LEGACY__ || !defined __UCLIBC_STRICT_HEADERS__
+/* Structure describing a signal stack (obsolete).  */
+struct sigstack
+  {
+    void *ss_sp;		/* Signal stack pointer.  */
+    int ss_onstack;		/* Nonzero if executing on this stack.  */
+  };
+#endif
+
+
+/* Possible values for `ss_flags.'.  */
+enum
+{
+  SS_ONSTACK = 1,
+#define SS_ONSTACK	SS_ONSTACK
+  SS_DISABLE
+#define SS_DISABLE	SS_DISABLE
+};
+
+/* Minimum stack size for a signal handler.  */
+#define MINSIGSTKSZ	2048
+
+/* System default stack size.  */
+#define SIGSTKSZ	8192
+
+
+/* Alternate, preferred interface.  */
+typedef struct sigaltstack
+  {
+    void *ss_sp;
+    int ss_flags;
+    size_t ss_size;
+  } stack_t;
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigthread.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigthread.h
new file mode 100644
index 0000000..4f14b9f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sigthread.h
@@ -0,0 +1,44 @@
+/* Signal handling function for threaded programs.
+   Copyright (C) 1998, 1999, 2000, 2002, 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _BITS_SIGTHREAD_H
+#define _BITS_SIGTHREAD_H	1
+
+#if !defined _SIGNAL_H && !defined _PTHREAD_H
+# error "Never include this file directly.  Use <pthread.h> instead"
+#endif
+
+/* Functions for handling signals. */
+
+/* Modify the signal mask for the calling thread.  The arguments have
+   the same meaning as for sigprocmask(2). */
+extern int pthread_sigmask (int __how,
+			    __const __sigset_t *__restrict __newmask,
+			    __sigset_t *__restrict __oldmask)__THROW;
+
+/* Send signal SIGNO to the given thread. */
+extern int pthread_kill (pthread_t __threadid, int __signo) __THROW;
+
+#if defined __USE_GNU && defined __UCLIBC_HAS_THREADS_NATIVE__
+/* Queue signal and data to a thread.  */
+extern int pthread_sigqueue (pthread_t __threadid, int __signo,
+			     const union sigval __value) __THROW;
+#endif
+
+#endif	/* bits/sigthread.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/sockaddr.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sockaddr.h
new file mode 100644
index 0000000..3e1d131
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/sockaddr.h
@@ -0,0 +1,40 @@
+/* Definition of `struct sockaddr_*' common members.  Generic/4.2 BSD version.
+   Copyright (C) 1995,1996,1997,1998,2000,2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/*
+ * Never include this file directly; use <sys/socket.h> instead.
+ */
+
+#ifndef _BITS_SOCKADDR_H
+#define _BITS_SOCKADDR_H	1
+
+
+/* POSIX.1g specifies this type name for the `sa_family' member.  */
+typedef unsigned short int sa_family_t;
+
+/* This macro is used to declare the initial common members
+   of the data types used for socket addresses, `struct sockaddr',
+   `struct sockaddr_in', `struct sockaddr_un', etc.  */
+
+#define	__SOCKADDR_COMMON(sa_prefix) \
+  sa_family_t sa_prefix##family
+
+#define __SOCKADDR_COMMON_SIZE	(sizeof (unsigned short int))
+
+#endif	/* bits/sockaddr.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/socket.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/socket.h
new file mode 100644
index 0000000..7e12733
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/socket.h
@@ -0,0 +1,364 @@
+/* System-specific socket constants and types.  Linux version.
+   Copyright (C) 1991,1992,1994-2001,2004,2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef __BITS_SOCKET_H
+#define __BITS_SOCKET_H
+
+#if !defined _SYS_SOCKET_H && !defined _NETINET_IN_H
+# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
+#endif
+
+#define	__need_size_t
+#define __need_NULL
+#include <stddef.h>
+
+#include <limits.h>
+#include <sys/types.h>
+
+/* Type for length arguments in socket calls.  */
+#ifndef __socklen_t_defined
+typedef __socklen_t socklen_t;
+# define __socklen_t_defined
+#endif
+
+/* Types of sockets.  */
+enum __socket_type
+{
+  SOCK_STREAM = 1,		/* Sequenced, reliable, connection-based
+				   byte streams.  */
+#define SOCK_STREAM SOCK_STREAM
+  SOCK_DGRAM = 2,		/* Connectionless, unreliable datagrams
+				   of fixed maximum length.  */
+#define SOCK_DGRAM SOCK_DGRAM
+  SOCK_RAW = 3,			/* Raw protocol interface.  */
+#define SOCK_RAW SOCK_RAW
+  SOCK_RDM = 4,			/* Reliably-delivered messages.  */
+#define SOCK_RDM SOCK_RDM
+  SOCK_SEQPACKET = 5,		/* Sequenced, reliable, connection-based,
+				   datagrams of fixed maximum length.  */
+#define SOCK_SEQPACKET SOCK_SEQPACKET
+  SOCK_PACKET = 10,		/* Linux specific way of getting packets
+				   at the dev level.  For writing rarp and
+				   other similar things on the user level. */
+#define SOCK_PACKET SOCK_PACKET
+
+  /* Flags to be ORed into the type parameter of socket and socketpair and
+     used for the flags parameter of paccept.  */
+
+  SOCK_CLOEXEC = 02000000,	/* Atomically set close-on-exec flag for the
+				   new descriptor(s).  */
+#define SOCK_CLOEXEC SOCK_CLOEXEC
+  SOCK_NONBLOCK = 04000		/* Atomically mark descriptor(s) as
+				   non-blocking.  */
+#define SOCK_NONBLOCK SOCK_NONBLOCK
+};
+
+/* Protocol families.  */
+#define	PF_UNSPEC	0	/* Unspecified.  */
+#define	PF_LOCAL	1	/* Local to host (pipes and file-domain).  */
+#define	PF_UNIX		PF_LOCAL /* Old BSD name for PF_LOCAL.  */
+#define	PF_FILE		PF_LOCAL /* Another non-standard name for PF_LOCAL.  */
+#define	PF_INET		2	/* IP protocol family.  */
+#define	PF_AX25		3	/* Amateur Radio AX.25.  */
+#define	PF_IPX		4	/* Novell Internet Protocol.  */
+#define	PF_APPLETALK	5	/* Appletalk DDP.  */
+#define	PF_NETROM	6	/* Amateur radio NetROM.  */
+#define	PF_BRIDGE	7	/* Multiprotocol bridge.  */
+#define	PF_ATMPVC	8	/* ATM PVCs.  */
+#define	PF_X25		9	/* Reserved for X.25 project.  */
+#define	PF_INET6	10	/* IP version 6.  */
+#define	PF_ROSE		11	/* Amateur Radio X.25 PLP.  */
+#define	PF_DECnet	12	/* Reserved for DECnet project.  */
+#define	PF_NETBEUI	13	/* Reserved for 802.2LLC project.  */
+#define	PF_SECURITY	14	/* Security callback pseudo AF.  */
+#define	PF_KEY		15	/* PF_KEY key management API.  */
+#define	PF_NETLINK	16
+#define	PF_ROUTE	PF_NETLINK /* Alias to emulate 4.4BSD.  */
+#define	PF_PACKET	17	/* Packet family.  */
+#define	PF_ASH		18	/* Ash.  */
+#define	PF_ECONET	19	/* Acorn Econet.  */
+#define	PF_ATMSVC	20	/* ATM SVCs.  */
+#define	PF_SNA		22	/* Linux SNA Project */
+#define	PF_IRDA		23	/* IRDA sockets.  */
+#define	PF_PPPOX	24	/* PPPoX sockets.  */
+#define	PF_WANPIPE	25	/* Wanpipe API sockets.  */
+#define	PF_LLC		26	/* Linux LLC.  */
+#define	PF_CAN		29	/* Controller Area Network.  */
+#define	PF_TIPC		30	/* TIPC sockets.  */
+#define	PF_BLUETOOTH	31	/* Bluetooth sockets.  */
+#define	PF_IUCV		32	/* IUCV sockets.  */
+#define	PF_RXRPC	33	/* RxRPC sockets.  */
+#define	PF_ISDN		34	/* mISDN sockets.  */
+#define	PF_PHONET	35	/* Phonet sockets.  */
+#define	PF_IEEE802154	36	/* IEEE 802.15.4 sockets.  */
+#define	PF_CAIF		37	/* CAIF sockets.  */
+#define	PF_ALG		38	/* Algorithm sockets.  */
+#define	PF_MAX		39	/* For now..  */
+
+/* Address families.  */
+#define	AF_UNSPEC	PF_UNSPEC
+#define	AF_LOCAL	PF_LOCAL
+#define	AF_UNIX		PF_UNIX
+#define	AF_FILE		PF_FILE
+#define	AF_INET		PF_INET
+#define	AF_AX25		PF_AX25
+#define	AF_IPX		PF_IPX
+#define	AF_APPLETALK	PF_APPLETALK
+#define	AF_NETROM	PF_NETROM
+#define	AF_BRIDGE	PF_BRIDGE
+#define	AF_ATMPVC	PF_ATMPVC
+#define	AF_X25		PF_X25
+#define	AF_INET6	PF_INET6
+#define	AF_ROSE		PF_ROSE
+#define	AF_DECnet	PF_DECnet
+#define	AF_NETBEUI	PF_NETBEUI
+#define	AF_SECURITY	PF_SECURITY
+#define	AF_KEY		PF_KEY
+#define	AF_NETLINK	PF_NETLINK
+#define	AF_ROUTE	PF_ROUTE
+#define	AF_PACKET	PF_PACKET
+#define	AF_ASH		PF_ASH
+#define	AF_ECONET	PF_ECONET
+#define	AF_ATMSVC	PF_ATMSVC
+#define	AF_SNA		PF_SNA
+#define	AF_IRDA		PF_IRDA
+#define	AF_PPPOX	PF_PPPOX
+#define	AF_WANPIPE	PF_WANPIPE
+#define	AF_LLC		PF_LLC
+#define	AF_CAN		PF_CAN
+#define	AF_TIPC		PF_TIPC
+#define	AF_BLUETOOTH	PF_BLUETOOTH
+#define	AF_IUCV		PF_IUCV
+#define	AF_RXRPC	PF_RXRPC
+#define	AF_ISDN		PF_ISDN
+#define	AF_PHONET	PF_PHONET
+#define	AF_IEEE802154	PF_IEEE802154
+#define	AF_CAIF		PF_CAIF
+#define	AF_ALG		PF_ALG
+#define	AF_MAX		PF_MAX
+
+/* Socket level values.  Others are defined in the appropriate headers.
+
+   XXX These definitions also should go into the appropriate headers as
+   far as they are available.  */
+#define SOL_RAW		255
+#define SOL_DECNET      261
+#define SOL_X25         262
+#define SOL_PACKET	263
+#define SOL_ATM		264	/* ATM layer (cell level).  */
+#define SOL_AAL		265	/* ATM Adaption Layer (packet level).  */
+#define SOL_IRDA	266
+
+/* Maximum queue length specifiable by listen.  */
+#define SOMAXCONN	128
+
+/* Get the definition of the macro to define the common sockaddr members.  */
+#include <bits/sockaddr.h>
+
+/* Structure describing a generic socket address.  */
+struct sockaddr
+  {
+    __SOCKADDR_COMMON (sa_);	/* Common data: address family and length.  */
+    char sa_data[14];		/* Address data.  */
+  };
+
+
+/* Structure large enough to hold any socket address (with the historical
+   exception of AF_UNIX).  We reserve 128 bytes.  */
+#if ULONG_MAX > 0xffffffff
+# define __ss_aligntype	__uint64_t
+#else
+# define __ss_aligntype	__uint32_t
+#endif
+#define _SS_SIZE	128
+#define _SS_PADSIZE	(_SS_SIZE - (2 * sizeof (__ss_aligntype)))
+
+struct sockaddr_storage
+  {
+    __SOCKADDR_COMMON (ss_);	/* Address family, etc.  */
+    __ss_aligntype __ss_align;	/* Force desired alignment.  */
+    char __ss_padding[_SS_PADSIZE];
+  };
+
+
+/* Bits in the FLAGS argument to `send', `recv', et al.  */
+enum
+  {
+    MSG_OOB		= 0x01,	/* Process out-of-band data.  */
+#define MSG_OOB		MSG_OOB
+    MSG_PEEK		= 0x02,	/* Peek at incoming messages.  */
+#define MSG_PEEK	MSG_PEEK
+    MSG_DONTROUTE	= 0x04,	/* Don't use local routing.  */
+#define MSG_DONTROUTE	MSG_DONTROUTE
+#ifdef __USE_GNU
+    /* DECnet uses a different name.  */
+    MSG_TRYHARD		= MSG_DONTROUTE,
+# define MSG_TRYHARD	MSG_DONTROUTE
+#endif
+    MSG_CTRUNC		= 0x08,	/* Control data lost before delivery.  */
+#define MSG_CTRUNC	MSG_CTRUNC
+    MSG_PROXY		= 0x10,	/* Supply or ask second address.  */
+#define MSG_PROXY	MSG_PROXY
+    MSG_TRUNC		= 0x20,
+#define	MSG_TRUNC	MSG_TRUNC
+    MSG_DONTWAIT	= 0x40, /* Nonblocking IO.  */
+#define	MSG_DONTWAIT	MSG_DONTWAIT
+    MSG_EOR		= 0x80, /* End of record.  */
+#define	MSG_EOR		MSG_EOR
+    MSG_WAITALL		= 0x100, /* Wait for a full request.  */
+#define	MSG_WAITALL	MSG_WAITALL
+    MSG_FIN		= 0x200,
+#define	MSG_FIN		MSG_FIN
+    MSG_SYN		= 0x400,
+#define	MSG_SYN		MSG_SYN
+    MSG_CONFIRM		= 0x800, /* Confirm path validity.  */
+#define	MSG_CONFIRM	MSG_CONFIRM
+    MSG_RST		= 0x1000,
+#define	MSG_RST		MSG_RST
+    MSG_ERRQUEUE	= 0x2000, /* Fetch message from error queue.  */
+#define	MSG_ERRQUEUE	MSG_ERRQUEUE
+    MSG_NOSIGNAL	= 0x4000, /* Do not generate SIGPIPE.  */
+#define	MSG_NOSIGNAL	MSG_NOSIGNAL
+    MSG_MORE		= 0x8000  /* Sender will send more.  */
+#define	MSG_MORE	MSG_MORE
+  };
+
+
+/* Structure describing messages sent by
+   `sendmsg' and received by `recvmsg'.  */
+/* Note: do not change these members to match glibc; these match the
+   SuSv3 spec already (e.g. msg_iovlen/msg_controllen).
+   http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/socket.h.html */
+/* Note: linux kernel uses __kernel_size_t (which is 8bytes on 64bit
+   platforms, and 4bytes on 32bit platforms) for msg_iovlen/msg_controllen */
+struct msghdr
+  {
+    void *msg_name;		/* Address to send to/receive from.  */
+    socklen_t msg_namelen;	/* Length of address data.  */
+
+    struct iovec *msg_iov;	/* Vector of data to send/receive into.  */
+#if __WORDSIZE == 32
+    int msg_iovlen;		/* Number of elements in the vector.  */
+#else
+    size_t msg_iovlen;		/* Number of elements in the vector.  */
+#endif
+
+    void *msg_control;		/* Ancillary data (eg BSD filedesc passing). */
+#if __WORDSIZE == 32
+    socklen_t msg_controllen;	/* Ancillary data buffer length.  */
+#else
+    size_t msg_controllen;	/* Ancillary data buffer length.  */
+#endif
+
+    int msg_flags;		/* Flags on received message.  */
+  };
+
+/* Structure used for storage of ancillary data object information.  */
+struct cmsghdr
+  {
+    size_t cmsg_len;		/* Length of data in cmsg_data plus length
+				   of cmsghdr structure.  */
+    int cmsg_level;		/* Originating protocol.  */
+    int cmsg_type;		/* Protocol specific type.  */
+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+    __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data.  */
+#endif
+  };
+
+/* Ancillary data object manipulation macros.  */
+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
+#else
+# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
+#endif
+#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
+#define CMSG_FIRSTHDR(mhdr) \
+  ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr)		      \
+   ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
+#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
+			 & (size_t) ~(sizeof (size_t) - 1))
+#define CMSG_SPACE(len) (CMSG_ALIGN (len) \
+			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
+#define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+
+extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+				      struct cmsghdr *__cmsg) __THROW;
+libc_hidden_proto(__cmsg_nxthdr)
+#ifdef __USE_EXTERN_INLINES
+# ifndef _EXTERN_INLINE
+#  define _EXTERN_INLINE extern __inline
+# endif
+_EXTERN_INLINE struct cmsghdr *
+__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+{
+  if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+    /* The kernel header does this so there may be a reason.  */
+    return 0;
+
+  __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+			       + CMSG_ALIGN (__cmsg->cmsg_len));
+  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+					+ __mhdr->msg_controllen)
+      || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+    /* No more entries.  */
+    return 0;
+  return __cmsg;
+}
+#endif	/* Use `extern inline'.  */
+
+/* Socket level message types.  This must match the definitions in
+   <linux/socket.h>.  */
+enum
+  {
+    SCM_RIGHTS = 0x01		/* Transfer file descriptors.  */
+#define SCM_RIGHTS SCM_RIGHTS
+#ifdef __USE_BSD
+    , SCM_CREDENTIALS = 0x02	/* Credentials passing.  */
+# define SCM_CREDENTIALS SCM_CREDENTIALS
+#endif
+  };
+
+/* User visible structure for SCM_CREDENTIALS message */
+
+struct ucred
+{
+  pid_t pid;			/* PID of sending process.  */
+  uid_t uid;			/* UID of sending process.  */
+  gid_t gid;			/* GID of sending process.  */
+};
+
+/* Get socket manipulation related informations from kernel headers.  */
+#ifndef __GLIBC__
+#define __GLIBC__ 2
+#include <asm/socket.h>
+#undef __GLIBC__
+#else
+#include <asm/socket.h>
+#endif
+
+
+/* Structure used to manipulate the SO_LINGER option.  */
+struct linger
+  {
+    int l_onoff;		/* Nonzero to linger on close.  */
+    int l_linger;		/* Time to linger.  */
+  };
+
+#endif	/* bits/socket.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/stab.def b/ap/build/uClibc/libc/sysdeps/linux/common/bits/stab.def
new file mode 100644
index 0000000..3d54774
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/stab.def
@@ -0,0 +1,234 @@
+/* Table of DBX symbol codes for the GNU system.
+   Copyright (C) 1988, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* This contains contribution from Cygnus Support.  */
+
+/* Global variable.  Only the name is significant.
+   To find the address, look in the corresponding external symbol.  */
+__define_stab (N_GSYM, 0x20, "GSYM")
+
+/* Function name for BSD Fortran.  Only the name is significant.
+   To find the address, look in the corresponding external symbol.  */
+__define_stab (N_FNAME, 0x22, "FNAME")
+
+/* Function name or text-segment variable for C.  Value is its address.
+   Desc is supposedly starting line number, but GCC doesn't set it
+   and DBX seems not to miss it.  */
+__define_stab (N_FUN, 0x24, "FUN")
+
+/* Data-segment variable with internal linkage.  Value is its address.
+   "Static Sym".  */
+__define_stab (N_STSYM, 0x26, "STSYM")
+
+/* BSS-segment variable with internal linkage.  Value is its address.  */
+__define_stab (N_LCSYM, 0x28, "LCSYM")
+
+/* Name of main routine.  Only the name is significant.
+   This is not used in C.  */
+__define_stab (N_MAIN, 0x2a, "MAIN")
+
+/* Global symbol in Pascal.
+   Supposedly the value is its line number; I'm skeptical.  */
+__define_stab (N_PC, 0x30, "PC")
+
+/* Number of symbols:  0, files,,funcs,lines according to Ultrix V4.0. */
+__define_stab (N_NSYMS, 0x32, "NSYMS")
+
+/* "No DST map for sym: name, ,0,type,ignored"  according to Ultrix V4.0. */
+__define_stab (N_NOMAP, 0x34, "NOMAP")
+
+/* New stab from Solaris.  I don't know what it means, but it
+   don't seem to contain useful information.  */
+__define_stab (N_OBJ, 0x38, "OBJ")
+
+/* New stab from Solaris.  I don't know what it means, but it
+   don't seem to contain useful information.  Possibly related to the
+   optimization flags used in this module.  */
+__define_stab (N_OPT, 0x3c, "OPT")
+
+/* Register variable.  Value is number of register.  */
+__define_stab (N_RSYM, 0x40, "RSYM")
+
+/* Modula-2 compilation unit.  Can someone say what info it contains?  */
+__define_stab (N_M2C, 0x42, "M2C")
+
+/* Line number in text segment.  Desc is the line number;
+   value is corresponding address.  */
+__define_stab (N_SLINE, 0x44, "SLINE")
+
+/* Similar, for data segment.  */
+__define_stab (N_DSLINE, 0x46, "DSLINE")
+
+/* Similar, for bss segment.  */
+__define_stab (N_BSLINE, 0x48, "BSLINE")
+
+/* Sun's source-code browser stabs.  ?? Don't know what the fields are.
+   Supposedly the field is "path to associated .cb file".  THIS VALUE
+   OVERLAPS WITH N_BSLINE!  */
+__define_stab (N_BROWS, 0x48, "BROWS")
+
+/* GNU Modula-2 definition module dependency.  Value is the modification time
+   of the definition file.  Other is non-zero if it is imported with the
+   GNU M2 keyword %INITIALIZE.  Perhaps N_M2C can be used if there
+   are enough empty fields? */
+__define_stab(N_DEFD, 0x4a, "DEFD")
+
+/* THE FOLLOWING TWO STAB VALUES CONFLICT.  Happily, one is for Modula-2
+   and one is for C++.   Still,... */
+/* GNU C++ exception variable.  Name is variable name.  */
+__define_stab (N_EHDECL, 0x50, "EHDECL")
+/* Modula2 info "for imc":  name,,0,0,0  according to Ultrix V4.0.  */
+__define_stab (N_MOD2, 0x50, "MOD2")
+
+/* GNU C++ `catch' clause.  Value is its address.  Desc is nonzero if
+   this entry is immediately followed by a CAUGHT stab saying what exception
+   was caught.  Multiple CAUGHT stabs means that multiple exceptions
+   can be caught here.  If Desc is 0, it means all exceptions are caught
+   here.  */
+__define_stab (N_CATCH, 0x54, "CATCH")
+
+/* Structure or union element.  Value is offset in the structure.  */
+__define_stab (N_SSYM, 0x60, "SSYM")
+
+/* Name of main source file.
+   Value is starting text address of the compilation.  */
+__define_stab (N_SO, 0x64, "SO")
+
+/* Automatic variable in the stack.  Value is offset from frame pointer.
+   Also used for type descriptions.  */
+__define_stab (N_LSYM, 0x80, "LSYM")
+
+/* Beginning of an include file.  Only Sun uses this.
+   In an object file, only the name is significant.
+   The Sun linker puts data into some of the other fields.  */
+__define_stab (N_BINCL, 0x82, "BINCL")
+
+/* Name of sub-source file (#include file).
+   Value is starting text address of the compilation.  */
+__define_stab (N_SOL, 0x84, "SOL")
+
+/* Parameter variable.  Value is offset from argument pointer.
+   (On most machines the argument pointer is the same as the frame pointer.  */
+__define_stab (N_PSYM, 0xa0, "PSYM")
+
+/* End of an include file.  No name.
+   This and N_BINCL act as brackets around the file's output.
+   In an object file, there is no significant data in this entry.
+   The Sun linker puts data into some of the fields.  */
+__define_stab (N_EINCL, 0xa2, "EINCL")
+
+/* Alternate entry point.  Value is its address.  */
+__define_stab (N_ENTRY, 0xa4, "ENTRY")
+
+/* Beginning of lexical block.
+   The desc is the nesting level in lexical blocks.
+   The value is the address of the start of the text for the block.
+   The variables declared inside the block *precede* the N_LBRAC symbol.  */
+__define_stab (N_LBRAC, 0xc0, "LBRAC")
+
+/* Place holder for deleted include file.  Replaces a N_BINCL and everything
+   up to the corresponding N_EINCL.  The Sun linker generates these when
+   it finds multiple identical copies of the symbols from an include file.
+   This appears only in output from the Sun linker.  */
+__define_stab (N_EXCL, 0xc2, "EXCL")
+
+/* Modula-2 scope information.  Can someone say what info it contains?  */
+__define_stab (N_SCOPE, 0xc4, "SCOPE")
+
+/* End of a lexical block.  Desc matches the N_LBRAC's desc.
+   The value is the address of the end of the text for the block.  */
+__define_stab (N_RBRAC, 0xe0, "RBRAC")
+
+/* Begin named common block.  Only the name is significant.  */
+__define_stab (N_BCOMM, 0xe2, "BCOMM")
+
+/* End named common block.  Only the name is significant
+   (and it should match the N_BCOMM).  */
+__define_stab (N_ECOMM, 0xe4, "ECOMM")
+
+/* End common (local name): value is address.
+   I'm not sure how this is used.  */
+__define_stab (N_ECOML, 0xe8, "ECOML")
+
+/* These STAB's are used on Gould systems for Non-Base register symbols
+   or something like that.  FIXME.  I have assigned the values at random
+   since I don't have a Gould here.  Fixups from Gould folk welcome... */
+__define_stab (N_NBTEXT, 0xF0, "NBTEXT")
+__define_stab (N_NBDATA, 0xF2, "NBDATA")
+__define_stab (N_NBBSS,  0xF4, "NBBSS")
+__define_stab (N_NBSTS,  0xF6, "NBSTS")
+__define_stab (N_NBLCS,  0xF8, "NBLCS")
+
+/* Second symbol entry containing a length-value for the preceding entry.
+   The value is the length.  */
+__define_stab (N_LENG, 0xfe, "LENG")
+
+/* The above information, in matrix format.
+
+			STAB MATRIX
+	_________________________________________________
+	| 00 - 1F are not dbx stab symbols		|
+	| In most cases, the low bit is the EXTernal bit|
+
+	| 00 UNDEF  | 02 ABS	| 04 TEXT   | 06 DATA	|
+	| 01  |EXT  | 03  |EXT	| 05  |EXT  | 07  |EXT	|
+
+	| 08 BSS    | 0A INDR	| 0C FN_SEQ | 0E   	|
+	| 09  |EXT  | 0B 	| 0D	    | 0F	|
+
+	| 10 	    | 12 COMM	| 14 SETA   | 16 SETT	|
+	| 11	    | 13	| 15 	    | 17	|
+
+	| 18 SETD   | 1A SETB	| 1C SETV   | 1E WARNING|
+	| 19	    | 1B	| 1D 	    | 1F FN	|
+
+	|_______________________________________________|
+	| Debug entries with bit 01 set are unused.	|
+	| 20 GSYM   | 22 FNAME	| 24 FUN    | 26 STSYM	|
+	| 28 LCSYM  | 2A MAIN	| 2C	    | 2E	|
+	| 30 PC	    | 32 NSYMS	| 34 NOMAP  | 36	|
+	| 38 OBJ    | 3A	| 3C OPT    | 3E	|
+	| 40 RSYM   | 42 M2C	| 44 SLINE  | 46 DSLINE |
+	| 48 BSLINE*| 4A DEFD	| 4C        | 4E	|
+	| 50 EHDECL*| 52	| 54 CATCH  | 56        |
+	| 58        | 5A        | 5C        | 5E	|
+	| 60 SSYM   | 62	| 64 SO	    | 66 	|
+	| 68 	    | 6A	| 6C	    | 6E	|
+	| 70	    | 72	| 74	    | 76	|
+	| 78	    | 7A	| 7C	    | 7E	|
+	| 80 LSYM   | 82 BINCL	| 84 SOL    | 86	|
+	| 88	    | 8A	| 8C	    | 8E	|
+	| 90	    | 92	| 94	    | 96	|
+	| 98	    | 9A	| 9C	    | 9E	|
+	| A0 PSYM   | A2 EINCL	| A4 ENTRY  | A6	|
+	| A8	    | AA	| AC	    | AE	|
+	| B0	    | B2	| B4	    | B6	|
+	| B8	    | BA	| BC	    | BE	|
+	| C0 LBRAC  | C2 EXCL	| C4 SCOPE  | C6	|
+	| C8	    | CA	| CC	    | CE	|
+	| D0	    | D2	| D4	    | D6	|
+	| D8	    | DA	| DC	    | DE	|
+	| E0 RBRAC  | E2 BCOMM	| E4 ECOMM  | E6	|
+	| E8 ECOML  | EA	| EC	    | EE	|
+	| F0	    | F2	| F4	    | F6	|
+	| F8	    | FA	| FC	    | FE LENG	|
+	+-----------------------------------------------+
+ * 50 EHDECL is also MOD2.
+ * 48 BSLINE is also BROWS.
+ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/stackinfo.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/stackinfo.h
new file mode 100644
index 0000000..1ed7b95
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/stackinfo.h
@@ -0,0 +1,34 @@
+/* Copyright (C) 1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* This file contains a bit of information about the stack allocation
+   of the processor.  Since there is no general truth we can't say
+   anything here.  */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H	1
+
+#error Machine stack direction unknown.
+#if 0
+#define _STACK_GROWS_DOWN	1
+#define _STACK_GROWS_UP		1
+#endif
+
+#endif	/* stackinfo.h */
+
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/stat.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/stat.h
new file mode 100644
index 0000000..5fb868d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/stat.h
@@ -0,0 +1,170 @@
+/* Copyright (C) 1992, 1995-2001, 2002, 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
+
+/* Versions of the `struct stat' data structure.  */
+#define _STAT_VER_LINUX_OLD	1
+#define _STAT_VER_KERNEL	1
+#define _STAT_VER_SVR4		2
+#define _STAT_VER_LINUX		3
+#define _STAT_VER		_STAT_VER_LINUX	/* The one defined below.  */
+
+/* Versions of the `xmknod' interface.  */
+#define _MKNOD_VER_LINUX	1
+#define _MKNOD_VER_SVR4		2
+#define _MKNOD_VER		_MKNOD_VER_LINUX /* The bits defined below.  */
+
+
+struct stat
+  {
+    __dev_t st_dev;			/* Device.  */
+#ifndef __USE_FILE_OFFSET64
+    unsigned short int __pad1;
+    __ino_t st_ino;			/* File serial number.	*/
+#else
+    unsigned int __pad1;
+    __ino_t __st_ino;			/* 32bit file serial number.	*/
+#endif
+    __mode_t st_mode;			/* File mode.  */
+    __nlink_t st_nlink;			/* Link count.  */
+    __uid_t st_uid;			/* User ID of the file's owner.	*/
+    __gid_t st_gid;			/* Group ID of the file's group.*/
+    __dev_t st_rdev;			/* Device number, if device.  */
+#ifndef __USE_FILE_OFFSET64
+    unsigned short int __pad2;
+    __off_t st_size;			/* Size of file, in bytes.  */
+#else
+    unsigned int __pad2;
+    __off64_t st_size;			/* Size of file, in bytes.  */
+#endif
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+
+#ifndef __USE_FILE_OFFSET64
+    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
+#else
+    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+#endif
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+#ifndef __USE_FILE_OFFSET64
+    unsigned long int __unused4;
+    unsigned long int __unused5;
+#else
+    __ino64_t st_ino;			/* File serial number.	*/
+#endif
+  };
+
+#ifdef __USE_LARGEFILE64
+struct stat64
+  {
+    __dev_t st_dev;			/* Device.  */
+    unsigned int __pad1;
+
+    __ino_t __st_ino;			/* 32bit file serial number.	*/
+    __mode_t st_mode;			/* File mode.  */
+    __nlink_t st_nlink;			/* Link count.  */
+    __uid_t st_uid;			/* User ID of the file's owner.	*/
+    __gid_t st_gid;			/* Group ID of the file's group.*/
+    __dev_t st_rdev;			/* Device number, if device.  */
+    unsigned int __pad2;
+    __off64_t st_size;			/* Size of file, in bytes.  */
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
+
+    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+#ifdef __USE_MISC
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
+    __ino64_t st_ino;			/* File serial number.		*/
+  };
+#endif
+
+/* Tell code we have these members.  */
+#define	_STATBUF_ST_BLKSIZE
+#define _STATBUF_ST_RDEV
+/* Nanosecond resolution time values are supported.  */
+#define _STATBUF_ST_NSEC
+
+/* Encoding of the file mode.  */
+
+#define	__S_IFMT	0170000	/* These bits determine file type.  */
+
+/* File types.  */
+#define	__S_IFDIR	0040000	/* Directory.  */
+#define	__S_IFCHR	0020000	/* Character device.  */
+#define	__S_IFBLK	0060000	/* Block device.  */
+#define	__S_IFREG	0100000	/* Regular file.  */
+#define	__S_IFIFO	0010000	/* FIFO.  */
+#define	__S_IFLNK	0120000	/* Symbolic link.  */
+#define	__S_IFSOCK	0140000	/* Socket.  */
+
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
+
+/* Protection bits.  */
+
+#define	__S_ISUID	04000	/* Set user ID on execution.  */
+#define	__S_ISGID	02000	/* Set group ID on execution.  */
+#define	__S_ISVTX	01000	/* Save swapped text after use (sticky).  */
+#define	__S_IREAD	0400	/* Read by owner.  */
+#define	__S_IWRITE	0200	/* Write by owner.  */
+#define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#ifdef __USE_ATFILE
+# define UTIME_NOW	((1l << 30) - 1l)
+# define UTIME_OMIT	((1l << 30) - 2l)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/statfs.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/statfs.h
new file mode 100644
index 0000000..0e27865
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/statfs.h
@@ -0,0 +1,67 @@
+/* Copyright (C) 1997, 1998, 2000, 2002, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_STATFS_H
+# error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead."
+#endif
+
+#include <bits/types.h>
+
+struct statfs
+  {
+    __SWORD_TYPE f_type;
+    __SWORD_TYPE f_bsize;
+#ifndef __USE_FILE_OFFSET64
+    __fsblkcnt_t f_blocks;
+    __fsblkcnt_t f_bfree;
+    __fsblkcnt_t f_bavail;
+    __fsfilcnt_t f_files;
+    __fsfilcnt_t f_ffree;
+#else
+    __fsblkcnt64_t f_blocks;
+    __fsblkcnt64_t f_bfree;
+    __fsblkcnt64_t f_bavail;
+    __fsfilcnt64_t f_files;
+    __fsfilcnt64_t f_ffree;
+#endif
+    __fsid_t f_fsid;
+    __SWORD_TYPE f_namelen;
+    __SWORD_TYPE f_frsize;
+    __SWORD_TYPE f_spare[5];
+  };
+
+#ifdef __USE_LARGEFILE64
+struct statfs64
+  {
+    __SWORD_TYPE f_type;
+    __SWORD_TYPE f_bsize;
+    __fsblkcnt64_t f_blocks;
+    __fsblkcnt64_t f_bfree;
+    __fsblkcnt64_t f_bavail;
+    __fsfilcnt64_t f_files;
+    __fsfilcnt64_t f_ffree;
+    __fsid_t f_fsid;
+    __SWORD_TYPE f_namelen;
+    __SWORD_TYPE f_frsize;
+    __SWORD_TYPE f_spare[5];
+  };
+#endif
+
+/* Tell code we have these members.  */
+#define _STATFS_F_NAMELEN
+#define _STATFS_F_FRSIZE
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/statvfs.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/statvfs.h
new file mode 100644
index 0000000..84717c3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/statvfs.h
@@ -0,0 +1,109 @@
+/* Copyright (C) 1997,1998,2000,2001,2002,2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_STATVFS_H
+# error "Never include <bits/statvfs.h> directly; use <sys/statvfs.h> instead."
+#endif
+
+#include <bits/types.h>  /* For __fsblkcnt_t and __fsfilcnt_t.  */
+
+#if __WORDSIZE == 32
+#define _STATVFSBUF_F_UNUSED
+#endif
+
+struct statvfs
+  {
+    unsigned long int f_bsize;
+    unsigned long int f_frsize;
+#ifndef __USE_FILE_OFFSET64
+    __fsblkcnt_t f_blocks;
+    __fsblkcnt_t f_bfree;
+    __fsblkcnt_t f_bavail;
+    __fsfilcnt_t f_files;
+    __fsfilcnt_t f_ffree;
+    __fsfilcnt_t f_favail;
+#else
+    __fsblkcnt64_t f_blocks;
+    __fsblkcnt64_t f_bfree;
+    __fsblkcnt64_t f_bavail;
+    __fsfilcnt64_t f_files;
+    __fsfilcnt64_t f_ffree;
+    __fsfilcnt64_t f_favail;
+#endif
+    unsigned long int f_fsid;
+#ifdef _STATVFSBUF_F_UNUSED
+    int __f_unused;
+#endif
+    unsigned long int f_flag;
+    unsigned long int f_namemax;
+    int __f_spare[6];
+  };
+
+#ifdef __USE_LARGEFILE64
+struct statvfs64
+  {
+    unsigned long int f_bsize;
+    unsigned long int f_frsize;
+    __fsblkcnt64_t f_blocks;
+    __fsblkcnt64_t f_bfree;
+    __fsblkcnt64_t f_bavail;
+    __fsfilcnt64_t f_files;
+    __fsfilcnt64_t f_ffree;
+    __fsfilcnt64_t f_favail;
+    unsigned long int f_fsid;
+#ifdef _STATVFSBUF_F_UNUSED
+    int __f_unused;
+#endif
+    unsigned long int f_flag;
+    unsigned long int f_namemax;
+    int __f_spare[6];
+  };
+#endif
+
+/* Definitions for the flag in `f_flag'.  These definitions should be
+   kept in sync with the definitions in <sys/mount.h>.  */
+enum
+{
+  ST_RDONLY = 1,		/* Mount read-only.  */
+#define ST_RDONLY	ST_RDONLY
+  ST_NOSUID = 2			/* Ignore suid and sgid bits.  */
+#define ST_NOSUID	ST_NOSUID
+#ifdef __USE_GNU
+  ,
+  ST_NODEV = 4,			/* Disallow access to device special files.  */
+# define ST_NODEV	ST_NODEV
+  ST_NOEXEC = 8,		/* Disallow program execution.  */
+# define ST_NOEXEC	ST_NOEXEC
+  ST_SYNCHRONOUS = 16,		/* Writes are synced at once.  */
+# define ST_SYNCHRONOUS	ST_SYNCHRONOUS
+  ST_MANDLOCK = 64,		/* Allow mandatory locks on an FS.  */
+# define ST_MANDLOCK	ST_MANDLOCK
+  ST_WRITE = 128,		/* Write on file/directory/symlink.  */
+# define ST_WRITE	ST_WRITE
+  ST_APPEND = 256,		/* Append-only file.  */
+# define ST_APPEND	ST_APPEND
+  ST_IMMUTABLE = 512,		/* Immutable file.  */
+# define ST_IMMUTABLE	ST_IMMUTABLE
+  ST_NOATIME = 1024,		/* Do not update access times.  */
+# define ST_NOATIME	ST_NOATIME
+  ST_NODIRATIME = 2048,		/* Do not update directory access times.  */
+# define ST_NODIRATIME	ST_NODIRATIME
+  ST_RELATIME = 4096		/* Update atime relative to mtime/ctime.  */
+# define ST_RELATIME	ST_RELATIME
+#endif	/* Use GNU.  */
+};
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/stdio.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/stdio.h
new file mode 100644
index 0000000..d0ba463
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/stdio.h
@@ -0,0 +1,23 @@
+/* Optimizing macros and inline functions for stdio functions.
+   Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _STDIO_H
+# error "Never include <bits/stdio.h> directly; use <stdio.h> instead."
+#endif
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/stdio_lim.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/stdio_lim.h
new file mode 100644
index 0000000..2c0b36f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/stdio_lim.h
@@ -0,0 +1,43 @@
+/* Copyright (C) 1994, 1997, 1998, 1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if !defined _STDIO_H && !defined __need_FOPEN_MAX && !defined __need_IOV_MAX
+# error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead."
+#endif
+
+#ifdef _STDIO_H
+# ifdef __UCLIBC_SUSV4_LEGACY__
+#  define L_tmpnam 20
+# endif
+# define TMP_MAX 238328
+# define FILENAME_MAX 4095
+
+# ifdef __USE_POSIX
+#  define L_ctermid 9
+#  define L_cuserid 9
+# endif
+#endif
+
+#if defined __need_FOPEN_MAX || defined _STDIO_H
+# undef  FOPEN_MAX
+# define FOPEN_MAX 16
+#endif
+
+#if defined __need_IOV_MAX && !defined IOV_MAX
+# define IOV_MAX 1024
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/syscalls-common.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/syscalls-common.h
new file mode 100644
index 0000000..0f5a9299
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/syscalls-common.h
@@ -0,0 +1,119 @@
+/*
+ * Common syscall type defines
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#ifndef _SYSCALLS_COMMON_H
+#define _SYSCALLS_COMMON_H	1
+
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls-common.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#ifndef SYS_ify
+# define SYS_ify(syscall_name) (__NR_##syscall_name)
+#endif
+
+#ifndef __ASSEMBLER__
+
+#include <errno.h>
+
+#ifndef INTERNAL_SYSCALL_DECL
+# define INTERNAL_SYSCALL_DECL(err)         do { } while (0)
+#endif
+#ifndef INTERNAL_SYSCALL_ERROR_P
+# define INTERNAL_SYSCALL_ERROR_P(val, err) ((unsigned long)val >= (unsigned long)(-4095))
+#endif
+#ifndef INTERNAL_SYSCALL_ERRNO
+# define INTERNAL_SYSCALL_ERRNO(val, err)   (-(val))
+#endif
+
+/* Define a macro which expands into the inline wrapper code for a system call */
+#ifndef INLINE_SYSCALL
+# define INLINE_SYSCALL(name, nr, args...) INLINE_SYSCALL_NCS(__NR_##name, nr, args)
+#endif
+#ifndef INLINE_SYSCALL_NOERR
+# define INLINE_SYSCALL_NOERR(name, nr, args...) INLINE_SYSCALL_NOERR_NCS(__NR_##name, nr, args)
+#endif
+
+/* Just like INLINE_SYSCALL(), but take a non-constant syscall (NCS) argument */
+#ifndef INLINE_SYSCALL_NCS
+# define INLINE_SYSCALL_NCS(name, nr, args...)				\
+(__extension__								\
+ ({									\
+	INTERNAL_SYSCALL_DECL(__err);					\
+	(__extension__							\
+	 ({								\
+	   long __res = INTERNAL_SYSCALL_NCS(name, __err, nr, args);	\
+	   if (unlikely(INTERNAL_SYSCALL_ERROR_P(__res, __err))) {	\
+		__set_errno(INTERNAL_SYSCALL_ERRNO(__res, __err));	\
+		__res = -1L;						\
+	   }								\
+	   __res;							\
+	  })								\
+	);								\
+  })									\
+)
+#endif
+#ifndef INLINE_SYSCALL_NOERR_NCS
+# define INLINE_SYSCALL_NOERR_NCS(name, nr, args...)			\
+({									\
+	INTERNAL_SYSCALL_DECL(__err);					\
+	long __res = INTERNAL_SYSCALL_NCS(name, __err, nr, args);	\
+	__res;								\
+})
+#endif
+
+/* No point in forcing people to implement both when they only need one */
+#ifndef INTERNAL_SYSCALL
+# define INTERNAL_SYSCALL(name, err, nr, args...) INTERNAL_SYSCALL_NCS(__NR_##name, err, nr, args)
+#endif
+
+#ifndef INTERNAL_SYSCALL_NCS
+# error your port needs to define INTERNAL_SYSCALL_NCS in bits/syscalls.h
+#endif
+
+#ifndef _syscall0
+
+#define C_DECL_ARGS_0()			void
+#define C_DECL_ARGS_1(t, v)		t v
+#define C_DECL_ARGS_2(t, v, args...)	t v, C_DECL_ARGS_1(args)
+#define C_DECL_ARGS_3(t, v, args...)	t v, C_DECL_ARGS_2(args)
+#define C_DECL_ARGS_4(t, v, args...)	t v, C_DECL_ARGS_3(args)
+#define C_DECL_ARGS_5(t, v, args...)	t v, C_DECL_ARGS_4(args)
+#define C_DECL_ARGS_6(t, v, args...)	t v, C_DECL_ARGS_5(args)
+
+#define C_ARGS_0()
+#define C_ARGS_1(t, v)			v
+#define C_ARGS_2(t, v, args...)		v, C_ARGS_1(args)
+#define C_ARGS_3(t, v, args...)		v, C_ARGS_2(args)
+#define C_ARGS_4(t, v, args...)		v, C_ARGS_3(args)
+#define C_ARGS_5(t, v, args...)		v, C_ARGS_4(args)
+#define C_ARGS_6(t, v, args...)		v, C_ARGS_5(args)
+
+#define SYSCALL_FUNC(nargs, type, name, args...)			\
+type name(C_DECL_ARGS_##nargs(args)) {					\
+	return (type)INLINE_SYSCALL(name, nargs, C_ARGS_##nargs(args));	\
+}
+
+#define SYSCALL_NOERR_FUNC(nargs, type, name, args...)			\
+type name(C_DECL_ARGS_##nargs(args)) {					\
+	return (type)INLINE_SYSCALL_NOERR(name, nargs, C_ARGS_##nargs(args));	\
+}
+
+#define _syscall0(args...)		SYSCALL_FUNC(0, args)
+#define _syscall_noerr0(args...)	SYSCALL_NOERR_FUNC(0, args)
+#define _syscall1(args...)		SYSCALL_FUNC(1, args)
+#define _syscall_noerr1(args...)	SYSCALL_NOERR_FUNC(1, args)
+#define _syscall2(args...)		SYSCALL_FUNC(2, args)
+#define _syscall3(args...)		SYSCALL_FUNC(3, args)
+#define _syscall4(args...)		SYSCALL_FUNC(4, args)
+#define _syscall5(args...)		SYSCALL_FUNC(5, args)
+#define _syscall6(args...)		SYSCALL_FUNC(6, args)
+
+#endif /* _syscall0 */
+
+#endif /* __ASSEMBLER__ */
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/syscalls.h
new file mode 100644
index 0000000..03d08d1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/syscalls.h
@@ -0,0 +1,9 @@
+/* Unlike the asm/unistd.h kernel header file (which this is partly based on),
+ * this file must be able to cope with PIC and non-PIC code.  For some arches
+ * there is no difference.  For x86 (which has far too few registers) there is
+ * a difference.   Regardless, including asm/unistd.h is hereby officially
+ * forbidden.  Don't do it.  It is bad for you.
+ */
+
+#error You have not provided architecture specific bits/syscalls.h
+#error You should need to define only INTERNAL_SYSCALL_NCS
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/termios.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/termios.h
new file mode 100644
index 0000000..b648d80
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/termios.h
@@ -0,0 +1,219 @@
+/* termios type and macro definitions.  Linux version.
+   Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2003, 2005
+	Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _TERMIOS_H
+# error "Never include <bits/termios.h> directly; use <termios.h> instead."
+#endif
+
+typedef unsigned char	cc_t;
+typedef unsigned int	speed_t;
+typedef unsigned int	tcflag_t;
+
+#define NCCS 32
+struct termios
+  {
+    tcflag_t c_iflag;		/* input mode flags */
+    tcflag_t c_oflag;		/* output mode flags */
+    tcflag_t c_cflag;		/* control mode flags */
+    tcflag_t c_lflag;		/* local mode flags */
+    cc_t c_line;			/* line discipline */
+    cc_t c_cc[NCCS];		/* control characters */
+    speed_t c_ispeed;		/* input speed */
+    speed_t c_ospeed;		/* output speed */
+#define _HAVE_STRUCT_TERMIOS_C_ISPEED 1
+#define _HAVE_STRUCT_TERMIOS_C_OSPEED 1
+  };
+
+/* c_cc characters */
+#define VINTR 0
+#define VQUIT 1
+#define VERASE 2
+#define VKILL 3
+#define VEOF 4
+#define VTIME 5
+#define VMIN 6
+#define VSWTC 7
+#define VSTART 8
+#define VSTOP 9
+#define VSUSP 10
+#define VEOL 11
+#define VREPRINT 12
+#define VDISCARD 13
+#define VWERASE 14
+#define VLNEXT 15
+#define VEOL2 16
+
+/* c_iflag bits */
+#define IGNBRK	0000001
+#define BRKINT	0000002
+#define IGNPAR	0000004
+#define PARMRK	0000010
+#define INPCK	0000020
+#define ISTRIP	0000040
+#define INLCR	0000100
+#define IGNCR	0000200
+#define ICRNL	0000400
+#define IUCLC	0001000
+#define IXON	0002000
+#define IXANY	0004000
+#define IXOFF	0010000
+#define IMAXBEL	0020000
+#define IUTF8	0040000
+
+/* c_oflag bits */
+#define OPOST	0000001
+#define OLCUC	0000002
+#define ONLCR	0000004
+#define OCRNL	0000010
+#define ONOCR	0000020
+#define ONLRET	0000040
+#define OFILL	0000100
+#define OFDEL	0000200
+#if defined __USE_MISC || defined __USE_XOPEN
+# define NLDLY	0000400
+# define   NL0	0000000
+# define   NL1	0000400
+# define CRDLY	0003000
+# define   CR0	0000000
+# define   CR1	0001000
+# define   CR2	0002000
+# define   CR3	0003000
+# define TABDLY	0014000
+# define   TAB0	0000000
+# define   TAB1	0004000
+# define   TAB2	0010000
+# define   TAB3	0014000
+# define BSDLY	0020000
+# define   BS0	0000000
+# define   BS1	0020000
+# define FFDLY	0100000
+# define   FF0	0000000
+# define   FF1	0100000
+#endif
+
+#define VTDLY	0040000
+#define   VT0	0000000
+#define   VT1	0040000
+
+#ifdef __USE_MISC
+# define XTABS	0014000
+#endif
+
+/* c_cflag bit meaning */
+#ifdef __USE_MISC
+# define CBAUD	0010017
+#endif
+#define  B0	0000000		/* hang up */
+#define  B50	0000001
+#define  B75	0000002
+#define  B110	0000003
+#define  B134	0000004
+#define  B150	0000005
+#define  B200	0000006
+#define  B300	0000007
+#define  B600	0000010
+#define  B1200	0000011
+#define  B1800	0000012
+#define  B2400	0000013
+#define  B4800	0000014
+#define  B9600	0000015
+#define  B19200	0000016
+#define  B38400	0000017
+#ifdef __USE_MISC
+# define EXTA B19200
+# define EXTB B38400
+#endif
+#define CSIZE	0000060
+#define   CS5	0000000
+#define   CS6	0000020
+#define   CS7	0000040
+#define   CS8	0000060
+#define CSTOPB	0000100
+#define CREAD	0000200
+#define PARENB	0000400
+#define PARODD	0001000
+#define HUPCL	0002000
+#define CLOCAL	0004000
+#ifdef __USE_MISC
+# define CBAUDEX 0010000
+#endif
+#define  BOTHER   0010000
+#define  B57600   0010001
+#define  B115200  0010002
+#define  B230400  0010003
+#define  B460800  0010004
+#define  B500000  0010005
+#define  B576000  0010006
+#define  B921600  0010007
+#define  B1000000 0010010
+#define  B1152000 0010011
+#define  B1500000 0010012
+#define  B2000000 0010013
+#define  B2500000 0010014
+#define  B3000000 0010015
+#define  B3500000 0010016
+#define  B4000000 0010017
+#define __MAX_BAUD B4000000
+#ifdef __USE_MISC
+# define CIBAUD	  002003600000		/* input baud rate (not used) */
+# define CMSPAR   010000000000		/* mark or space (stick) parity */
+# define CRTSCTS  020000000000		/* flow control */
+#endif
+
+/* c_lflag bits */
+#define ISIG	0000001
+#define ICANON	0000002
+#if defined __USE_MISC || defined __USE_XOPEN
+# define XCASE	0000004
+#endif
+#define ECHO	0000010
+#define ECHOE	0000020
+#define ECHOK	0000040
+#define ECHONL	0000100
+#define NOFLSH	0000200
+#define TOSTOP	0000400
+#ifdef __USE_MISC
+# define ECHOCTL 0001000
+# define ECHOPRT 0002000
+# define ECHOKE	 0004000
+# define FLUSHO	 0010000
+# define PENDIN	 0040000
+#endif
+#define IEXTEN	0100000
+
+/* tcflow() and TCXONC use these */
+#define	TCOOFF		0
+#define	TCOON		1
+#define	TCIOFF		2
+#define	TCION		3
+
+/* tcflush() and TCFLSH use these */
+#define	TCIFLUSH	0
+#define	TCOFLUSH	1
+#define	TCIOFLUSH	2
+
+/* tcsetattr uses these */
+#define	TCSANOW		0
+#define	TCSADRAIN	1
+#define	TCSAFLUSH	2
+
+
+#define _IOT_termios /* Hurd ioctl type field.  */ \
+  _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/time.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/time.h
new file mode 100644
index 0000000..7ed54bf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/time.h
@@ -0,0 +1,79 @@
+/* System-dependent timing definitions.  Generic version.
+   Copyright (C) 1996,1997,1999-2002,2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/*
+ * Never include this file directly; use <time.h> instead.
+ */
+
+#ifndef __need_timeval
+# ifndef _BITS_TIME_H
+#  define _BITS_TIME_H	1
+
+/* ISO/IEC 9899:1990 7.12.1: <time.h>
+   The macro `CLOCKS_PER_SEC' is the number per second of the value
+   returned by the `clock' function. */
+/* CAE XSH, Issue 4, Version 2: <time.h>
+   The value of CLOCKS_PER_SEC is required to be 1 million on all
+   XSI-conformant systems. */
+#  define CLOCKS_PER_SEC  1000000l
+
+/* Get the arch-specific value of __UCLIBC_CLK_TCK_CONST used for CLK_TCK
+ * in sysconf() and clock(). */
+#include <bits/uClibc_clk_tck.h>
+
+#  if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K
+/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
+   presents the real value for clock ticks per second for the system.  */
+#   include <bits/types.h>
+/* Note (uClibc): glibc #defines CLK_TCK as a sysconf() call. */
+#   define CLK_TCK ((__clock_t) __UCLIBC_CLK_TCK_CONST)
+#  endif
+
+#  ifdef __USE_POSIX199309
+/* Identifier for system-wide realtime clock.  */
+#   define CLOCK_REALTIME		0
+/* Monotonic system-wide clock.  */
+#   define CLOCK_MONOTONIC		1
+/* High-resolution timer from the CPU.  */
+#   define CLOCK_PROCESS_CPUTIME_ID	2
+/* Thread-specific CPU-time clock.  */
+#   define CLOCK_THREAD_CPUTIME_ID	3
+
+/* Flag to indicate time is absolute.  */
+#   define TIMER_ABSTIME		1
+#  endif
+
+# endif	/* bits/time.h */
+#endif
+
+#ifdef __need_timeval
+# undef __need_timeval
+# ifndef _STRUCT_TIMEVAL
+#  define _STRUCT_TIMEVAL	1
+#  include <bits/types.h>
+
+/* A time value that is accurate to the nearest
+   microsecond but also has a range of years.  */
+struct timeval
+  {
+    __time_t tv_sec;		/* Seconds.  */
+    __suseconds_t tv_usec;	/* Microseconds.  */
+  };
+# endif	/* struct timeval */
+#endif	/* need timeval */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/timerfd.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/timerfd.h
new file mode 100644
index 0000000..93e8c76
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/timerfd.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2008-2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_TIMERFD_H
+# error "Never use <bits/timerfd.h> directly; include <sys/timerfd.h> instead."
+#endif
+
+/* Bits to be set in the FLAGS parameter of `timerfd_create'.  */
+enum
+  {
+    TFD_CLOEXEC = 02000000,
+#define TFD_CLOEXEC TFD_CLOEXEC
+    TFD_NONBLOCK = 00004000
+#define TFD_NONBLOCK TFD_NONBLOCK
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/types.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/types.h
new file mode 100644
index 0000000..c4c10e2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/types.h
@@ -0,0 +1,208 @@
+/* bits/types.h -- definitions of __*_t types underlying *_t types.
+   Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/*
+ * Never include this file directly; use <sys/types.h> instead.
+ */
+
+#ifndef	_BITS_TYPES_H
+#define	_BITS_TYPES_H	1
+
+#include <features.h>
+#include <bits/wordsize.h>
+
+#define __need_size_t
+#include <stddef.h>
+#ifdef _LIBC
+#include <bits/kernel_types.h>
+#endif
+
+/* Convenience types.  */
+typedef unsigned char __u_char;
+typedef unsigned short int __u_short;
+typedef unsigned int __u_int;
+typedef unsigned long int __u_long;
+
+/* Fixed-size types, underlying types depend on word size and compiler.  */
+typedef signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef signed short int __int16_t;
+typedef unsigned short int __uint16_t;
+typedef signed int __int32_t;
+typedef unsigned int __uint32_t;
+#if __WORDSIZE == 64
+typedef signed long int __int64_t;
+typedef unsigned long int __uint64_t;
+#elif defined(__GNUC__)
+__extension__ typedef signed long long int __int64_t;
+__extension__ typedef unsigned long long int __uint64_t;
+#endif
+
+/* quad_t is also 64 bits.  */
+#if __WORDSIZE == 64
+typedef long int __quad_t;
+typedef unsigned long int __u_quad_t;
+#elif defined(__GNUC__)
+__extension__ typedef long long int __quad_t;
+__extension__ typedef unsigned long long int __u_quad_t;
+#else
+typedef struct
+{
+  long __val[2];
+} __quad_t;
+typedef struct
+{
+  __u_long __val[2];
+} __u_quad_t;
+#endif
+
+
+/* The machine-dependent file <bits/typesizes.h> defines __*_T_TYPE
+   macros for each of the OS types we define below.  The definitions
+   of those macros must use the following macros for underlying types.
+   We define __S<SIZE>_TYPE and __U<SIZE>_TYPE for the signed and unsigned
+   variants of each of the following integer types on this machine.
+
+	16		-- "natural" 16-bit type (always short)
+	32		-- "natural" 32-bit type (always int)
+	64		-- "natural" 64-bit type (long or long long)
+	LONG32		-- 32-bit type, traditionally long
+	QUAD		-- 64-bit type, always long long
+	WORD		-- natural type of __WORDSIZE bits (int or long)
+	LONGWORD	-- type of __WORDSIZE bits, traditionally long
+
+   We distinguish WORD/LONGWORD, 32/LONG32, and 64/QUAD so that the
+   conventional uses of `long' or `long long' type modifiers match the
+   types we define, even when a less-adorned type would be the same size.
+   This matters for (somewhat) portably writing printf/scanf formats for
+   these types, where using the appropriate l or ll format modifiers can
+   make the typedefs and the formats match up across all GNU platforms.  If
+   we used `long' when it's 64 bits where `long long' is expected, then the
+   compiler would warn about the formats not matching the argument types,
+   and the programmer changing them to shut up the compiler would break the
+   program's portability.
+
+   Here we assume what is presently the case in all the GCC configurations
+   we support: long long is always 64 bits, long is always word/address size,
+   and int is always 32 bits.  */
+
+#define	__S16_TYPE		short int
+#define __U16_TYPE		unsigned short int
+#define	__S32_TYPE		int
+#define __U32_TYPE		unsigned int
+#define __SLONGWORD_TYPE	long int
+#define __ULONGWORD_TYPE	unsigned long int
+#if __WORDSIZE == 32
+# define __SQUAD_TYPE		__quad_t
+# define __UQUAD_TYPE		__u_quad_t
+# define __SWORD_TYPE		int
+# define __UWORD_TYPE		unsigned int
+# define __SLONG32_TYPE		long int
+# define __ULONG32_TYPE		unsigned long int
+# define __S64_TYPE		__quad_t
+# define __U64_TYPE		__u_quad_t
+/* We want __extension__ before typedef's that use nonstandard base types
+   such as `long long' in C89 mode.  */
+# define __STD_TYPE		__extension__ typedef
+#elif __WORDSIZE == 64
+# define __SQUAD_TYPE		long int
+# define __UQUAD_TYPE		unsigned long int
+# define __SWORD_TYPE		long int
+# define __UWORD_TYPE		unsigned long int
+# define __SLONG32_TYPE		int
+# define __ULONG32_TYPE		unsigned int
+# define __S64_TYPE		long int
+# define __U64_TYPE		unsigned long int
+/* No need to mark the typedef with __extension__.   */
+# define __STD_TYPE		typedef
+#else
+# error your machine is neither 32 bit or 64 bit ... it must be magical
+#endif
+#include <bits/typesizes.h>	/* Defines __*_T_TYPE macros.  */
+
+
+__STD_TYPE __DEV_T_TYPE __dev_t;	/* Type of device numbers.  */
+__STD_TYPE __UID_T_TYPE __uid_t;	/* Type of user identifications.  */
+__STD_TYPE __GID_T_TYPE __gid_t;	/* Type of group identifications.  */
+__STD_TYPE __INO_T_TYPE __ino_t;	/* Type of file serial numbers.  */
+__STD_TYPE __INO64_T_TYPE __ino64_t;	/* Type of file serial numbers (LFS).*/
+__STD_TYPE __MODE_T_TYPE __mode_t;	/* Type of file attribute bitmasks.  */
+__STD_TYPE __NLINK_T_TYPE __nlink_t;	/* Type of file link counts.  */
+__STD_TYPE __OFF_T_TYPE __off_t;	/* Type of file sizes and offsets.  */
+__STD_TYPE __OFF64_T_TYPE __off64_t;	/* Type of file sizes and offsets (LFS).  */
+__STD_TYPE __PID_T_TYPE __pid_t;	/* Type of process identifications.  */
+__STD_TYPE __FSID_T_TYPE __fsid_t;	/* Type of file system IDs.  */
+__STD_TYPE __CLOCK_T_TYPE __clock_t;	/* Type of CPU usage counts.  */
+__STD_TYPE __RLIM_T_TYPE __rlim_t;	/* Type for resource measurement.  */
+__STD_TYPE __RLIM64_T_TYPE __rlim64_t;	/* Type for resource measurement (LFS).  */
+__STD_TYPE __ID_T_TYPE __id_t;		/* General type for IDs.  */
+__STD_TYPE __TIME_T_TYPE __time_t;	/* Seconds since the Epoch.  */
+__STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds.  */
+__STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds.  */
+
+__STD_TYPE __DADDR_T_TYPE __daddr_t;	/* The type of a disk address.  */
+__STD_TYPE __SWBLK_T_TYPE __swblk_t;	/* Type of a swap block maybe?  */
+__STD_TYPE __KEY_T_TYPE __key_t;	/* Type of an IPC key.  */
+
+/* Clock ID used in clock and timer functions.  */
+__STD_TYPE __CLOCKID_T_TYPE __clockid_t;
+
+/* Timer ID returned by `timer_create'.  */
+__STD_TYPE __TIMER_T_TYPE __timer_t;
+
+/* Type to represent block size.  */
+__STD_TYPE __BLKSIZE_T_TYPE __blksize_t;
+
+/* Types from the Large File Support interface.  */
+
+/* Type to count number of disk blocks.  */
+__STD_TYPE __BLKCNT_T_TYPE __blkcnt_t;
+__STD_TYPE __BLKCNT64_T_TYPE __blkcnt64_t;
+
+/* Type to count file system blocks.  */
+__STD_TYPE __FSBLKCNT_T_TYPE __fsblkcnt_t;
+__STD_TYPE __FSBLKCNT64_T_TYPE __fsblkcnt64_t;
+
+/* Type to count file system nodes.  */
+__STD_TYPE __FSFILCNT_T_TYPE __fsfilcnt_t;
+__STD_TYPE __FSFILCNT64_T_TYPE __fsfilcnt64_t;
+
+__STD_TYPE __SSIZE_T_TYPE __ssize_t; /* Type of a byte count, or error.  */
+
+/* These few don't really vary by system, they always correspond
+   to one of the other defined types.  */
+typedef __off64_t __loff_t;	/* Type of file sizes and offsets (LFS).  */
+typedef __quad_t *__qaddr_t;
+typedef char *__caddr_t;
+
+/* Duplicates info from stdint.h but this is used in unistd.h.  */
+__STD_TYPE __SWORD_TYPE __intptr_t;
+
+/* Duplicate info from sys/socket.h.  */
+__STD_TYPE __U32_TYPE __socklen_t;
+
+
+#undef __STD_TYPE
+
+/* Now add the thread types.  */
+#if defined __UCLIBC_HAS_THREADS__ && (defined __USE_POSIX199506 || defined __USE_UNIX98)
+# include <bits/pthreadtypes.h>
+#endif
+
+#endif /* bits/types.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/typesizes.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/typesizes.h
new file mode 100644
index 0000000..e9226c4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/typesizes.h
@@ -0,0 +1,66 @@
+/* bits/typesizes.h -- underlying types for *_t.  Generic version.
+   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _BITS_TYPES_H
+# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
+#endif
+
+#ifndef	_BITS_TYPESIZES_H
+#define	_BITS_TYPESIZES_H	1
+
+/* See <bits/types.h> for the meaning of these macros.  This file exists so
+   that <bits/types.h> need not vary across different GNU platforms.  */
+
+#define __DEV_T_TYPE		__UQUAD_TYPE
+#define __UID_T_TYPE		__U32_TYPE
+#define __GID_T_TYPE		__U32_TYPE
+#define __INO_T_TYPE		__ULONGWORD_TYPE
+#define __INO64_T_TYPE		__UQUAD_TYPE
+#define __MODE_T_TYPE		__U32_TYPE
+#define __NLINK_T_TYPE		__UWORD_TYPE
+#define __OFF_T_TYPE		__SLONGWORD_TYPE
+#define __OFF64_T_TYPE		__SQUAD_TYPE
+#define __PID_T_TYPE		__S32_TYPE
+#define __RLIM_T_TYPE		__ULONGWORD_TYPE
+#define __RLIM64_T_TYPE		__UQUAD_TYPE
+#define	__BLKCNT_T_TYPE		__SLONGWORD_TYPE
+#define	__BLKCNT64_T_TYPE	__SQUAD_TYPE
+#define	__FSBLKCNT_T_TYPE	__ULONGWORD_TYPE
+#define	__FSBLKCNT64_T_TYPE	__UQUAD_TYPE
+#define	__FSFILCNT_T_TYPE	__ULONGWORD_TYPE
+#define	__FSFILCNT64_T_TYPE	__UQUAD_TYPE
+#define	__ID_T_TYPE		__U32_TYPE
+#define __CLOCK_T_TYPE		__SLONGWORD_TYPE
+#define __TIME_T_TYPE		__SLONGWORD_TYPE
+#define __USECONDS_T_TYPE	__U32_TYPE
+#define __SUSECONDS_T_TYPE	__SLONGWORD_TYPE
+#define __DADDR_T_TYPE		__S32_TYPE
+#define __SWBLK_T_TYPE		__SLONGWORD_TYPE
+#define __KEY_T_TYPE		__S32_TYPE
+#define __CLOCKID_T_TYPE	__S32_TYPE
+#define __TIMER_T_TYPE		void *
+#define __BLKSIZE_T_TYPE	__SLONGWORD_TYPE
+#define __FSID_T_TYPE		struct { int __val[2]; }
+#define __SSIZE_T_TYPE		__SWORD_TYPE
+
+/* Number of descriptors that can fit in an `fd_set'.  */
+#define	__FD_SETSIZE		1024
+
+
+#endif /* bits/typesizes.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_alloc.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_alloc.h
new file mode 100644
index 0000000..6a70d27
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_alloc.h
@@ -0,0 +1,26 @@
+/*
+ * Macros to transparently switch between the stack and heap for large
+ * allocations.  The former is useful on MMU systems as it results in
+ * smaller code, but the latter is required on NoMMU systems.  This is
+ * due to small stacks that cannot grow and so doing large allocs will
+ * cause a stack overflow.
+ *
+ * Copyright (C) 2010 Mike Frysinger <vapier@gentoo.org>
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#ifndef _UCLIBC_ALLOC_H
+#define _UCLIBC_ALLOC_H
+
+#include <alloca.h>
+#include <stdlib.h>
+
+#ifdef __ARCH_USE_MMU__
+# define stack_heap_alloc(x) alloca(x)
+# define stack_heap_free(x)  do { if (0) free(x); } while (0)
+#else
+# define stack_heap_alloc(x) malloc(x)
+# define stack_heap_free(x)  free(x)
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_arch_features.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_arch_features.h
new file mode 100644
index 0000000..6cb6177
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_arch_features.h
@@ -0,0 +1,50 @@
+/*
+ * Track misc arch-specific features that aren't config options
+ */
+
+#ifndef _BITS_UCLIBC_ARCH_FEATURES_H
+#define _BITS_UCLIBC_ARCH_FEATURES_H
+
+#error "You should copy this to your arch/bits/ dir and customize"
+
+/* instruction used when calling abort() to kill yourself */
+/*#define __UCLIBC_ABORT_INSTRUCTION__ "asm instruction"*/
+#undef __UCLIBC_ABORT_INSTRUCTION__
+
+/* can your target use syscall6() for mmap ? */
+#undef __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __UCLIBC_BROKEN_CREATE_MODULE__
+
+/* does your target have to worry about older [gs]etrlimit() ? */
+#undef __UCLIBC_HANDLE_OLDER_RLIMIT__
+
+/* does your target have an asm .set ? */
+#define __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
+
+/* define if target doesn't like .global */
+#undef __UCLIBC_ASM_GLOBAL_DIRECTIVE__
+
+/* define if target supports .weak */
+#define __UCLIBC_HAVE_ASM_WEAK_DIRECTIVE__
+
+/* define if target supports .weakext */
+#undef __UCLIBC_HAVE_ASM_WEAKEXT_DIRECTIVE__
+
+/* needed probably only for ppc64 */
+#undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
+
+/* define if target supports CFI pseudo ops */
+#undef __UCLIBC_HAVE_ASM_CFI_DIRECTIVES__
+
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
+/* only weird assemblers generally need this */
+#undef __UCLIBC_ASM_LINE_SEP__
+
+#endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_charclass.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_charclass.h
new file mode 100644
index 0000000..50df539
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_charclass.h
@@ -0,0 +1,40 @@
+/*  Copyright (C) 2008  Denys Vlasenko  <vda.linux@googlemail.com>
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ */
+
+#ifndef _BITS_UCLIBC_CHARCLASS_H
+#define _BITS_UCLIBC_CHARCLASS_H
+
+/* Taking advantage of the C99 mutual-exclusion guarantees for the various
+ * (w)ctype classes, including the descriptions of printing and control
+ * (w)chars, we can place each in one of the following mutually-exlusive
+ * subsets.  Since there are less than 16, we can store the data for
+ * each (w)chars in a nibble. In contrast, glibc uses an unsigned int
+ * per (w)char, with one bit flag for each is* type.  While this allows
+ * a simple '&' operation to determine the type vs. a range test and a
+ * little special handling for the "blank" and "xdigit" types in my
+ * approach, it also uses 8 times the space for the tables on the typical
+ * 32-bit archs we supported.*/
+enum {
+	__CTYPE_unclassified = 0,
+	__CTYPE_alpha_nonupper_nonlower,
+	__CTYPE_alpha_lower,
+	__CTYPE_alpha_upper_lower,
+	__CTYPE_alpha_upper,
+	__CTYPE_digit,
+	__CTYPE_punct,
+	__CTYPE_graph,
+	__CTYPE_print_space_nonblank,
+	__CTYPE_print_space_blank,
+	__CTYPE_space_nonblank_noncntrl,
+	__CTYPE_space_blank_noncntrl,
+	__CTYPE_cntrl_space_nonblank,
+	__CTYPE_cntrl_space_blank,
+	__CTYPE_cntrl_nonspace
+};
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_clk_tck.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_clk_tck.h
new file mode 100644
index 0000000..00b77bf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_clk_tck.h
@@ -0,0 +1,8 @@
+/* Use a default of 100 for CLK_TCK to implement sysconf() and clock().
+ * Override this by supplying an arch-specific version of this header file.
+ *
+ * WARNING: It is assumed that this is a constant integer value usable in
+ * preprocessor conditionals!!!
+ */
+
+#define __UCLIBC_CLK_TCK_CONST		100
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_ctype.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_ctype.h
new file mode 100644
index 0000000..5ff281d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_ctype.h
@@ -0,0 +1,199 @@
+/*  Copyright (C) 2002     Manuel Novoa III
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  The GNU C Library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with the GNU C Library; if not, write to the Free
+ *  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ *  02111-1307 USA.
+ */
+
+/*  ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!
+ *
+ *  Besides uClibc, I'm using this code in my libc for elks, which is
+ *  a 16-bit environment with a fairly limited compiler.  It would make
+ *  things much easier for me if this file isn't modified unnecessarily.
+ *  In particular, please put any new or replacement functions somewhere
+ *  else, and modify the makefile to use your version instead.
+ *  Thanks.  Manuel
+ *
+ *  ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION! */
+
+#if !defined(_CTYPE_H) && !defined(_WCTYPE_H)
+#error Always include <{w}ctype.h> rather than <bits/uClibc_ctype.h>
+#endif
+
+#ifndef _BITS_UCLIBC_CTYPE_H
+#define _BITS_UCLIBC_CTYPE_H
+
+#ifdef __UCLIBC_GEN_LOCALE
+/* We are in extra/locale/gen_XXX tools build */
+
+#include "uClibc_charclass.h"
+
+#else
+
+/* Define some ctype macros valid for the C/POSIX locale. */
+
+/* ASCII ords of \t, \f, \n, \r, and \v are 9, 12, 10, 13, 11 respectively. */
+#define __C_isspace(c) \
+	((sizeof(c) == sizeof(char)) \
+	 ? ((((c) == ' ') || (((unsigned char)((c) - 9)) <= (13 - 9)))) \
+	 : ((((c) == ' ') || (((unsigned int)((c) - 9)) <= (13 - 9)))))
+#define __C_isblank(c) (((c) == ' ') || ((c) == '\t'))
+#define __C_isdigit(c) \
+	((sizeof(c) == sizeof(char)) \
+	 ? (((unsigned char)((c) - '0')) < 10) \
+	 : (((unsigned int)((c) - '0')) < 10))
+#define __C_isxdigit(c) \
+	(__C_isdigit(c) \
+	 || ((sizeof(c) == sizeof(char)) \
+		 ? (((unsigned char)((((c)) | 0x20) - 'a')) < 6) \
+		 : (((unsigned int)((((c)) | 0x20) - 'a')) < 6)))
+#define __C_iscntrl(c) \
+	((sizeof(c) == sizeof(char)) \
+	 ? ((((unsigned char)(c)) < 0x20) || ((c) == 0x7f)) \
+	 : ((((unsigned int)(c)) < 0x20) || ((c) == 0x7f)))
+#define __C_isalpha(c) \
+	((sizeof(c) == sizeof(char)) \
+	 ? (((unsigned char)(((c) | 0x20) - 'a')) < 26) \
+	 : (((unsigned int)(((c) | 0x20) - 'a')) < 26))
+#define __C_isalnum(c) (__C_isalpha(c) || __C_isdigit(c))
+#define __C_isprint(c) \
+	((sizeof(c) == sizeof(char)) \
+	 ? (((unsigned char)((c) - 0x20)) <= (0x7e - 0x20)) \
+	 : (((unsigned int)((c) - 0x20)) <= (0x7e - 0x20)))
+#define __C_islower(c) \
+	((sizeof(c) == sizeof(char)) \
+	 ? (((unsigned char)((c) - 'a')) < 26) \
+	 : (((unsigned int)((c) - 'a')) < 26))
+#define __C_isupper(c) \
+	((sizeof(c) == sizeof(char)) \
+	 ? (((unsigned char)((c) - 'A')) < 26) \
+	 : (((unsigned int)((c) - 'A')) < 26))
+#define __C_ispunct(c) \
+	((!__C_isalnum(c)) \
+	 && ((sizeof(c) == sizeof(char)) \
+		 ? (((unsigned char)((c) - 0x21)) <= (0x7e - 0x21)) \
+		 : (((unsigned int)((c) - 0x21)) <= (0x7e - 0x21))))
+#define __C_isgraph(c) \
+	((sizeof(c) == sizeof(char)) \
+	 ? (((unsigned char)((c) - 0x21)) <= (0x7e - 0x21)) \
+	 : (((unsigned int)((c) - 0x21)) <= (0x7e - 0x21)))
+
+#define __C_tolower(c) (__C_isupper(c) ? ((c) | 0x20) : (c))
+#define __C_toupper(c) (__C_islower(c) ? ((c) ^ 0x20) : (c))
+
+/**********************************************************************/
+__BEGIN_DECLS
+
+#ifdef _LIBC
+/* These are uClibc-specific. */
+# define __isdigit_char(c) ((unsigned char)((c) - '0') <= 9)
+# define __isdigit_int(c)  ((unsigned int)((c) - '0') <= 9)
+#endif
+
+/* Now some non-ansi/iso c99 macros. */
+
+#ifdef __UCLIBC_SUSV4_LEGACY__
+#define __isascii(c) (((c) & ~0x7f) == 0)
+#define __toascii(c) ((c) & 0x7f)
+/* Works correctly *only* on lowercase letters! */
+#define _toupper(c) ((c) ^ 0x20)
+/* Works correctly *only* on letters (of any case) and numbers */
+#define _tolower(c) ((c) | 0x20)
+#endif
+
+__END_DECLS
+
+/**********************************************************************/
+#ifdef __GNUC__
+
+# define __body_C_macro(f,args)  __C_ ## f args
+
+# define __body(f,c) \
+(__extension__ ({ \
+	int __res; \
+	if (sizeof(c) > sizeof(char)) { \
+		int __c = (c); \
+		__res = __body_C_macro(f,(__c)); \
+	} else { \
+		unsigned char __c = (c); \
+		__res = __body_C_macro(f,(__c)); \
+	} \
+	__res; \
+}))
+
+# define __isspace(c)   __body(isspace,c)
+# define __isblank(c)   __body(isblank,c)
+# define __isdigit(c)   __body(isdigit,c)
+# define __isxdigit(c)  __body(isxdigit,c)
+# define __iscntrl(c)   __body(iscntrl,c)
+# define __isalpha(c)   __body(isalpha,c)
+# define __isalnum(c)   __body(isalnum,c)
+# define __isprint(c)   __body(isprint,c)
+# define __islower(c)   __body(islower,c)
+# define __isupper(c)   __body(isupper,c)
+# define __ispunct(c)   __body(ispunct,c)
+# define __isgraph(c)   __body(isgraph,c)
+
+/*locale-aware ctype.h has no __tolower, why stub locale
+ *tries to have it? remove after 0.9.31
+ *# define __tolower(c) __body(tolower,c)
+ *# define __toupper(c) __body(toupper,c)
+ */
+
+/* Do not combine in one #if - unifdef tool is not that clever */
+# ifndef __NO_CTYPE
+# ifndef __cplusplus
+
+#  define isspace(c)    __isspace(c)
+#  define isblank(c)    __isblank(c)
+#  define isdigit(c)    __isdigit(c)
+#  define isxdigit(c)   __isxdigit(c)
+#  define iscntrl(c)    __iscntrl(c)
+#  define isalpha(c)    __isalpha(c)
+#  define isalnum(c)    __isalnum(c)
+#  define isprint(c)    __isprint(c)
+#  define islower(c)    __islower(c)
+#  define isupper(c)    __isupper(c)
+#  define ispunct(c)    __ispunct(c)
+#  define isgraph(c)    __isgraph(c)
+
+#  define tolower(c)    __body(tolower,c)
+#  define toupper(c)    __body(toupper,c)
+
+# endif
+# endif
+
+#else  /* !_GNUC__ */
+
+# ifndef __NO_CTYPE
+# ifndef __cplusplus
+
+/* These macros should be safe from side effects!
+ * (not all __C_xxx macros are) */
+#  define isdigit(c)    __C_isdigit(c)
+#  define isalpha(c)    __C_isalpha(c)
+#  define isprint(c)    __C_isprint(c)
+#  define islower(c)    __C_islower(c)
+#  define isupper(c)    __C_isupper(c)
+#  define isgraph(c)    __C_isgraph(c)
+
+# endif
+# endif
+
+#endif /* __GNUC__ */
+/**********************************************************************/
+
+#endif  /* __UCLIBC_GEN_LOCALE */
+
+#endif /* _BITS_UCLIBC_CTYPE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_fpmax.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_fpmax.h
new file mode 100644
index 0000000..e1721bf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_fpmax.h
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2003-2006     Manuel Novoa III
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Define a maximal floating point type, and the associated constants
+ * that are defined for the floating point types in float.h.
+ *
+ * This is to support archs that are missing long double, or even double.
+ */
+
+#ifndef _UCLIBC_FPMAX_H
+#define _UCLIBC_FPMAX_H
+
+#ifndef _ISOC99_SOURCE
+#define _ISOC99_SOURCE 1
+#endif
+
+#include <features.h>
+#include <float.h>
+
+#ifdef __UCLIBC_HAS_FLOATS__
+
+#if defined(LDBL_MANT_DIG)
+
+typedef long double __fpmax_t;
+#define FPMAX_TYPE           3
+
+#define FPMAX_MANT_DIG       LDBL_MANT_DIG
+#define FPMAX_DIG            LDBL_DIG
+#define FPMAX_EPSILON        LDBL_EPSILON
+#define FPMAX_MIN_EXP        LDBL_MIN_EXP
+#define FPMAX_MIN            LDBL_MIN
+#define FPMAX_MIN_10_EXP     LDBL_MIN_10_EXP
+#define FPMAX_MAX_EXP        LDBL_MAX_EXP
+#define FPMAX_MAX            LDBL_MAX
+#define FPMAX_MAX_10_EXP     LDBL_MAX_10_EXP
+
+#elif defined(DBL_MANT_DIG)
+
+typedef double __fpmax_t;
+#define FPMAX_TYPE           2
+
+#define FPMAX_MANT_DIG       DBL_MANT_DIG
+#define FPMAX_DIG            DBL_DIG
+#define FPMAX_EPSILON        DBL_EPSILON
+#define FPMAX_MIN_EXP        DBL_MIN_EXP
+#define FPMAX_MIN            DBL_MIN
+#define FPMAX_MIN_10_EXP     DBL_MIN_10_EXP
+#define FPMAX_MAX_EXP        DBL_MAX_EXP
+#define FPMAX_MAX            DBL_MAX
+#define FPMAX_MAX_10_EXP     DBL_MAX_10_EXP
+
+#elif defined(FLT_MANT_DIG)
+
+typedef float __fpmax_t;
+#define FPMAX_TYPE           1
+
+#define FPMAX_MANT_DIG       FLT_MANT_DIG
+#define FPMAX_DIG            FLT_DIG
+#define FPMAX_EPSILON        FLT_EPSILON
+#define FPMAX_MIN_EXP        FLT_MIN_EXP
+#define FPMAX_MIN            FLT_MIN
+#define FPMAX_MIN_10_EXP     FLT_MIN_10_EXP
+#define FPMAX_MAX_EXP        FLT_MAX_EXP
+#define FPMAX_MAX            FLT_MAX
+#define FPMAX_MAX_10_EXP     FLT_MAX_10_EXP
+
+#else
+#error unable to determine appropriate type for __fpmax_t!
+#endif
+
+#ifndef DECIMAL_DIG
+
+#ifdef L___strtofpmax
+/* Emit warning only once. */
+#warning DECIMAL_DIG is not defined! If you are using gcc, it may not be defining __STDC_VERSION__ as it should.
+#endif
+#if !defined(FLT_RADIX) || (FLT_RADIX != 2)
+#error unable to compensate for missing DECIMAL_DIG!
+#endif
+
+/*  ceil (1 + #mantissa * log10 (FLT_RADIX)) */
+#define DECIMAL_DIG   (1 + (((FPMAX_MANT_DIG * 100) + 331) / 332))
+
+#endif /* DECIMAL_DIG */
+
+#if defined _LIBC && defined IS_IN_libc
+extern __fpmax_t __strtofpmax(const char *str, char **endptr, int exp_adjust) attribute_hidden;
+
+#ifdef __UCLIBC_HAS_XLOCALE__
+extern __fpmax_t __strtofpmax_l(const char *str, char **endptr, int exp_adjust,
+								__locale_t locale_arg) attribute_hidden;
+#endif
+
+#ifdef __UCLIBC_HAS_WCHAR__
+extern __fpmax_t __wcstofpmax(const wchar_t *wcs, wchar_t **endptr,
+							  int exp_adjust) attribute_hidden;
+
+#ifdef __UCLIBC_HAS_XLOCALE__
+extern __fpmax_t __wcstofpmax_l(const wchar_t *wcs, wchar_t **endptr,
+								int exp_adjust, __locale_t locale_arg) attribute_hidden;
+#endif
+#endif /* __UCLIBC_HAS_WCHAR__ */
+#endif /* _LIBC */
+
+/* The following checks in an __fpmax_t is either 0 or +/- infinity.
+ *
+ * WARNING!!!   WARNING!!!   WARNING!!!   WARNING!!!   WARNING!!!   WARNING!!!
+ *
+ * This only works if __fpmax_t is the actual maximal floating point type used
+ * in intermediate calculations.  Otherwise, excess precision in the
+ * intermediate values can cause the test to fail.
+ *
+ * WARNING!!!   WARNING!!!   WARNING!!!   WARNING!!!   WARNING!!!   WARNING!!!
+ */
+
+#define __FPMAX_ZERO_OR_INF_CHECK(x)  ((x) == ((x)/4) )
+
+#endif /* __UCLIBC_HAS_FLOATS__ */
+
+#endif /* _UCLIBC_FPMAX_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_local_lim.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_local_lim.h
new file mode 100644
index 0000000..abfc86d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_local_lim.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/*
+ * Never include this file directly; use <unistd.h> instead.
+ */
+
+#ifndef	_BITS_UCLIBC_LOCAL_LIM_H
+#define	_BITS_UCLIBC_LOCAL_LIM_H	1
+
+/* This file works correctly only if local_lim.h is the NPTL version */
+#if !defined PTHREAD_KEYS_MAX || defined TIMER_MAX
+# error local_lim.h was incorrectly updated, use the NPTL version from glibc
+#endif
+
+/* This should really be moved to thread specific directories */
+#if defined __UCLIBC_HAS_THREADS__ && !defined __UCLIBC_HAS_THREADS_NATIVE__
+# define PTHREAD_THREADS_MAX	1024
+# define TIMER_MAX		256
+#endif
+
+#ifndef __UCLIBC_HAS_THREADS__
+# undef _POSIX_THREAD_KEYS_MAX
+# undef PTHREAD_KEYS_MAX
+# undef _POSIX_THREAD_DESTRUCTOR_ITERATIONS
+# undef PTHREAD_DESTRUCTOR_ITERATIONS
+# undef PTHREAD_STACK_MIN
+# undef DELAYTIMER_MAX
+#endif
+
+#endif /* bits/uClibc_local_lim.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_locale.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_locale.h
new file mode 100644
index 0000000..9790da2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_locale.h
@@ -0,0 +1,374 @@
+/*  Copyright (C) 2002, 2003     Manuel Novoa III
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  The GNU C Library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with the GNU C Library; if not, write to the Free
+ *  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ *  02111-1307 USA.
+ */
+
+/*  ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!
+ *
+ *  Besides uClibc, I'm using this code in my libc for elks, which is
+ *  a 16-bit environment with a fairly limited compiler.  It would make
+ *  things much easier for me if this file isn't modified unnecessarily.
+ *  In particular, please put any new or replacement functions somewhere
+ *  else, and modify the makefile to use your version instead.
+ *  Thanks.  Manuel
+ *
+ *  ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION! */
+
+#ifndef _UCLIBC_LOCALE_H
+#define _UCLIBC_LOCALE_H
+
+/**********************************************************************/
+/* uClibc compatibilty stuff */
+
+#ifdef __UCLIBC_HAS_LOCALE__
+
+# undef __LOCALE_C_ONLY
+
+#else
+
+# define __LOCALE_C_ONLY
+
+# ifdef _LIBC
+#  define __XL_NPP(N) N
+#  define __LOCALE_PARAM
+#  define __LOCALE_ARG
+# endif
+
+#endif
+
+/**********************************************************************/
+
+#define __NL_ITEM_CATEGORY_SHIFT        8
+#define __NL_ITEM_INDEX_MASK            0xff
+
+/* TODO: Make sure these agree with the locale mmap file gererator! */
+
+#define __LC_CTYPE      0
+#define __LC_NUMERIC    1
+#define __LC_MONETARY   2
+#define __LC_TIME       3
+#define __LC_COLLATE    4
+#define __LC_MESSAGES   5
+#define __LC_ALL        6
+
+/**********************************************************************/
+#ifndef __LOCALE_C_ONLY
+
+enum {
+	__ctype_encoding_7_bit,		/* C/POSIX */
+	__ctype_encoding_utf8,		/* UTF-8 */
+	__ctype_encoding_8_bit		/* for 8-bit codeset locales */
+};
+
+#define LOCALE_STRING_SIZE (2 * __LC_ALL + 2)
+
+ /*
+  * '#' + 2_per_category + '\0'
+  *       {locale row # : 0 = C|POSIX} + 0x8001
+  *       encoded in two chars as (((N+1) >> 8) | 0x80) and ((N+1) & 0xff)
+  *       so decode is  ((((uint16_t)(*s & 0x7f)) << 8) + s[1]) - 1
+  *
+  *       Note: 0s are not used as they are nul-terminators for strings.
+  *       Note: 0xff, 0xff is the encoding for a non-selected locale.
+  *             (see setlocale() below).
+  * In particular, C/POSIX locale is '#' + "\x80\x01"}*LC_ALL + nul.
+  */
+
+struct __uclibc_locale_struct;
+typedef struct __uclibc_locale_struct *__locale_t;
+
+#ifdef _LIBC
+
+/* extern void _locale_set(const unsigned char *p); */
+/* extern void _locale_init(void); */
+
+#include <stddef.h>
+#include <stdint.h>
+#include <bits/uClibc_touplow.h>
+#ifndef __UCLIBC_GEN_LOCALE
+# include <bits/uClibc_locale_data.h>
+#endif
+
+#ifndef __UCLIBC_GEN_LOCALE /* && (defined IS_IN_libc || defined NOT_IN_libc) */
+typedef struct {
+	uint16_t num_weights;
+	uint16_t num_starters;
+	uint16_t ii_shift;
+	uint16_t ti_shift;
+	uint16_t ii_len;
+	uint16_t ti_len;
+	uint16_t max_weight;
+	uint16_t num_col_base;
+	uint16_t max_col_index;
+	uint16_t undefined_idx;
+	uint16_t range_low;
+	uint16_t range_count;
+	uint16_t range_base_weight;
+	uint16_t range_rule_offset; /* change name to index? */
+
+	uint16_t ii_mask;
+	uint16_t ti_mask;
+
+	const uint16_t *index2weight_tbl;
+	const uint16_t *index2ruleidx_tbl;
+	const uint16_t *multistart_tbl;
+	/*	 uint16_t wcs2colidt_offset_low; */
+	/*	 uint16_t wcs2colidt_offset_hi; */
+	const uint16_t *wcs2colidt_tbl;
+
+	/*	 uint16_t undefined_idx; */
+	const uint16_t *overrides_tbl;
+	/*	 uint16_t *multistart_tbl; */
+
+	const uint16_t *weightstr;
+	const uint16_t *ruletable;
+
+
+	uint16_t *index2weight;
+	uint16_t *index2ruleidx;
+
+	uint16_t MAX_WEIGHTS;
+} __collate_t;
+
+/*  static unsigned char cur_locale[LOCALE_STRING_SIZE]; */
+
+struct __uclibc_locale_struct {
+#ifdef __UCLIBC_HAS_XLOCALE__
+	const __ctype_mask_t *__ctype_b;
+	const __ctype_touplow_t *__ctype_tolower;
+	const __ctype_touplow_t *__ctype_toupper;
+#endif
+
+	/* For now, just embed this in the structure. */
+	__ctype_mask_t __ctype_b_data[256 + __UCLIBC_CTYPE_B_TBL_OFFSET];
+	__ctype_touplow_t __ctype_tolower_data[256 + __UCLIBC_CTYPE_TO_TBL_OFFSET];
+	__ctype_touplow_t __ctype_toupper_data[256 + __UCLIBC_CTYPE_TO_TBL_OFFSET];
+
+/*  	int tables_loaded; */
+/*  	unsigned char lctypes[LOCALE_STRING_SIZE]; */
+	unsigned char cur_locale[LOCALE_STRING_SIZE];
+
+	/* NL_LANGINFO stuff. BEWARE ORDERING!!! must agree with NL_* constants! */
+	/* Also, numeric must be followed by monetary and the items must be in
+	 * the "struct lconv" order. */
+
+	uint16_t category_offsets[__LC_ALL]; /* TODO -- fix? */
+	unsigned char category_item_count[__LC_ALL]; /* TODO - fix */
+
+	/* ctype */
+	unsigned char encoding;		/* C/POSIX, 8-bit, UTF-8 */
+	unsigned char mb_cur_max;	/* determined by encoding _AND_ translit!!! */
+	const unsigned char outdigit_length[10];
+
+#ifdef __CTYPE_HAS_8_BIT_LOCALES
+	const unsigned char *idx8ctype;
+	const unsigned char *tbl8ctype;
+	const unsigned char *idx8uplow;
+	const unsigned char *tbl8uplow;
+# ifdef __UCLIBC_HAS_WCHAR__
+	const unsigned char *idx8c2wc;
+	const uint16_t *tbl8c2wc;	/* char > 0x7f to wide char */
+	const unsigned char *idx8wc2c;
+	const unsigned char *tbl8wc2c;
+	/* translit  */
+# endif
+#endif /* __CTYPE_HAS_8_BIT_LOCALES */
+#ifdef __UCLIBC_HAS_WCHAR__
+
+	const uint16_t *code2flag;
+
+	const unsigned char *tblwctype;
+	const unsigned char *tblwuplow;
+/* 	const unsigned char *tblwcomb; */
+	const int16_t *tblwuplow_diff; /* yes... signed */
+	/* width?? */
+
+	wchar_t decimal_point_wc;
+	wchar_t thousands_sep_wc;
+	int decimal_point_len;
+	int thousands_sep_len;
+
+#endif /* __UCLIBC_HAS_WCHAR__ */
+
+	/* ctype */
+	const char *outdigit0_mb;
+	const char *outdigit1_mb;
+	const char *outdigit2_mb;
+	const char *outdigit3_mb;
+	const char *outdigit4_mb;
+	const char *outdigit5_mb;
+	const char *outdigit6_mb;
+	const char *outdigit7_mb;
+	const char *outdigit8_mb;
+	const char *outdigit9_mb;
+	const char *codeset;		/* MUST BE LAST!!! */
+
+	/* numeric */
+	const char *decimal_point;
+	const char *thousands_sep;
+	const char *grouping;
+
+	/* monetary */
+	const char *int_curr_symbol;
+	const char *currency_symbol;
+	const char *mon_decimal_point;
+	const char *mon_thousands_sep;
+	const char *mon_grouping;
+	const char *positive_sign;
+	const char *negative_sign;
+	const char *int_frac_digits;
+	const char *frac_digits;
+	const char *p_cs_precedes;
+	const char *p_sep_by_space;
+	const char *n_cs_precedes;
+	const char *n_sep_by_space;
+	const char *p_sign_posn;
+	const char *n_sign_posn;
+	const char *int_p_cs_precedes;
+	const char *int_p_sep_by_space;
+	const char *int_n_cs_precedes;
+	const char *int_n_sep_by_space;
+	const char *int_p_sign_posn;
+	const char *int_n_sign_posn;
+
+	const char *crncystr;		/* not returned by localeconv */
+
+	/* time */
+	const char *abday_1;
+	const char *abday_2;
+	const char *abday_3;
+	const char *abday_4;
+	const char *abday_5;
+	const char *abday_6;
+	const char *abday_7;
+
+	const char *day_1;
+	const char *day_2;
+	const char *day_3;
+	const char *day_4;
+	const char *day_5;
+	const char *day_6;
+	const char *day_7;
+
+	const char *abmon_1;
+	const char *abmon_2;
+	const char *abmon_3;
+	const char *abmon_4;
+	const char *abmon_5;
+	const char *abmon_6;
+	const char *abmon_7;
+	const char *abmon_8;
+	const char *abmon_9;
+	const char *abmon_10;
+	const char *abmon_11;
+	const char *abmon_12;
+
+	const char *mon_1;
+	const char *mon_2;
+	const char *mon_3;
+	const char *mon_4;
+	const char *mon_5;
+	const char *mon_6;
+	const char *mon_7;
+	const char *mon_8;
+	const char *mon_9;
+	const char *mon_10;
+	const char *mon_11;
+	const char *mon_12;
+
+	const char *am_str;
+	const char *pm_str;
+
+	const char *d_t_fmt;
+	const char *d_fmt;
+	const char *t_fmt;
+	const char *t_fmt_ampm;
+	const char *era;
+
+	const char *era_year;		/* non SUSv3 */
+	const char *era_d_fmt;
+	const char *alt_digits;
+	const char *era_d_t_fmt;
+	const char *era_t_fmt;
+
+	/* messages */
+	const char *yesexpr;
+	const char *noexpr;
+	const char *yesstr;
+	const char *nostr;
+
+	/* collate is at the end */
+	__collate_t collate;
+};
+
+extern struct __uclibc_locale_struct __global_locale_data;
+extern struct __uclibc_locale_struct *__global_locale;
+#endif /* !__UCLIBC_GEN_LOCALE */
+
+#if defined IS_IN_libc || defined NOT_IN_libc
+/* If you plan to remove xxx_IN_libc guards,
+ * remove attribute_hidden, it won't work.
+ */
+extern int __locale_mbrtowc_l(wchar_t *__restrict dst,
+				const char *__restrict src,
+				__locale_t loc) attribute_hidden;
+#endif
+
+#ifdef L_setlocale
+/* so we only get the warning once... */
+#warning need thread version of CUR_LOCALE!
+#endif
+
+/**********************************************************************/
+#ifdef __UCLIBC_HAS_XLOCALE__
+
+extern __locale_t __curlocale_var;
+# ifdef __UCLIBC_HAS_THREADS__
+extern __locale_t __curlocale(void)  __THROW __attribute__ ((__const__));
+extern __locale_t __curlocale_set(__locale_t newloc);
+#  define __UCLIBC_CURLOCALE  (__curlocale())
+# else
+#  define __UCLIBC_CURLOCALE  (__curlocale_var)
+# endif
+
+#elif defined(__UCLIBC_HAS_LOCALE__)
+
+# define __UCLIBC_CURLOCALE   (__global_locale)
+
+#endif
+/**********************************************************************/
+#if defined(__UCLIBC_HAS_XLOCALE__) && defined(__UCLIBC_DO_XLOCALE)
+
+# define __XL_NPP(N) N ## _l
+# define __LOCALE_PARAM    , __locale_t locale_arg
+# define __LOCALE_ARG      , locale_arg
+# define __LOCALE_PTR      locale_arg
+
+#else
+
+# define __XL_NPP(N) N
+# define __LOCALE_PARAM
+# define __LOCALE_ARG
+# define __LOCALE_PTR      __UCLIBC_CURLOCALE
+
+#endif
+/**********************************************************************/
+
+#endif /* _LIBC */
+
+#endif /* !defined(__LOCALE_C_ONLY) */
+
+#endif /* _UCLIBC_LOCALE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_mutex.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_mutex.h
new file mode 100644
index 0000000..ef8016d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_mutex.h
@@ -0,0 +1,157 @@
+/* Copyright (C) 2006   Manuel Novoa III    <mjn3@codepoet.org>
+ *
+ * GNU Library General Public License (LGPL) version 2 or later.
+ *
+ * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
+ */
+
+#ifndef _UCLIBC_MUTEX_H
+#define _UCLIBC_MUTEX_H
+
+#include <features.h>
+
+#ifdef __UCLIBC_HAS_THREADS__
+
+#include <pthread.h>
+#include <bits/uClibc_pthread.h>
+
+#define __UCLIBC_MUTEX_TYPE				pthread_mutex_t
+
+#define __UCLIBC_MUTEX(M)				pthread_mutex_t M
+#define __UCLIBC_MUTEX_INIT(M,I)			pthread_mutex_t M = I
+#define __UCLIBC_MUTEX_STATIC(M,I)			static pthread_mutex_t M = I
+#define __UCLIBC_MUTEX_EXTERN(M)			extern pthread_mutex_t M
+
+#define __UCLIBC_MUTEX_INIT_VAR(M)								\
+		((M) = (pthread_mutex_t) PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
+
+#define __UCLIBC_MUTEX_LOCK_CANCEL_UNSAFE(M)								\
+		__pthread_mutex_lock(&(M))
+
+#define __UCLIBC_MUTEX_UNLOCK_CANCEL_UNSAFE(M)								\
+		__pthread_mutex_unlock(&(M))
+
+#define __UCLIBC_MUTEX_TRYLOCK_CANCEL_UNSAFE(M)								\
+		__pthread_mutex_trylock(&(M))
+
+#define __UCLIBC_MUTEX_CONDITIONAL_LOCK(M,C)								\
+	do {												\
+		struct _pthread_cleanup_buffer __infunc_pthread_cleanup_buffer;				\
+		int __infunc_need_locking = (C);							\
+		if (__infunc_need_locking) {								\
+			_pthread_cleanup_push_defer(&__infunc_pthread_cleanup_buffer,			\
+					   (void (*) (void *))__pthread_mutex_unlock,			\
+										&(M));			\
+			__pthread_mutex_lock(&(M));							\
+		}											\
+		((void)0)
+
+#define __UCLIBC_MUTEX_CONDITIONAL_UNLOCK(M,C)								\
+		if (__infunc_need_locking) {								\
+			_pthread_cleanup_pop_restore(&__infunc_pthread_cleanup_buffer,1);		\
+		}											\
+	} while (0)
+
+#define __UCLIBC_MUTEX_AUTO_LOCK_VAR(A)		int A
+
+#define __UCLIBC_MUTEX_AUTO_LOCK(M,A,V)									\
+        __UCLIBC_MUTEX_CONDITIONAL_LOCK(M,((A=(V)) == 0))
+
+#define __UCLIBC_MUTEX_AUTO_UNLOCK(M,A)									\
+        __UCLIBC_MUTEX_CONDITIONAL_UNLOCK(M,(A == 0))
+
+#define __UCLIBC_MUTEX_LOCK(M)										\
+        __UCLIBC_MUTEX_CONDITIONAL_LOCK(M, 1)
+
+#define __UCLIBC_MUTEX_UNLOCK(M)									\
+        __UCLIBC_MUTEX_CONDITIONAL_UNLOCK(M, 1)
+
+#ifdef __USE_STDIO_FUTEXES__
+
+#include <bits/stdio-lock.h>
+
+#define __UCLIBC_IO_MUTEX(M)			_IO_lock_t M
+#define __UCLIBC_IO_MUTEX_LOCK(M) 		_IO_lock_lock(M)
+#define __UCLIBC_IO_MUTEX_UNLOCK(M) 	_IO_lock_unlock(M)
+#define __UCLIBC_IO_MUTEX_TRYLOCK(M) 	_IO_lock_trylock(M)
+#define __UCLIBC_IO_MUTEX_INIT(M) 	_IO_lock_t M = _IO_lock_initializer
+#define __UCLIBC_IO_MUTEX_EXTERN(M)		extern _IO_lock_t M
+
+#define __UCLIBC_IO_MUTEX_CONDITIONAL_LOCK(M,C)		\
+	if (C) {										\
+		_IO_lock_lock(M);							\
+	}
+
+#define __UCLIBC_IO_MUTEX_CONDITIONAL_UNLOCK(M,C)	\
+	if (C) {										\
+		_IO_lock_unlock(M);							\
+	}
+
+#define __UCLIBC_IO_MUTEX_AUTO_LOCK(M,A,V)			\
+		__UCLIBC_IO_MUTEX_CONDITIONAL_LOCK(M,((A=(V))) == 0)
+
+#define __UCLIBC_IO_MUTEX_AUTO_UNLOCK(M,A)			\
+		__UCLIBC_IO_MUTEX_CONDITIONAL_UNLOCK(M,((A) == 0))
+
+#define __UCLIBC_IO_MUTEX_LOCK_CANCEL_UNSAFE(M)		_IO_lock_lock(M)
+#define __UCLIBC_IO_MUTEX_UNLOCK_CANCEL_UNSAFE(M) 	_IO_lock_unlock(M)
+
+#else /* of __USE_STDIO_FUTEXES__ */
+
+#define __UCLIBC_IO_MUTEX(M)                        __UCLIBC_MUTEX(M)
+#define __UCLIBC_IO_MUTEX_LOCK(M)                   __UCLIBC_MUTEX_CONDITIONAL_LOCK(M, 1)
+#define __UCLIBC_IO_MUTEX_UNLOCK(M)                 __UCLIBC_MUTEX_CONDITIONAL_UNLOCK(M, 1)
+#define __UCLIBC_IO_MUTEX_TRYLOCK(M)                __UCLIBC_MUTEX_TRYLOCK_CANCEL_UNSAFE(M)
+#define __UCLIBC_IO_MUTEX_INIT(M)                   __UCLIBC_MUTEX_INIT(M, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
+#define __UCLIBC_IO_MUTEX_EXTERN(M)                 __UCLIBC_MUTEX_EXTERN(M)
+#define __UCLIBC_IO_MUTEX_AUTO_LOCK(M,A,V)          __UCLIBC_MUTEX_AUTO_LOCK(M,A,V)
+#define __UCLIBC_IO_MUTEX_AUTO_UNLOCK(M,A)          __UCLIBC_MUTEX_AUTO_UNLOCK(M,A)
+#define __UCLIBC_IO_MUTEX_LOCK_CANCEL_UNSAFE(M)     __UCLIBC_MUTEX_LOCK_CANCEL_UNSAFE(M)
+#define __UCLIBC_IO_MUTEX_UNLOCK_CANCEL_UNSAFE(M)   __UCLIBC_MUTEX_UNLOCK_CANCEL_UNSAFE(M)
+#define __UCLIBC_IO_MUTEX_CONDITIONAL_LOCK(M,C)     __UCLIBC_MUTEX_CONDITIONAL_LOCK(M, 1)
+#define __UCLIBC_IO_MUTEX_CONDITIONAL_UNLOCK(M,C)   __UCLIBC_MUTEX_CONDITIONAL_UNLOCK(M, 1)
+
+#endif /* of __USE_STDIO_FUTEXES__ */
+
+
+#else /* of __UCLIBC_HAS_THREADS__ */
+
+#define __UCLIBC_MUTEX(M)				void *__UCLIBC_MUTEX_DUMMY_ ## M
+#define __UCLIBC_MUTEX_INIT(M,I)			extern void *__UCLIBC_MUTEX_DUMMY_ ## M
+#define __UCLIBC_MUTEX_STATIC(M,I)			extern void *__UCLIBC_MUTEX_DUMMY_ ## M
+#define __UCLIBC_MUTEX_EXTERN(M)			extern void *__UCLIBC_MUTEX_DUMMY_ ## M
+
+#define __UCLIBC_MUTEX_INIT_VAR(M)					((void)0)
+#define __UCLIBC_MUTEX_LOCK_CANCEL_UNSAFE(M)		((void)0)
+#define __UCLIBC_MUTEX_UNLOCK_CANCEL_UNSAFE(M)		((void)0)
+#define __UCLIBC_MUTEX_TRYLOCK_CANCEL_UNSAFE(M)		(0)	/* Always succeed? */
+
+#define __UCLIBC_MUTEX_CONDITIONAL_LOCK(M,C)		((void)0)
+#define __UCLIBC_MUTEX_CONDITIONAL_UNLOCK(M,C)		((void)0)
+
+#define __UCLIBC_MUTEX_AUTO_LOCK_VAR(A)			((void)0)
+#define __UCLIBC_MUTEX_AUTO_LOCK(M,A,V)			((void)0)
+#define __UCLIBC_MUTEX_AUTO_UNLOCK(M,A)			((void)0)
+
+#define __UCLIBC_MUTEX_LOCK(M)				((void)0)
+#define __UCLIBC_MUTEX_UNLOCK(M)			((void)0)
+
+#define __UCLIBC_IO_MUTEX(M)                        __UCLIBC_MUTEX(M)
+#define __UCLIBC_IO_MUTEX_LOCK(M)                   __UCLIBC_MUTEX_CONDITIONAL_LOCK(M, 1)
+#define __UCLIBC_IO_MUTEX_UNLOCK(M)                 __UCLIBC_MUTEX_CONDITIONAL_UNLOCK(M, 1)
+#define __UCLIBC_IO_MUTEX_TRYLOCK(M)                __UCLIBC_MUTEX_TRYLOCK_CANCEL_UNSAFE(M)
+#define __UCLIBC_IO_MUTEX_INIT(M)                   __UCLIBC_MUTEX_INIT(M, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
+#define __UCLIBC_IO_MUTEX_EXTERN(M)                 __UCLIBC_MUTEX_EXTERN(M)
+#define __UCLIBC_IO_MUTEX_AUTO_LOCK(M,A,V)          __UCLIBC_MUTEX_AUTO_LOCK(M,A,V)
+#define __UCLIBC_IO_MUTEX_AUTO_UNLOCK(M,A)          __UCLIBC_MUTEX_AUTO_UNLOCK(M,A)
+#define __UCLIBC_IO_MUTEX_LOCK_CANCEL_UNSAFE(M)     __UCLIBC_MUTEX_LOCK_CANCEL_UNSAFE(M)
+#define __UCLIBC_IO_MUTEX_UNLOCK_CANCEL_UNSAFE(M)   __UCLIBC_MUTEX_UNLOCK_CANCEL_UNSAFE(M)
+#define __UCLIBC_IO_MUTEX_CONDITIONAL_LOCK(M,C)     __UCLIBC_MUTEX_CONDITIONAL_LOCK(M, 1)
+#define __UCLIBC_IO_MUTEX_CONDITIONAL_UNLOCK(M,C)   __UCLIBC_MUTEX_CONDITIONAL_UNLOCK(M, 1)
+
+#endif /* of __UCLIBC_HAS_THREADS__ */
+
+#define __UCLIBC_IO_MUTEX_TRYLOCK_CANCEL_UNSAFE(M)	\
+		__UCLIBC_IO_MUTEX_TRYLOCK(M)
+
+#endif /* _UCLIBC_MUTEX_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_page.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_page.h
new file mode 100644
index 0000000..1340945
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_page.h
@@ -0,0 +1,29 @@
+/*  Copyright (C) 2004     Erik Andersen
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  The GNU C Library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with the GNU C Library; if not, write to the Free
+ *  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ *  02111-1307 USA.
+ */
+
+/* Supply an architecture specific value for PAGE_SIZE and friends.  */
+
+#ifndef _UCLIBC_PAGE_H
+#define _UCLIBC_PAGE_H
+
+/* PAGE_SHIFT determines the page size -- in this case 4096 */
+#define PAGE_SHIFT	12
+#define PAGE_SIZE	(1UL << PAGE_SHIFT)
+#define PAGE_MASK	(~(PAGE_SIZE-1))
+
+#endif /* _UCLIBC_PAGE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_pthread.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_pthread.h
new file mode 100644
index 0000000..15aa1de
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_pthread.h
@@ -0,0 +1,51 @@
+/*  Copyright (C) 2003     Manuel Novoa III
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  The GNU C Library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with the GNU C Library; if not, write to the Free
+ *  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ *  02111-1307 USA.
+ */
+
+/* Supply prototypes for the internal thread functions used by the
+ * uClibc library code.
+ */
+
+#ifndef _UCLIBC_PTHREAD_H
+#define _UCLIBC_PTHREAD_H
+
+#ifndef _PTHREAD_H
+# error "Always include <pthread.h> rather than <bits/uClibc_pthread.h>"
+#endif
+
+#if defined _LIBC && (defined IS_IN_libc || defined NOT_IN_libc)
+
+struct _pthread_cleanup_buffer;
+
+/* Threading functions internal to uClibc.  Make these thread functions
+ * weak so that we can elide them from single-threaded processes.  */
+extern int weak_function __pthread_mutex_init (pthread_mutex_t *__mutex,
+		__const pthread_mutexattr_t *__mutex_attr);
+extern int weak_function __pthread_mutex_destroy (pthread_mutex_t *__mutex);
+extern int weak_function __pthread_mutex_lock (pthread_mutex_t *__mutex);
+extern int weak_function __pthread_mutex_unlock (pthread_mutex_t *__mutex);
+extern int weak_function __pthread_mutex_trylock (pthread_mutex_t *__mutex);
+extern void weak_function _pthread_cleanup_push_defer (
+		struct _pthread_cleanup_buffer *__buffer,
+		void (*__routine) (void *), void *__arg);
+extern void weak_function _pthread_cleanup_pop_restore (
+		struct _pthread_cleanup_buffer *__buffer,
+		int __execute);
+
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_stdio.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_stdio.h
new file mode 100644
index 0000000..a8cf4eb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_stdio.h
@@ -0,0 +1,527 @@
+/* Copyright (C) 2002-2004   Manuel Novoa III    <mjn3@codepoet.org>
+ *
+ * GNU Library General Public License (LGPL) version 2 or later.
+ *
+ * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
+ */
+
+#ifndef _STDIO_H
+#error Always include <stdio.h> rather than <bits/uClibc_stdio.h>
+#endif
+
+/**********************************************************************/
+
+#define __STDIO_BUFFERS
+/* ANSI/ISO mandate at least 256. */
+#if defined(__UCLIBC_HAS_STDIO_BUFSIZ_NONE__)
+/* Fake this because some apps use stdio.h BUFSIZ. */
+#define __STDIO_BUFSIZ			256
+#undef __STDIO_BUFFERS
+#elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_256__)
+#define __STDIO_BUFSIZ			256
+#elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_512__)
+#define __STDIO_BUFSIZ			512
+#elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_1024__)
+#define __STDIO_BUFSIZ		   1024
+#elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_2048__)
+#define __STDIO_BUFSIZ		   2048
+#elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_4096__)
+#define __STDIO_BUFSIZ		   4096
+#elif defined(__UCLIBC_HAS_STDIO_BUFSIZ_8192__)
+#define __STDIO_BUFSIZ		   8192
+#else
+#error config seems to be out of sync regarding bufsiz options
+#endif
+
+#ifdef __UCLIBC_HAS_STDIO_BUFSIZ_NONE__
+#define __STDIO_BUILTIN_BUF_SIZE		0
+#else  /* __UCLIBC_HAS_STDIO_BUFSIZ_NONE__ */
+#if defined(__UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE__)
+#define __STDIO_BUILTIN_BUF_SIZE		0
+#elif defined(__UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4__)
+#define __STDIO_BUILTIN_BUF_SIZE		4
+#elif defined(__UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8__)
+#define __STDIO_BUILTIN_BUF_SIZE		8
+#else
+#error config seems to be out of sync regarding builtin buffer size
+#endif
+#endif
+
+#if defined(__STDIO_BUFFERS) || defined(__UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__) || defined(__UCLIBC_HAS_THREADS__)
+#define __STDIO_HAS_OPENLIST 1
+#else
+#undef __STDIO_HAS_OPENLIST
+#endif
+
+/**********************************************************************/
+/* Make sure defines related to large files are consistent. */
+#ifdef _LIBC
+
+#ifdef __UCLIBC_HAS_LFS__
+#undef __USE_LARGEFILE
+#undef __USE_LARGEFILE64
+#undef __USE_FILE_OFFSET64
+/* If we're actually building uClibc with large file support, only define... */
+#define __USE_LARGEFILE64	1
+#endif /* __UCLIBC_HAS_LFS__ */
+
+#else  /* not _LIBC */
+
+#ifndef __UCLIBC_HAS_LFS__
+#if defined(__LARGEFILE64_SOURCE) || defined(__USE_LARGEFILE64) || defined(__USE_FILE_OFFSET64)
+#error Sorry... uClibc was built without large file support!
+#endif
+#endif /* __UCLIBC_HAS_LFS__ */
+
+#endif /* _LIBC */
+/**********************************************************************/
+#ifdef __UCLIBC_HAS_WCHAR__
+
+#define __need_wchar_t
+#include <stddef.h>
+
+/* Note: we don't really need mbstate for 8-bit locales.  We do for UTF-8.
+ * For now, always use it. */
+#define __STDIO_MBSTATE
+#define __need_mbstate_t
+#include <wchar.h>
+
+#endif
+/**********************************************************************/
+/* Currently unimplemented/untested */
+/* #define __STDIO_FLEXIBLE_SETVBUF */
+
+#ifdef __UCLIBC_HAS_STDIO_GETC_MACRO__
+#define __STDIO_GETC_MACRO
+#endif
+
+#ifdef __UCLIBC_HAS_STDIO_PUTC_MACRO__
+#define __STDIO_PUTC_MACRO
+#endif
+
+
+/* These are consistency checks on the different options */
+
+#ifndef __STDIO_BUFFERS
+#undef __STDIO_GETC_MACRO
+#undef __STDIO_PUTC_MACRO
+#endif
+
+#ifdef __BCC__
+#undef __UCLIBC_HAS_LFS__
+#endif
+
+#ifndef __UCLIBC_HAS_LFS__
+#undef __UCLIBC_HAS_FOPEN_LARGEFILE_MODE__
+#endif
+
+/**********************************************************************/
+#include <bits/uClibc_mutex.h>
+
+/* user_locking
+ * 0 : do auto locking/unlocking
+ * 1 : user does locking/unlocking
+ * 2 : initial state prior to thread initialization
+ *     with no auto locking/unlocking
+ *
+ * When threading is initialized, walk the stdio open stream list
+ * and do  "if (user_locking == 2) user_locking = 0;".
+ *
+ * This way, we avoid calling the weak lock/unlock functions.
+ */
+
+#define __STDIO_AUTO_THREADLOCK_VAR						\
+        __UCLIBC_MUTEX_AUTO_LOCK_VAR(__infunc_user_locking)
+
+#define __STDIO_AUTO_THREADLOCK(__stream)					\
+        __UCLIBC_IO_MUTEX_AUTO_LOCK((__stream)->__lock, __infunc_user_locking,	\
+	(__stream)->__user_locking)
+
+#define __STDIO_AUTO_THREADUNLOCK(__stream)					\
+        __UCLIBC_IO_MUTEX_AUTO_UNLOCK((__stream)->__lock, __infunc_user_locking)
+
+#define __STDIO_ALWAYS_THREADLOCK(__stream)					\
+        __UCLIBC_IO_MUTEX_LOCK((__stream)->__lock)
+
+#define __STDIO_ALWAYS_THREADUNLOCK(__stream)					\
+        __UCLIBC_IO_MUTEX_UNLOCK((__stream)->__lock)
+
+#define __STDIO_ALWAYS_THREADLOCK_CANCEL_UNSAFE(__stream)			\
+        __UCLIBC_IO_MUTEX_LOCK_CANCEL_UNSAFE((__stream)->__lock)
+
+#define __STDIO_ALWAYS_THREADTRYLOCK_CANCEL_UNSAFE(__stream)			\
+        __UCLIBC_IO_MUTEX_TRYLOCK_CANCEL_UNSAFE((__stream)->__lock)
+
+#define __STDIO_ALWAYS_THREADUNLOCK_CANCEL_UNSAFE(__stream)			\
+        __UCLIBC_IO_MUTEX_UNLOCK_CANCEL_UNSAFE((__stream)->__lock)
+
+#ifdef __UCLIBC_HAS_THREADS__
+#define __STDIO_SET_USER_LOCKING(__stream)	((__stream)->__user_locking = 1)
+#else
+#define __STDIO_SET_USER_LOCKING(__stream)		((void)0)
+#endif
+
+#ifdef __UCLIBC_HAS_THREADS__
+#ifdef __USE_STDIO_FUTEXES__
+#define STDIO_INIT_MUTEX(M) _IO_lock_init(M)
+#else
+#define STDIO_INIT_MUTEX(M) __stdio_init_mutex(& M)
+#endif
+#endif
+
+/**********************************************************************/
+
+#define __STDIO_IOFBF 0		/* Fully buffered.  */
+#define __STDIO_IOLBF 1		/* Line buffered.  */
+#define __STDIO_IONBF 2		/* No buffering.  */
+
+typedef struct {
+	__off_t __pos;
+#ifdef __STDIO_MBSTATE
+	__mbstate_t __mbstate;
+#endif
+#ifdef __UCLIBC_HAS_WCHAR__
+	int __mblen_pending;
+#endif
+} __STDIO_fpos_t;
+
+#ifdef __UCLIBC_HAS_LFS__
+typedef struct {
+	__off64_t __pos;
+#ifdef __STDIO_MBSTATE
+	__mbstate_t __mbstate;
+#endif
+#ifdef __UCLIBC_HAS_WCHAR__
+	int __mblen_pending;
+#endif
+} __STDIO_fpos64_t;
+#endif
+
+/**********************************************************************/
+#ifdef __UCLIBC_HAS_LFS__
+typedef __off64_t __offmax_t;		/* TODO -- rename this? */
+#else
+typedef __off_t __offmax_t;		/* TODO -- rename this? */
+#endif
+
+/**********************************************************************/
+#ifdef __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__
+
+typedef __ssize_t __io_read_fn(void *__cookie, char *__buf, size_t __bufsize);
+typedef __ssize_t __io_write_fn(void *__cookie,
+					__const char *__buf, size_t __bufsize);
+/* NOTE: GLIBC difference!!! -- fopencookie seek function
+ * For glibc, the type of pos is always (__off64_t *) but in our case
+ * it is type (__off_t *) when the lib is built without large file support.
+ */
+typedef int __io_seek_fn(void *__cookie, __offmax_t *__pos, int __whence);
+typedef int __io_close_fn(void *__cookie);
+
+typedef struct {
+	__io_read_fn  *read;
+	__io_write_fn *write;
+	__io_seek_fn  *seek;
+	__io_close_fn *close;
+} _IO_cookie_io_functions_t;
+
+#if defined(_LIBC) || defined(_GNU_SOURCE)
+
+typedef __io_read_fn cookie_read_function_t;
+typedef __io_write_fn cookie_write_function_t;
+typedef __io_seek_fn cookie_seek_function_t;
+typedef __io_close_fn cookie_close_function_t;
+
+typedef _IO_cookie_io_functions_t cookie_io_functions_t;
+
+#endif
+
+#endif
+/**********************************************************************/
+
+struct __STDIO_FILE_STRUCT {
+	unsigned short __modeflags;
+	/* There could be a hole here, but modeflags is used most.*/
+#ifdef __UCLIBC_HAS_WCHAR__
+	unsigned char __ungot_width[2]; /* 0: current (building) char; 1: scanf */
+	/* Move the following futher down to avoid problems with getc/putc
+	 * macros breaking shared apps when wchar config support is changed. */
+	/* wchar_t ungot[2]; */
+#else  /* __UCLIBC_HAS_WCHAR__ */
+	unsigned char __ungot[2];
+#endif /* __UCLIBC_HAS_WCHAR__ */
+	int __filedes;
+#ifdef __STDIO_BUFFERS
+	unsigned char *__bufstart;	/* pointer to buffer */
+	unsigned char *__bufend;	/* pointer to 1 past end of buffer */
+	unsigned char *__bufpos;
+	unsigned char *__bufread; /* pointer to 1 past last buffered read char */
+
+#ifdef __STDIO_GETC_MACRO
+	unsigned char *__bufgetc_u;	/* 1 past last readable by getc_unlocked */
+#endif /* __STDIO_GETC_MACRO */
+#ifdef __STDIO_PUTC_MACRO
+	unsigned char *__bufputc_u;	/* 1 past last writeable by putc_unlocked */
+#endif /* __STDIO_PUTC_MACRO */
+
+#endif /* __STDIO_BUFFERS */
+
+#ifdef __STDIO_HAS_OPENLIST
+	struct __STDIO_FILE_STRUCT *__nextopen;
+#endif
+#ifdef __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__
+	void *__cookie;
+	_IO_cookie_io_functions_t __gcs;
+#endif
+#ifdef __UCLIBC_HAS_WCHAR__
+	wchar_t __ungot[2];
+#endif
+#ifdef __STDIO_MBSTATE
+	__mbstate_t __state;
+#endif
+#ifdef __UCLIBC_HAS_XLOCALE__
+	void *__unused;				/* Placeholder for codeset binding. */
+#endif
+#ifdef __UCLIBC_HAS_THREADS__
+	int __user_locking;
+	__UCLIBC_IO_MUTEX(__lock);
+#endif
+/* Everything after this is unimplemented... and may be trashed. */
+#if __STDIO_BUILTIN_BUF_SIZE > 0
+	unsigned char __builtinbuf[__STDIO_BUILTIN_BUF_SIZE];
+#endif /* __STDIO_BUILTIN_BUF_SIZE > 0 */
+};
+
+
+/***********************************************************************/
+/* Having ungotten characters implies the stream is reading.
+ * The scheme used here treats the least significant 2 bits of
+ * the stream's modeflags member as follows:
+ *   0 0   Not currently reading.
+ *   0 1   Reading, but no ungetc() or scanf() push back chars.
+ *   1 0   Reading with one ungetc() char (ungot[1] is 1)
+ *         or one scanf() pushed back char (ungot[1] is 0).
+ *   1 1   Reading with both an ungetc() char and a scanf()
+ *         pushed back char.  Note that this must be the result
+ *         of a scanf() push back (in ungot[0]) _followed_ by
+ *         an ungetc() call (in ungot[1]).
+ *
+ * Notes:
+ *   scanf() can NOT use ungetc() to push back characters.
+ *     (See section 7.19.6.2 of the C9X rationale -- WG14/N897.)
+ */
+
+#define __MASK_READING		0x0003U /* (0x0001 | 0x0002) */
+#define __FLAG_READING		0x0001U
+#define __FLAG_UNGOT		0x0002U
+#define __FLAG_EOF		0x0004U
+#define __FLAG_ERROR		0x0008U
+#define __FLAG_WRITEONLY	0x0010U
+#define __FLAG_READONLY		0x0020U /* (__FLAG_WRITEONLY << 1) */
+#define __FLAG_WRITING		0x0040U
+#define __FLAG_NARROW		0x0080U
+
+#define __FLAG_FBF		0x0000U /* must be 0 */
+#define __FLAG_LBF		0x0100U
+#define __FLAG_NBF		0x0200U /* (__FLAG_LBF << 1) */
+#define __MASK_BUFMODE		0x0300U /* (__FLAG_LBF|__FLAG_NBF) */
+#define __FLAG_APPEND		0x0400U /* fixed! == O_APPEND for linux */
+#define __FLAG_WIDE		0x0800U
+/* available slot		0x1000U */
+#define __FLAG_FREEFILE		0x2000U
+#define __FLAG_FREEBUF		0x4000U
+#define __FLAG_LARGEFILE	0x8000U /* fixed! == 0_LARGEFILE for linux */
+#define __FLAG_FAILED_FREOPEN	__FLAG_LARGEFILE
+
+/* Note: In no-buffer mode, it would be possible to pack the necessary
+ * flags into one byte.  Since we wouldn't be buffering and there would
+ * be no support for wchar, the only flags we would need would be:
+ *   2 bits : ungot count
+ *   2 bits : eof + error
+ *   2 bits : readonly + writeonly
+ *   1 bit  : freefile
+ *   1 bit  : appending
+ * So, for a very small system (< 128 files) we might have a
+ * 4-byte FILE struct of:
+ *   unsigned char flags;
+ *   signed char filedes;
+ *   unsigned char ungot[2];
+ */
+/**********************************************************************
+ * PROTOTYPES OF INTERNAL FUNCTIONS
+ **********************************************************************/
+#if defined _LIBC && (defined IS_IN_libc || defined NOT_IN_libc)
+
+extern void _stdio_init(void) attribute_hidden;
+extern void _stdio_term(void) attribute_hidden;
+
+#ifdef __STDIO_HAS_OPENLIST
+
+extern struct __STDIO_FILE_STRUCT *_stdio_openlist;
+
+#ifdef __UCLIBC_HAS_THREADS__
+__UCLIBC_IO_MUTEX_EXTERN(_stdio_openlist_add_lock);
+#ifdef __STDIO_BUFFERS
+__UCLIBC_IO_MUTEX_EXTERN(_stdio_openlist_del_lock);
+extern volatile int _stdio_openlist_use_count; /* _stdio_openlist_del_lock */
+extern int _stdio_openlist_del_count; /* _stdio_openlist_del_lock */
+#endif
+extern int _stdio_user_locking;
+extern void __stdio_init_mutex(__UCLIBC_MUTEX_TYPE *m) attribute_hidden;
+#endif
+
+#endif
+
+#endif
+/**********************************************************************/
+
+#define __CLEARERR_UNLOCKED(__stream)					\
+	((void)((__stream)->__modeflags &= ~(__FLAG_EOF|__FLAG_ERROR)))
+#define __FEOF_UNLOCKED(__stream)	((__stream)->__modeflags & __FLAG_EOF)
+#define __FERROR_UNLOCKED(__stream)	((__stream)->__modeflags & __FLAG_ERROR)
+
+#ifdef __UCLIBC_HAS_THREADS__
+# define __CLEARERR(__stream)		(clearerr)(__stream)
+# define __FERROR(__stream)		(ferror)(__stream)
+# define __FEOF(__stream)		(feof)(__stream)
+#else
+# define __CLEARERR(__stream)		__CLEARERR_UNLOCKED(__stream)
+# define __FERROR(__stream)		__FERROR_UNLOCKED(__stream)
+# define __FEOF(__stream)		__FEOF_UNLOCKED(__stream)
+#endif
+
+extern int __fgetc_unlocked(FILE *__stream);
+libc_hidden_proto(__fgetc_unlocked)
+extern int __fputc_unlocked(int __c, FILE *__stream);
+libc_hidden_proto(__fputc_unlocked)
+
+/* First define the default definitions.
+   They are overridden below as necessary. */
+#define __FGETC_UNLOCKED(__stream)		(__fgetc_unlocked)((__stream))
+#define __FGETC(__stream)			(fgetc)((__stream))
+#define __GETC_UNLOCKED_MACRO(__stream)		(__fgetc_unlocked)((__stream))
+#define __GETC_UNLOCKED(__stream)		(__fgetc_unlocked)((__stream))
+#define __GETC(__stream)			(fgetc)((__stream))
+
+#define __FPUTC_UNLOCKED(__c, __stream)		(__fputc_unlocked)((__c),(__stream))
+#define __FPUTC(__c, __stream)			(fputc)((__c),(__stream))
+#define __PUTC_UNLOCKED_MACRO(__c, __stream)	(__fputc_unlocked)((__c),(__stream))
+#define __PUTC_UNLOCKED(__c, __stream)		(__fputc_unlocked)((__c),(__stream))
+#define __PUTC(__c, __stream)			(fputc)((__c),(__stream))
+
+
+#ifdef __STDIO_GETC_MACRO
+
+extern FILE *__stdin;			/* For getchar() macro. */
+
+# undef  __GETC_UNLOCKED_MACRO
+# define __GETC_UNLOCKED_MACRO(__stream)				\
+		( ((__stream)->__bufpos < (__stream)->__bufgetc_u)	\
+		  ? (*(__stream)->__bufpos++)				\
+		  : __fgetc_unlocked(__stream) )
+
+# if 0
+	/* Classic macro approach.  getc{_unlocked} can have side effects. */
+#  undef  __GETC_UNLOCKED
+#  define __GETC_UNLOCKED(__stream)		__GETC_UNLOCKED_MACRO((__stream))
+#  ifndef __UCLIBC_HAS_THREADS__
+#   undef  __GETC
+#   define __GETC(__stream)				__GETC_UNLOCKED_MACRO((__stream))
+#  endif
+
+# else
+	/* Using gcc extension for safety and additional inlining. */
+#  undef  __FGETC_UNLOCKED
+#  define __FGETC_UNLOCKED(__stream)					\
+		(__extension__ ({					\
+			FILE *__S = (__stream);				\
+			__GETC_UNLOCKED_MACRO(__S);			\
+		}) )
+
+#  undef  __GETC_UNLOCKED
+#  define __GETC_UNLOCKED(__stream)		__FGETC_UNLOCKED((__stream))
+
+#  ifdef __UCLIBC_HAS_THREADS__
+#   undef  __FGETC
+#   define __FGETC(__stream)						\
+		(__extension__ ({					\
+			FILE *__S = (__stream);				\
+			((__S->__user_locking )				\
+			 ? __GETC_UNLOCKED_MACRO(__S)			\
+			 : (fgetc)(__S));				\
+		}) )
+
+#   undef  __GETC
+#   define __GETC(__stream)			__FGETC((__stream))
+
+#  else
+
+#   undef  __FGETC
+#   define __FGETC(__stream)			__FGETC_UNLOCKED((__stream))
+#   undef  __GETC
+#   define __GETC(__stream)			__FGETC_UNLOCKED((__stream))
+
+#  endif
+# endif
+
+#else
+
+#endif /* __STDIO_GETC_MACRO */
+
+
+#ifdef __STDIO_PUTC_MACRO
+
+extern FILE *__stdout;			/* For putchar() macro. */
+
+# undef  __PUTC_UNLOCKED_MACRO
+# define __PUTC_UNLOCKED_MACRO(__c, __stream)				\
+		( ((__stream)->__bufpos < (__stream)->__bufputc_u)	\
+		  ? (*(__stream)->__bufpos++) = (__c)			\
+		  : __fputc_unlocked((__c),(__stream)) )
+
+# if 0
+	/* Classic macro approach.  putc{_unlocked} can have side effects.*/
+#  undef  __PUTC_UNLOCKED
+#  define __PUTC_UNLOCKED(__c, __stream)				\
+					__PUTC_UNLOCKED_MACRO((__c), (__stream))
+#  ifndef __UCLIBC_HAS_THREADS__
+#   undef  __PUTC
+#   define __PUTC(__c, __stream)	__PUTC_UNLOCKED_MACRO((__c), (__stream))
+#  endif
+
+# else
+	/* Using gcc extension for safety and additional inlining. */
+
+#  undef  __FPUTC_UNLOCKED
+#  define __FPUTC_UNLOCKED(__c, __stream)				\
+		(__extension__ ({					\
+			FILE *__S = (__stream);				\
+			__PUTC_UNLOCKED_MACRO((__c),__S);		\
+		}) )
+
+#  undef  __PUTC_UNLOCKED
+#  define __PUTC_UNLOCKED(__c, __stream)	__FPUTC_UNLOCKED((__c), (__stream))
+
+#  ifdef __UCLIBC_HAS_THREADS__
+#   undef  __FPUTC
+#   define __FPUTC(__c, __stream)					\
+		(__extension__ ({					\
+			FILE *__S = (__stream);				\
+			((__S->__user_locking)				\
+			 ? __PUTC_UNLOCKED_MACRO((__c),__S)		\
+			 : (fputc)((__c),__S));				\
+		}) )
+
+#   undef  __PUTC
+#   define __PUTC(__c, __stream)		__FPUTC((__c), (__stream))
+
+#  else
+
+#   undef  __FPUTC
+#   define __FPUTC(__c, __stream)		__FPUTC_UNLOCKED((__c),(__stream))
+#   undef  __PUTC
+#   define __PUTC(__c, __stream)		__FPUTC_UNLOCKED((__c),(__stream))
+
+#  endif
+# endif
+
+#endif /* __STDIO_PUTC_MACRO */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h
new file mode 100644
index 0000000..a65d613
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h
@@ -0,0 +1,55 @@
+/*  Copyright (C) 2003     Manuel Novoa III
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  The GNU C Library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with the GNU C Library; if not, write to the Free
+ *  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ *  02111-1307 USA.
+ */
+
+/*  ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!
+ *
+ *  Besides uClibc, I'm using this code in my libc for elks, which is
+ *  a 16-bit environment with a fairly limited compiler.  It would make
+ *  things much easier for me if this file isn't modified unnecessarily.
+ *  In particular, please put any new or replacement functions somewhere
+ *  else, and modify the makefile to use your version instead.
+ *  Thanks.  Manuel
+ *
+ *  ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION! */
+
+#ifndef _UCLIBC_TOUPLOW_H
+#define _UCLIBC_TOUPLOW_H
+
+#include <features.h>
+#include <bits/types.h>
+
+/* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */
+
+typedef __uint16_t __ctype_mask_t;
+
+#ifdef __UCLIBC_HAS_CTYPE_SIGNED__
+
+typedef __int16_t __ctype_touplow_t;
+#define __UCLIBC_CTYPE_B_TBL_OFFSET       128
+#define __UCLIBC_CTYPE_TO_TBL_OFFSET      128
+
+#else
+
+typedef unsigned char __ctype_touplow_t;
+#define __UCLIBC_CTYPE_B_TBL_OFFSET       1
+#define __UCLIBC_CTYPE_TO_TBL_OFFSET      0
+
+#endif
+
+#endif /* _UCLIBC_TOUPLOW_H */
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_uintmaxtostr.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_uintmaxtostr.h
new file mode 100644
index 0000000..92633ff
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_uintmaxtostr.h
@@ -0,0 +1,116 @@
+/*  Copyright (C) 2003     Manuel Novoa III
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  The GNU C Library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with the GNU C Library; if not, write to the Free
+ *  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ *  02111-1307 USA.
+ */
+
+/*  ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!
+ *
+ *  This code is currently under development.  Also, I plan to port
+ *  it to elks which is a 16-bit environment with a fairly limited
+ *  compiler.  Therefore, please refrain from modifying this code
+ *  and, instead, pass any bug-fixes, etc. to me.  Thanks.  Manuel
+ *
+ *  ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION! */
+
+#ifndef _UINTMAXTOSTR_H
+#define _UINTMAXTOSTR_H 1
+
+#ifdef _FEATURES_H
+# ifndef __USE_ISOC99
+#  error features was included without defining _ISOC99_SOURCE!
+# endif
+#else
+# ifndef _ISOC99_SOURCE
+#  define _ISOC99_SOURCE
+# endif
+#endif
+
+#include <features.h>
+#include <limits.h>
+#include <stdint.h>
+
+#if INTMAX_MAX <= 2147483647L
+#define __UIM_BUFLEN			12 /* 10 digits + 1 nul + 1 sign */
+#elif INTMAX_MAX <= 9223372036854775807LL
+#define __UIM_BUFLEN			22 /* 20 digits + 1 nul + 1 sign */
+#else
+#error unknown number of digits for intmax_t!
+#endif
+
+#ifdef LLONG_MAX				/* --------------- */
+#if LLONG_MAX <= 2147483647L
+#define __UIM_BUFLEN_LLONG		12 /* 10 digits + 1 nul + 1 sign */
+#elif LLONG_MAX <= 9223372036854775807LL
+#define __UIM_BUFLEN_LLONG		22 /* 20 digits + 1 nul + 1 sign */
+#else
+#error unknown number of digits for long long!
+#endif
+#endif /* ULLONG_MAX ----------------------------- */
+
+#if LONG_MAX <= 2147483647L
+#define __UIM_BUFLEN_LONG		12 /* 10 digits + 1 nul + 1 sign */
+#elif LONG_MAX <= 9223372036854775807LL
+#define __UIM_BUFLEN_LONG		22 /* 20 digits + 1 nul + 1 sign */
+#else
+#error unknown number of digits for long!
+#endif
+
+#if INT_MAX <= 32767
+#define __UIM_BUFLEN_INT		7 /* 10 digits + 1 nul + 1 sign */
+#elif INT_MAX <= 2147483647L
+#define __UIM_BUFLEN_INT		12 /* 10 digits + 1 nul + 1 sign */
+#else
+#error unknown number of digits for int!
+#endif
+
+typedef enum {
+	__UIM_DECIMAL = 0,
+	__UIM_GROUP = ',',			/* Base 10 locale-dependent grouping. */
+	__UIM_LOWER = 'a' - 10,
+	__UIM_UPPER = 'A' - 10,
+} __UIM_CASE;
+
+/* Convert the int val to a string in base abs(base).  val is treated as
+ * an unsigned ??? int type if base > 0, and signed if base < 0.  This
+ * is an internal function with _no_ error checking done unless assert()s
+ * are enabled.
+ *
+ * Note: bufend is a pointer to the END of the buffer passed.
+ * Call like this:
+ *     char buf[SIZE], *p;
+ *     p = _xltostr(buf + sizeof(buf) - 1, {unsigned int},  10, __UIM_DECIMAL)
+ *     p = _xltostr(buf + sizeof(buf) - 1,          {int}, -10, __UIM_DECIMAL)
+ *
+ * WARNING: If base > 10, case _must_be_ either __UIM_LOWER or __UIM_UPPER
+ *          for lower and upper case alphas respectively.
+ * WARNING: If val is really a signed type, make sure base is negative!
+ *          Otherwise, you could overflow your buffer.
+ */
+extern char *_uintmaxtostr(char * __restrict bufend, uintmax_t uval,
+					int base, __UIM_CASE alphacase) attribute_hidden;
+
+/* TODO -- make this either a (possibly inline) function? */
+#ifndef __BCC__
+#define _int10tostr(bufend, intval) \
+	_uintmaxtostr((bufend), (intval), -10, __UIM_DECIMAL)
+#else  /* bcc doesn't do prototypes, we need to explicitly cast */
+#define _int10tostr(bufend, intval) \
+	_uintmaxtostr((bufend), (uintmax_t)(intval), -10, __UIM_DECIMAL)
+#endif
+
+#define __BUFLEN_INT10TOSTR		__UIM_BUFLEN_INT
+
+#endif /* _UINTMAXTOSTR_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_uwchar.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_uwchar.h
new file mode 100644
index 0000000..ba2c42d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_uwchar.h
@@ -0,0 +1,57 @@
+/*  Copyright (C) 2003     Manuel Novoa III
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  The GNU C Library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with the GNU C Library; if not, write to the Free
+ *  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ *  02111-1307 USA.
+ */
+
+/*  ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!
+ *
+ *  Besides uClibc, I'm using this code in my libc for elks, which is
+ *  a 16-bit environment with a fairly limited compiler.  It would make
+ *  things much easier for me if this file isn't modified unnecessarily.
+ *  In particular, please put any new or replacement functions somewhere
+ *  else, and modify the makefile to use your version instead.
+ *  Thanks.  Manuel
+ *
+ *  ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION!   ATTENTION! */
+
+
+/*  Define an internal unsigned int type __uwchar_t just large enough
+ *  to hold a wchar_t.
+ */
+
+#ifndef _UCLIBC_UWCHAR_H
+#define _UCLIBC_UWCHAR_H
+
+#include <limits.h>
+#include <stdint.h>
+
+#if WCHAR_MIN == 0
+typedef wchar_t				__uwchar_t;
+#elif WCHAR_MAX <= USHRT_MAX
+typedef unsigned short		__uwchar_t;
+#elif WCHAR_MAX <= UINT_MAX
+typedef unsigned int		__uwchar_t;
+#elif WCHAR_MAX <= ULONG_MAX
+typedef unsigned long		__uwchar_t;
+#elif defined(ULLONG_MAX) && (WCHAR_MAX <= ULLONG_MAX)
+typedef unsigned long long	__uwchar_t;
+#elif WCHAR_MAX <= UINTMAX_MAX
+typedef uintmax_t			__uwchar_t;
+#else
+#error Can not determine an appropriate type for __uwchar_t!
+#endif
+
+#endif /* _UCLIBC_UWCHAR_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_va_copy.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_va_copy.h
new file mode 100644
index 0000000..98663fc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uClibc_va_copy.h
@@ -0,0 +1,40 @@
+/* Copyright (C) 2005       Manuel Novoa III    <mjn3@codepoet.org>
+ *
+ * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  The GNU C Library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with the GNU C Library; if not, write to the Free
+ *  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ *  02111-1307 USA.
+ */
+
+#ifndef _UCLIBC_VA_COPY_H
+#define _UCLIBC_VA_COPY_H 1
+
+#include <stdarg.h>
+
+/* Deal with pre-C99 compilers. */
+#ifndef va_copy
+
+#ifdef __va_copy
+#define va_copy(A,B)	__va_copy(A,B)
+#else
+#warning Neither va_copy (C99/SUSv3) or __va_copy is defined.  Using a simple copy instead.  But you should really check that this is appropriate and supply an arch-specific override if necessary.
+	/* the glibc manual suggests that this will usually suffice when
+        __va_copy doesn't exist.  */
+#define va_copy(A,B)	A = B
+#endif
+
+#endif /* va_copy */
+
+#endif /* _UCLIBC_VA_COPY_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/uio.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uio.h
new file mode 100644
index 0000000..87f916d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/uio.h
@@ -0,0 +1,51 @@
+/* Copyright (C) 1996, 1997, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if !defined _SYS_UIO_H && !defined _FCNTL_H
+# error "Never include <bits/uio.h> directly; use <sys/uio.h> instead."
+#endif
+
+#ifndef _BITS_UIO_H
+#define _BITS_UIO_H	1
+
+#include <sys/types.h>
+
+
+/* We should normally use the Linux kernel header file to define this
+   type and macros but this calls for trouble because of the header
+   includes other kernel headers.  */
+
+/* Size of object which can be written atomically.
+
+   This macro has different values in different kernel versions.  The
+   latest versions of the kernel use 1024 and this is good choice.  Since
+   the C library implementation of readv/writev is able to emulate the
+   functionality even if the currently running kernel does not support
+   this large value the readv/writev call will not fail because of this.  */
+#define UIO_MAXIOV	1024
+#define UIO_FASTIOV    8
+
+
+/* Structure for scatter/gather I/O.  */
+struct iovec
+  {
+    void *iov_base;	/* Pointer to data.  */
+    size_t iov_len;	/* Length of data.  */
+  };
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/ustat.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/ustat.h
new file mode 100644
index 0000000..69c6b72
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/ustat.h
@@ -0,0 +1,31 @@
+/* Copyright (C) 1997, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_USTAT_H
+# error "Never include <bits/ustat.h> directly; use <sys/ustat.h> instead."
+#endif
+
+#include <sys/types.h>
+
+struct ustat
+  {
+    __daddr_t f_tfree;		/* Number of free blocks.  */
+    __ino_t f_tinode;		/* Number of free inodes.  */
+    char f_fname[6];
+    char f_fpack[6];
+  };
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/utmp.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/utmp.h
new file mode 100644
index 0000000..e855ad7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/utmp.h
@@ -0,0 +1,125 @@
+/* The `struct utmp' type, describing entries in the utmp file.  GNU version.
+   Copyright (C) 1993, 1996, 1997, 1998, 1999, 2002
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _UTMP_H
+# error "Never include <bits/utmp.h> directly; use <utmp.h> instead."
+#endif
+
+#include <paths.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <bits/wordsize.h>
+
+
+#define UT_LINESIZE	32
+#define UT_NAMESIZE	32
+#define UT_HOSTSIZE	256
+
+
+/* The structure describing an entry in the database of
+   previous logins.  */
+struct lastlog
+  {
+#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+    int32_t ll_time;
+#else
+    __time_t ll_time;
+#endif
+    char ll_line[UT_LINESIZE];
+    char ll_host[UT_HOSTSIZE];
+  };
+
+
+/* The structure describing the status of a terminated process.  This
+   type is used in `struct utmp' below.  */
+struct exit_status
+  {
+    short int e_termination;	/* Process termination status.  */
+    short int e_exit;		/* Process exit status.  */
+  };
+
+
+/* The structure describing an entry in the user accounting database.  */
+struct utmp
+{
+  short int ut_type;		/* Type of login.  */
+  pid_t ut_pid;			/* Process ID of login process.  */
+  char ut_line[UT_LINESIZE];	/* Devicename.  */
+  char ut_id[4];		/* Inittab ID.  */
+  char ut_user[UT_NAMESIZE];	/* Username.  */
+  char ut_host[UT_HOSTSIZE];	/* Hostname for remote login.  */
+  struct exit_status ut_exit;	/* Exit status of a process marked
+				   as DEAD_PROCESS.  */
+/* The ut_session and ut_tv fields must be the same size when compiled
+   32- and 64-bit.  This allows data files and shared memory to be
+   shared between 32- and 64-bit applications.  */
+#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+  int32_t ut_session;		/* Session ID, used for windowing.  */
+  struct
+  {
+    int32_t tv_sec;		/* Seconds.  */
+    int32_t tv_usec;		/* Microseconds.  */
+  } ut_tv;			/* Time entry was made.  */
+#else
+  long int ut_session;		/* Session ID, used for windowing.  */
+  struct timeval ut_tv;		/* Time entry was made.  */
+#endif
+
+  int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
+  char __unused[20];		/* Reserved for future use.  */
+};
+
+/* Backwards compatibility hacks.  */
+#define ut_name		ut_user
+#ifndef _NO_UT_TIME
+/* We have a problem here: `ut_time' is also used otherwise.  Define
+   _NO_UT_TIME if the compiler complains.  */
+# define ut_time	ut_tv.tv_sec
+#endif
+#define ut_xtime	ut_tv.tv_sec
+#define ut_addr		ut_addr_v6[0]
+
+
+/* Values for the `ut_type' field of a `struct utmp'.  */
+#define EMPTY		0	/* No valid user accounting information.  */
+
+#define RUN_LVL		1	/* The system's runlevel.  */
+#define BOOT_TIME	2	/* Time of system boot.  */
+#define NEW_TIME	3	/* Time after system clock changed.  */
+#define OLD_TIME	4	/* Time when system clock changed.  */
+
+#define INIT_PROCESS	5	/* Process spawned by the init process.  */
+#define LOGIN_PROCESS	6	/* Session leader of a logged in user.  */
+#define USER_PROCESS	7	/* Normal process.  */
+#define DEAD_PROCESS	8	/* Terminated process.  */
+
+#define ACCOUNTING	9
+
+/* Old Linux name for the EMPTY type.  */
+#define UT_UNKNOWN	EMPTY
+
+
+/* Tell the user that we have a modern system with UT_HOST, UT_PID,
+   UT_TYPE, UT_ID and UT_TV fields.  */
+#define _HAVE_UT_TYPE	1
+#define _HAVE_UT_PID	1
+#define _HAVE_UT_ID	1
+#define _HAVE_UT_TV	1
+#define _HAVE_UT_HOST	1
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/utmpx.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/utmpx.h
new file mode 100644
index 0000000..c84cda6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/utmpx.h
@@ -0,0 +1,103 @@
+/* Structures and definitions for the user accounting database.  GNU version.
+   Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _UTMPX_H
+# error "Never include <bits/utmpx.h> directly; use <utmpx.h> instead."
+#endif
+
+#include <bits/types.h>
+#include <sys/time.h>
+#include <bits/wordsize.h>
+
+
+#ifdef __USE_GNU
+# include <paths.h>
+# define _PATH_UTMPX	_PATH_UTMP
+# define _PATH_WTMPX	_PATH_WTMP
+#endif
+
+
+#define __UT_LINESIZE	32
+#define __UT_NAMESIZE	32
+#define __UT_HOSTSIZE	256
+
+
+/* The structure describing the status of a terminated process.  This
+   type is used in `struct utmpx' below.  */
+struct __exit_status
+  {
+#ifdef __USE_GNU
+    short int e_termination;	/* Process termination status.  */
+    short int e_exit;		/* Process exit status.  */
+#else
+    short int __e_termination;	/* Process termination status.  */
+    short int __e_exit;		/* Process exit status.  */
+#endif
+  };
+
+
+/* The structure describing an entry in the user accounting database.  */
+struct utmpx
+{
+  short int ut_type;		/* Type of login.  */
+  __pid_t ut_pid;		/* Process ID of login process.  */
+  char ut_line[__UT_LINESIZE];	/* Devicename.  */
+  char ut_id[4];		/* Inittab ID. */
+  char ut_user[__UT_NAMESIZE];	/* Username.  */
+  char ut_host[__UT_HOSTSIZE];	/* Hostname for remote login.  */
+  struct __exit_status ut_exit;	/* Exit status of a process marked
+				   as DEAD_PROCESS.  */
+
+/* The fields ut_session and ut_tv must be the same size when compiled
+   32- and 64-bit.  This allows files and shared memory to be shared
+   between 32- and 64-bit applications.  */
+#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+  __int32_t ut_session;		/* Session ID, used for windowing.  */
+  struct
+  {
+    __int32_t tv_sec;		/* Seconds.  */
+    __int32_t tv_usec;		/* Microseconds.  */
+  } ut_tv;			/* Time entry was made.  */
+#else
+  long int ut_session;		/* Session ID, used for windowing.  */
+  struct timeval ut_tv;		/* Time entry was made.  */
+#endif
+  __int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
+  char __unused[20];		/* Reserved for future use.  */
+};
+
+
+/* Values for the `ut_type' field of a `struct utmpx'.  */
+#define EMPTY		0	/* No valid user accounting information.  */
+
+#ifdef __USE_GNU
+# define RUN_LVL	1	/* The system's runlevel.  */
+#endif
+#define BOOT_TIME	2	/* Time of system boot.  */
+#define NEW_TIME	3	/* Time after system clock changed.  */
+#define OLD_TIME	4	/* Time when system clock changed.  */
+
+#define INIT_PROCESS	5	/* Process spawned by the init process.  */
+#define LOGIN_PROCESS	6	/* Session leader of a logged in user.  */
+#define USER_PROCESS	7	/* Normal process.  */
+#define DEAD_PROCESS	8	/* Terminated process.  */
+
+#ifdef __USE_GNU
+# define ACCOUNTING	9	/* System accounting.  */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/utsname.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/utsname.h
new file mode 100644
index 0000000..35e71e3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/utsname.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_UTSNAME_H
+# error "Never include <bits/utsname.h> directly; use <sys/utsname.h> instead."
+#endif
+
+/* Length of the entries in `struct utsname' is 65.  */
+#define _UTSNAME_LENGTH 65
+
+/* Linux provides as additional information in the `struct utsname'
+   the name of the current domain.  Define _UTSNAME_DOMAIN_LENGTH
+   to a value != 0 to activate this entry.  */
+#define _UTSNAME_DOMAIN_LENGTH _UTSNAME_LENGTH
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/waitflags.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/waitflags.h
new file mode 100644
index 0000000..464cedb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/waitflags.h
@@ -0,0 +1,38 @@
+/* Definitions of flag bits for `waitpid' et al.
+   Copyright (C) 1992,1996,1997,2000,2004,2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if !defined _SYS_WAIT_H && !defined _STDLIB_H
+# error "Never include <bits/waitflags.h> directly; use <sys/wait.h> instead."
+#endif
+
+
+/* Bits in the third argument to `waitpid'.  */
+#define	WNOHANG		1	/* Don't block waiting.  */
+#define	WUNTRACED	2	/* Report status of stopped children.  */
+
+/* Bits in the fourth argument to `waitid'.  */
+#define WSTOPPED	2	/* Report stopped child (same as WUNTRACED). */
+#define WEXITED		4	/* Report dead child.  */
+#define WCONTINUED	8	/* Report continued child.  */
+#define WNOWAIT		0x01000000 /* Don't reap, just poll status.  */
+
+#define __WNOTHREAD     0x20000000 /* Don't wait on children of other threads
+				      in this group */
+#define __WALL		0x40000000 /* Wait for any child.  */
+#define __WCLONE	0x80000000 /* Wait for cloned process.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/waitstatus.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/waitstatus.h
new file mode 100644
index 0000000..699c224
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/waitstatus.h
@@ -0,0 +1,106 @@
+/* Definitions of status bits for `wait' et al.
+   Copyright (C) 1992,1994,1996,1997,2000,2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if !defined _SYS_WAIT_H && !defined _STDLIB_H
+# error "Never include <bits/waitstatus.h> directly; use <sys/wait.h> instead."
+#endif
+
+
+/* Everything extant so far uses these same bits.  */
+
+
+/* If WIFEXITED(STATUS), the low-order 8 bits of the status.  */
+#define	__WEXITSTATUS(status)	(((status) & 0xff00) >> 8)
+
+/* If WIFSIGNALED(STATUS), the terminating signal.  */
+#define	__WTERMSIG(status)	((status) & 0x7f)
+
+/* If WIFSTOPPED(STATUS), the signal that stopped the child.  */
+#define	__WSTOPSIG(status)	__WEXITSTATUS(status)
+
+/* Nonzero if STATUS indicates normal termination.  */
+#define	__WIFEXITED(status)	(__WTERMSIG(status) == 0)
+
+/* Nonzero if STATUS indicates termination by a signal.  */
+#define __WIFSIGNALED(status) \
+  (((signed char) (((status) & 0x7f) + 1) >> 1) > 0)
+
+/* Nonzero if STATUS indicates the child is stopped.  */
+#define	__WIFSTOPPED(status)	(((status) & 0xff) == 0x7f)
+
+/* Nonzero if STATUS indicates the child continued after a stop.  We only
+   define this if <bits/waitflags.h> provides the WCONTINUED flag bit.  */
+#ifdef WCONTINUED
+# define __WIFCONTINUED(status)	((status) == __W_CONTINUED)
+#endif
+
+/* Nonzero if STATUS indicates the child dumped core.  */
+#define	__WCOREDUMP(status)	((status) & __WCOREFLAG)
+
+/* Macros for constructing status values.  */
+#define	__W_EXITCODE(ret, sig)	((ret) << 8 | (sig))
+#define	__W_STOPCODE(sig)	((sig) << 8 | 0x7f)
+#define __W_CONTINUED		0xffff
+#define	__WCOREFLAG		0x80
+
+
+#ifdef	__USE_BSD
+
+# include <endian.h>
+
+union wait
+  {
+    int w_status;
+    struct
+      {
+# if	__BYTE_ORDER == __LITTLE_ENDIAN
+	unsigned int __w_termsig:7; /* Terminating signal.  */
+	unsigned int __w_coredump:1; /* Set if dumped core.  */
+	unsigned int __w_retcode:8; /* Return code if exited normally.  */
+	unsigned int:16;
+# endif				/* Little endian.  */
+# if	__BYTE_ORDER == __BIG_ENDIAN
+	unsigned int:16;
+	unsigned int __w_retcode:8;
+	unsigned int __w_coredump:1;
+	unsigned int __w_termsig:7;
+# endif				/* Big endian.  */
+      } __wait_terminated;
+    struct
+      {
+# if	__BYTE_ORDER == __LITTLE_ENDIAN
+	unsigned int __w_stopval:8; /* W_STOPPED if stopped.  */
+	unsigned int __w_stopsig:8; /* Stopping signal.  */
+	unsigned int:16;
+# endif				/* Little endian.  */
+# if	__BYTE_ORDER == __BIG_ENDIAN
+	unsigned int:16;
+	unsigned int __w_stopsig:8; /* Stopping signal.  */
+	unsigned int __w_stopval:8; /* W_STOPPED if stopped.  */
+# endif				/* Big endian.  */
+      } __wait_stopped;
+  };
+
+# define w_termsig	__wait_terminated.__w_termsig
+# define w_coredump	__wait_terminated.__w_coredump
+# define w_retcode	__wait_terminated.__w_retcode
+# define w_stopsig	__wait_stopped.__w_stopsig
+# define w_stopval	__wait_stopped.__w_stopval
+
+#endif	/* Use BSD.  */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/wchar.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/wchar.h
new file mode 100644
index 0000000..ef1f563
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/wchar.h
@@ -0,0 +1,26 @@
+/* wchar_t type related definitions.
+   Copyright (C) 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _BITS_WCHAR_H
+#define _BITS_WCHAR_H	1
+
+#define __WCHAR_MIN	(-2147483647 - 1)
+#define __WCHAR_MAX	(2147483647)
+
+#endif	/* bits/wchar.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/wordsize.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/wordsize.h
new file mode 100644
index 0000000..2d8e2b9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/wordsize.h
@@ -0,0 +1,6 @@
+#error "This file must be written based on the data type sizes of the target"
+
+#if 0
+#define __WORDSIZE 32
+#define __WORDSIZE 64
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/bits/xopen_lim.h b/ap/build/uClibc/libc/sysdeps/linux/common/bits/xopen_lim.h
new file mode 100644
index 0000000..c2363ab
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/bits/xopen_lim.h
@@ -0,0 +1,150 @@
+/* Copyright (C) 1996, 1997, 1999, 2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/*
+ * Never include this file directly; use <limits.h> instead.
+ */
+
+/* Additional definitions from X/Open Portability Guide, Issue 4, Version 2
+   System Interfaces and Headers, 4.16 <limits.h>
+
+   Please note only the values which are not greater than the minimum
+   stated in the standard document are listed.  The `sysconf' functions
+   should be used to obtain the actual value.  */
+
+#ifndef _XOPEN_LIM_H
+#define _XOPEN_LIM_H	1
+
+#define __need_IOV_MAX
+#include <bits/stdio_lim.h>
+
+/* We do not provide fixed values for
+
+   ARG_MAX	Maximum length of argument to the `exec' function
+		including environment data.
+
+   ATEXIT_MAX	Maximum number of functions that may be registered
+		with `atexit'.
+
+   CHILD_MAX	Maximum number of simultaneous processes per real
+		user ID.
+
+   OPEN_MAX	Maximum number of files that one process can have open
+		at anyone time.
+
+   PAGESIZE
+   PAGE_SIZE	Size of bytes of a page.
+
+   PASS_MAX	Maximum number of significant bytes in a password.
+
+   We only provide a fixed limit for
+
+   IOV_MAX	Maximum number of `iovec' structures that one process has
+		available for use with `readv' or writev'.
+
+   if this is indeed fixed by the underlying system.
+*/
+
+
+/* Maximum number of `iovec' structures that one process has available
+   for use with `readv' or writev'.  */
+#define	_XOPEN_IOV_MAX	_POSIX_UIO_MAXIOV
+
+
+/* Maximum value of `digit' in calls to the `printf' and `scanf'
+   functions.  Posix dictates this should be a minimum of 9 */
+#if !defined(__UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS__) || (__UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS__ <= 1)
+#undef NL_ARGMAX
+#elif __UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS__ < 9
+#define NL_ARGMAX	9
+#else
+#define NL_ARGMAX	__UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS__
+#endif
+
+/* Maximum number of bytes in a `LANG' name.  We have no limit.  */
+#define NL_LANGMAX	_POSIX2_LINE_MAX
+
+/* Maximum message number.  We have no limit.  */
+#define NL_MSGMAX	INT_MAX
+
+/* Maximum number of bytes in N-to-1 collation mapping.  We have no
+   limit.  */
+#define NL_NMAX		INT_MAX
+
+/* Maximum set number.  We have no limit.  */
+#define NL_SETMAX	INT_MAX
+
+/* Maximum number of bytes in a message.  We have no limit.  */
+#define NL_TEXTMAX	INT_MAX
+
+/* Default process priority.  */
+#define NZERO		20
+
+
+/* Number of bits in a word of type `int'.  */
+#ifdef INT_MAX
+# if INT_MAX == 32767
+#  define WORD_BIT	16
+# else
+#  if INT_MAX == 2147483647
+#   define WORD_BIT	32
+#  else
+/* Safe assumption.  */
+#   define WORD_BIT	64
+#  endif
+# endif
+#elif defined __INT_MAX__
+# if __INT_MAX__ == 32767
+#  define WORD_BIT	16
+# else
+#  if __INT_MAX__ == 2147483647
+#   define WORD_BIT	32
+#  else
+/* Safe assumption.  */
+#   define WORD_BIT	64
+#  endif
+# endif
+#else
+# define WORD_BIT	32
+#endif
+
+/* Number of bits in a word of type `long int'.  */
+#ifdef LONG_MAX
+# if LONG_MAX == 2147483647
+#  define LONG_BIT	32
+# else
+/* Safe assumption.  */
+#  define LONG_BIT	64
+# endif
+#elif defined __LONG_MAX__
+# if __LONG_MAX__ == 2147483647
+#  define LONG_BIT	32
+# else
+/* Safe assumption.  */
+#  define LONG_BIT	64
+# endif
+#else
+# include <bits/wordsize.h>
+# if __WORDSIZE == 64
+#  define LONG_BIT	64
+# else
+#  define LONG_BIT	32
+# endif
+#endif
+
+#endif /* bits/xopen_lim.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/brk.c b/ap/build/uClibc/libc/sysdeps/linux/common/brk.c
new file mode 100644
index 0000000..18836ba
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/brk.c
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+libc_hidden_proto(brk)
+
+#define __NR___syscall_brk __NR_brk
+static inline _syscall1(void *, __syscall_brk, void *, end)
+
+/* This must be initialized data because commons can't have aliases.  */
+void * __curbrk attribute_hidden = 0;
+
+int brk(void *addr)
+{
+	void *newbrk = __syscall_brk(addr);
+
+	__curbrk = newbrk;
+
+	if (newbrk < addr) {
+		__set_errno (ENOMEM);
+		return -1;
+	}
+
+	return 0;
+}
+libc_hidden_def(brk)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/capget.c b/ap/build/uClibc/libc/sysdeps/linux/common/capget.c
new file mode 100644
index 0000000..c3e8c57
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/capget.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * capget() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+int capget(void *header, void *data);
+#ifdef __NR_capget
+_syscall2(int, capget, void *, header, void *, data)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/capset.c b/ap/build/uClibc/libc/sysdeps/linux/common/capset.c
new file mode 100644
index 0000000..c0cf5de
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/capset.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * capset() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+int capset(void *header, const void *data);
+#ifdef __NR_capset
+_syscall2(int, capset, void *, header, const void *, data)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/chdir.c b/ap/build/uClibc/libc/sysdeps/linux/common/chdir.c
new file mode 100644
index 0000000..e138101
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/chdir.c
@@ -0,0 +1,22 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * chdir() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+
+
+#define __NR___syscall_chdir __NR_chdir
+static __inline__ _syscall1(int, __syscall_chdir, const char *, path)
+int chdir(const char *path)
+{
+	return __syscall_chdir(path);
+}
+libc_hidden_def(chdir)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/chmod.c b/ap/build/uClibc/libc/sysdeps/linux/common/chmod.c
new file mode 100644
index 0000000..871e023
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/chmod.c
@@ -0,0 +1,21 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * chmod() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/stat.h>
+
+
+#define __NR___syscall_chmod __NR_chmod
+static __inline__ _syscall2(int, __syscall_chmod, const char *, path, __kernel_mode_t, mode)
+
+int chmod(const char *path, mode_t mode)
+{
+	return __syscall_chmod(path, mode);
+}
+libc_hidden_def(chmod)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/chown.c b/ap/build/uClibc/libc/sysdeps/linux/common/chown.c
new file mode 100644
index 0000000..f2c60e0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/chown.c
@@ -0,0 +1,40 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * chown() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <bits/wordsize.h>
+
+
+#if (__WORDSIZE == 32 && defined(__NR_chown32)) || __WORDSIZE == 64
+# ifdef __NR_chown32
+#  undef __NR_chown
+#  define __NR_chown __NR_chown32
+# endif
+
+_syscall3(int, chown, const char *, path, uid_t, owner, gid_t, group)
+
+#else
+
+# define __NR___syscall_chown __NR_chown
+static __inline__ _syscall3(int, __syscall_chown, const char *, path,
+		__kernel_uid_t, owner, __kernel_gid_t, group)
+
+int chown(const char *path, uid_t owner, gid_t group)
+{
+	if (((owner + 1) > (uid_t) ((__kernel_uid_t) - 1U))
+		|| ((group + 1) > (gid_t) ((__kernel_gid_t) - 1U))) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return (__syscall_chown(path, owner, group));
+}
+#endif
+
+libc_hidden_def(chown)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/chroot.c b/ap/build/uClibc/libc/sysdeps/linux/common/chroot.c
new file mode 100644
index 0000000..4c085f2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/chroot.c
@@ -0,0 +1,23 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * chroot() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/param.h>
+
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
+#define __NR___syscall_chroot __NR_chroot
+static __inline__ _syscall1(int, __syscall_chroot, const char *, path)
+
+int chroot(const char *path)
+{
+	return __syscall_chroot(path);
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/clock_getres.c b/ap/build/uClibc/libc/sysdeps/linux/common/clock_getres.c
new file mode 100644
index 0000000..61413b6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/clock_getres.c
@@ -0,0 +1,43 @@
+/*
+ * clock_getres() for uClibc
+ *
+ * Copyright (C) 2005 by Peter Kjellerstedt <pkj@axis.com>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <time.h>
+#include <unistd.h>
+
+#ifdef __NR_clock_getres
+_syscall2(int, clock_getres, clockid_t, clock_id, struct timespec*, res)
+#else
+
+int clock_getres(clockid_t clock_id, struct timespec* res)
+{
+	int retval = -1;
+
+	switch (clock_id) {
+		case CLOCK_REALTIME:
+			if (res) {
+				long clk_tck;
+
+				if ((clk_tck = sysconf(_SC_CLK_TCK)) < 0)
+					clk_tck = 100;
+				res->tv_sec = 0;
+				res->tv_nsec = 1000000000 / clk_tck;
+			}
+			retval = 0;
+			break;
+
+		default:
+			errno = EINVAL;
+			break;
+	}
+
+	return retval;
+}
+#endif
+libc_hidden_def(clock_getres)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/clock_gettime.c b/ap/build/uClibc/libc/sysdeps/linux/common/clock_gettime.c
new file mode 100644
index 0000000..d3755a7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/clock_gettime.c
@@ -0,0 +1,41 @@
+/*
+ * clock_gettime() for uClibc
+ *
+ * Copyright (C) 2003 by Justus Pendleton <uc@ryoohki.net>
+ * Copyright (C) 2005 by Peter Kjellerstedt <pkj@axis.com>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <time.h>
+#include <sys/time.h>
+
+#ifdef __NR_clock_gettime
+_syscall2(int, clock_gettime, clockid_t, clock_id, struct timespec*, tp)
+#else
+
+int clock_gettime(clockid_t clock_id, struct timespec* tp)
+{
+	struct timeval tv;
+	int retval = -1;
+
+	switch (clock_id) {
+		case CLOCK_REALTIME:
+			/* In Linux, gettimeofday fails only on bad parameter.
+			 * We know that here parameter isn't bad.
+			 */
+			gettimeofday(&tv, NULL);
+			TIMEVAL_TO_TIMESPEC(&tv, tp);
+			retval = 0;
+			break;
+
+		default:
+			errno = EINVAL;
+			break;
+	}
+
+	return retval;
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/clock_settime.c b/ap/build/uClibc/libc/sysdeps/linux/common/clock_settime.c
new file mode 100644
index 0000000..0c9c840
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/clock_settime.c
@@ -0,0 +1,41 @@
+/*
+ * clock_settime() for uClibc
+ *
+ * Copyright (C) 2005 by Peter Kjellerstedt <pkj@axis.com>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <time.h>
+#include <sys/time.h>
+
+#ifdef __NR_clock_settime
+_syscall2(int, clock_settime, clockid_t, clock_id, const struct timespec*, tp)
+#else
+
+int clock_settime(clockid_t clock_id, const struct timespec* tp)
+{
+	struct timeval tv;
+	int retval = -1;
+
+	if (tp->tv_nsec < 0 || tp->tv_nsec >= 1000000000) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	switch (clock_id) {
+		case CLOCK_REALTIME:
+			TIMESPEC_TO_TIMEVAL(&tv, tp);
+			retval = settimeofday(&tv, NULL);
+			break;
+
+		default:
+			errno = EINVAL;
+			break;
+	}
+
+	return retval;
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/close.c b/ap/build/uClibc/libc/sysdeps/linux/common/close.c
new file mode 100644
index 0000000..d6b5fbb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/close.c
@@ -0,0 +1,20 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * close() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+_syscall1(int, close, int, fd)
+
+#ifndef __LINUXTHREADS_OLD__
+libc_hidden_def(close)
+#else
+libc_hidden_weak(close)
+strong_alias(close,__libc_close)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/cmsg_nxthdr.c b/ap/build/uClibc/libc/sysdeps/linux/common/cmsg_nxthdr.c
new file mode 100644
index 0000000..0360b47
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/cmsg_nxthdr.c
@@ -0,0 +1,44 @@
+/* Return point to next ancillary data entry in message header.
+   Copyright (C) 1997, 1998, 2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#define __FORCE_GLIBC
+#include <features.h>
+/* Prevent math.h from defining a colliding inline */
+#undef __USE_EXTERN_INLINES
+#include <sys/socket.h>
+
+
+struct cmsghdr *
+__cmsg_nxthdr (struct msghdr *mhdr, struct cmsghdr *cmsg)
+{
+  if ((size_t) cmsg->cmsg_len < sizeof (struct cmsghdr))
+    /* The kernel header does this so there may be a reason.  */
+    return NULL;
+
+  cmsg = (struct cmsghdr *) ((unsigned char *) cmsg
+			     + CMSG_ALIGN (cmsg->cmsg_len));
+  if ((unsigned char *) (cmsg + 1) > ((unsigned char *) mhdr->msg_control
+				      + mhdr->msg_controllen)
+      || ((unsigned char *) cmsg + CMSG_ALIGN (cmsg->cmsg_len)
+	  > ((unsigned char *) mhdr->msg_control + mhdr->msg_controllen)))
+    /* No more entries.  */
+    return NULL;
+  return cmsg;
+}
+libc_hidden_def(__cmsg_nxthdr)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/creat.c b/ap/build/uClibc/libc/sysdeps/linux/common/creat.c
new file mode 100644
index 0000000..77cf44e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/creat.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * creat() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <fcntl.h>
+
+int creat(const char *file, mode_t mode)
+{
+	return open(file, O_WRONLY | O_CREAT | O_TRUNC, mode);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/creat64.c b/ap/build/uClibc/libc/sysdeps/linux/common/creat64.c
new file mode 100644
index 0000000..577ad14
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/creat64.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 1991, 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <_lfs_64.h>
+
+#ifdef __UCLIBC_HAS_LFS__
+#include <fcntl.h>
+#include <sys/types.h>
+
+/* Create FILE with protections MODE.  */
+int creat64(const char *file, mode_t mode)
+{
+	return open64(file, O_WRONLY|O_CREAT|O_TRUNC, mode);
+}
+#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/create_module.c b/ap/build/uClibc/libc/sysdeps/linux/common/create_module.c
new file mode 100644
index 0000000..ddd7c4c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/create_module.c
@@ -0,0 +1,52 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * create_module syscall for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <errno.h>
+#include <unistd.h>
+#include <features.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+#ifdef __NR_create_module
+
+unsigned long create_module(const char *name, size_t size);
+
+#if defined(__UCLIBC_BROKEN_CREATE_MODULE__)
+# define __NR___create_module  __NR_create_module
+static __inline__ _syscall2(long, __create_module, const char *, name, size_t, size)
+/* By checking the value of errno, we know if we have been fooled
+ * by the syscall2 macro making a very high address look like a
+ * negative, so we we fix it up here.  */
+unsigned long create_module(const char *name, size_t size)
+{
+	long ret = __create_module(name, size);
+
+	/* Jump through hoops to fixup error return codes */
+	if (ret == -1 && errno > 125) {
+		ret = -errno;
+		__set_errno(0);
+	}
+	return ret;
+}
+#elif defined(__UCLIBC_SLIGHTLY_BROKEN_CREATE_MODULE__)
+# define __NR___create_module  __NR_create_module
+/* Alpha doesn't have the same problem, exactly, but a bug in older
+   kernels fails to clear the error flag.  Clear it here explicitly.  */
+static __inline__ _syscall4(unsigned long, __create_module, const char *, name,
+			size_t, size, size_t, dummy, size_t, err)
+unsigned long create_module(const char *name, size_t size)
+{
+	return __create_module(name, size, 0, 0);
+}
+#else
+/* Sparc, MIPS, etc don't mistake return values for errors. */
+_syscall2(unsigned long, create_module, const char *, name, size_t, size)
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/delete_module.c b/ap/build/uClibc/libc/sysdeps/linux/common/delete_module.c
new file mode 100644
index 0000000..8ac6e55
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/delete_module.c
@@ -0,0 +1,13 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * delete_module() for uClibc
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+int delete_module(const char *name, unsigned int flags);
+#ifdef __NR_delete_module
+_syscall2(int, delete_module, const char *, name, unsigned int, flags)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/dl-osinfo.h b/ap/build/uClibc/libc/sysdeps/linux/common/dl-osinfo.h
new file mode 100644
index 0000000..649d203
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/dl-osinfo.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#ifndef _DL_OSINFO_H
+#define _DL_OSINFO_H 1
+
+#include <features.h>
+
+#ifdef __UCLIBC_HAS_SSP__
+# if defined IS_IN_libc || defined IS_IN_rtld
+
+#  if defined __SSP__ || defined __SSP_ALL__
+#   error "file must not be compiled with stack protection enabled on it. Use -fno-stack-protector"
+#  endif
+
+#  include <stdint.h>
+#  include <sys/time.h>
+
+#  ifdef IS_IN_libc
+#include <fcntl.h>
+#   define OPEN open
+#   define READ read
+#   define CLOSE close
+#   define GETTIMEOFDAY gettimeofday
+#  else
+#   define OPEN _dl_open
+#   define READ _dl_read
+#   define CLOSE _dl_close
+#   define GETTIMEOFDAY _dl_gettimeofday
+#  endif
+
+static __always_inline uintptr_t _dl_setup_stack_chk_guard(void)
+{
+	uintptr_t ret;
+#  ifndef __SSP_QUICK_CANARY__
+	{
+		int fd = OPEN("/dev/urandom", O_RDONLY, 0);
+		if (fd >= 0) {
+			size_t size = READ(fd, &ret, sizeof(ret));
+			CLOSE(fd);
+			if (size == (size_t) sizeof(ret))
+				return ret;
+		}
+	}
+#  endif /* !__SSP_QUICK_CANARY__ */
+
+	/* Start with the "terminator canary". */
+	ret = 0xFF0A0D00UL;
+
+	/* Everything failed? Or we are using a weakened model of the
+	 * terminator canary */
+	{
+		struct timeval tv;
+		if (GETTIMEOFDAY(&tv, NULL) != (-1))
+			ret ^= tv.tv_usec ^ tv.tv_sec;
+	}
+	return ret;
+}
+# endif /* libc || rtld */
+#endif /* __UCLIBC_HAS_SSP__ */
+
+#endif /* _DL_OSINFO_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/dup.c b/ap/build/uClibc/libc/sysdeps/linux/common/dup.c
new file mode 100644
index 0000000..d351766
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/dup.c
@@ -0,0 +1,11 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * dup() for uClibc
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+_syscall1(int, dup, int, oldfd)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/dup2.c b/ap/build/uClibc/libc/sysdeps/linux/common/dup2.c
new file mode 100644
index 0000000..006f06b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/dup2.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * dup2() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+
+_syscall2(int, dup2, int, oldfd, int, newfd)
+libc_hidden_def(dup2)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/epoll.c b/ap/build/uClibc/libc/sysdeps/linux/common/epoll.c
new file mode 100644
index 0000000..ab3e73b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/epoll.c
@@ -0,0 +1,83 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * epoll_create() / epoll_ctl() / epoll_wait() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/epoll.h>
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+# include <sysdep-cancel.h>
+#else
+# define SINGLE_THREAD_P 1
+#endif
+
+/*
+ * epoll_create()
+ */
+#ifdef __NR_epoll_create
+_syscall1(int, epoll_create, int, size)
+#endif
+
+/*
+ * epoll_create1()
+ */
+#ifdef __NR_epoll_create1
+_syscall1(int, epoll_create1, int, flags)
+#endif
+
+/*
+ * epoll_ctl()
+ */
+#ifdef __NR_epoll_ctl
+_syscall4(int,epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event *, event)
+#endif
+
+/*
+ * epoll_wait()
+ */
+#ifdef __NR_epoll_wait
+extern __typeof(epoll_wait) __libc_epoll_wait;
+int __libc_epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout)
+{
+	if (SINGLE_THREAD_P)
+		return INLINE_SYSCALL(epoll_wait, 4, epfd, events, maxevents, timeout);
+# ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	else {
+		int oldtype = LIBC_CANCEL_ASYNC ();
+		int result = INLINE_SYSCALL(epoll_wait, 4, epfd, events, maxevents, timeout);
+		LIBC_CANCEL_RESET (oldtype);
+		return result;
+	}
+# endif
+}
+weak_alias(__libc_epoll_wait, epoll_wait)
+#endif
+
+/*
+ * epoll_pwait()
+ */
+#ifdef __NR_epoll_pwait
+# include <signal.h>
+
+extern __typeof(epoll_pwait) __libc_epoll_pwait;
+int __libc_epoll_pwait(int epfd, struct epoll_event *events, int maxevents,
+						int timeout, const sigset_t *set)
+{
+    int nsig = _NSIG / 8;
+	if (SINGLE_THREAD_P)
+		return INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents, timeout, set, nsig);
+# ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	else {
+		int oldtype = LIBC_CANCEL_ASYNC ();
+		int result = INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents, timeout, set, nsig);
+		LIBC_CANCEL_RESET (oldtype);
+		return result;
+	}
+# endif
+}
+weak_alias(__libc_epoll_pwait, epoll_pwait)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/eventfd.c b/ap/build/uClibc/libc/sysdeps/linux/common/eventfd.c
new file mode 100644
index 0000000..cc3f3f0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/eventfd.c
@@ -0,0 +1,18 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * eventfd() for uClibc
+ *
+ * Copyright (C) 2011 Jean-Christian de Rivaz <jc@eclis.ch>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/eventfd.h>
+
+/*
+ * eventfd()
+ */
+#ifdef __NR_eventfd
+_syscall2(int, eventfd, int, count, int, flags)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/execve.c b/ap/build/uClibc/libc/sysdeps/linux/common/execve.c
new file mode 100644
index 0000000..e8568df
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/execve.c
@@ -0,0 +1,17 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * execve() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/param.h>
+
+_syscall3(int, execve, const char *, filename,
+		  char *const *, argv, char *const *, envp)
+libc_hidden_def(execve)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/faccessat.c b/ap/build/uClibc/libc/sysdeps/linux/common/faccessat.c
new file mode 100644
index 0000000..09ca129
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/faccessat.c
@@ -0,0 +1,16 @@
+/*
+ * faccessat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_faccessat
+_syscall4(int, faccessat, int, fd, const char *, file, int, type, int, flag)
+#else
+/* should add emulation with faccess() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fchdir.c b/ap/build/uClibc/libc/sysdeps/linux/common/fchdir.c
new file mode 100644
index 0000000..4d54ef8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fchdir.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * fchdir() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+
+_syscall1(int, fchdir, int, fd)
+libc_hidden_def(fchdir)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fchmod.c b/ap/build/uClibc/libc/sysdeps/linux/common/fchmod.c
new file mode 100644
index 0000000..791f530
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fchmod.c
@@ -0,0 +1,20 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * fchmod() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/stat.h>
+
+#define __NR___syscall_fchmod __NR_fchmod
+static __inline__ _syscall2(int, __syscall_fchmod,
+		int, fildes, __kernel_mode_t, mode)
+
+int fchmod(int fildes, mode_t mode)
+{
+	return (__syscall_fchmod(fildes, mode));
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fchmodat.c b/ap/build/uClibc/libc/sysdeps/linux/common/fchmodat.c
new file mode 100644
index 0000000..8224a52
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fchmodat.c
@@ -0,0 +1,37 @@
+/*
+ * fchmodat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ * Copyright (C) 2012 Mike Frysinger
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <fcntl.h>
+#include <sys/syscall.h>
+#include <sys/stat.h>
+
+#ifdef __NR_fchmodat
+/*
+ * The kernel takes 3 args, but userland takes 4.
+ * We have to process all the flags ourselves.
+ */
+int fchmodat(int fd, const char *file, mode_t mode, int flag)
+{
+	/* We only support one flag atm ... */
+	if (flag & ~AT_SYMLINK_NOFOLLOW) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+
+	/* ... but Linux doesn't support perms on symlinks. */
+	if (flag & AT_SYMLINK_NOFOLLOW) {
+		__set_errno(ENOTSUP);
+		return -1;
+	}
+
+	return INLINE_SYSCALL(fchmodat, 3, fd, file, mode);
+}
+#else
+/* should add emulation with fchmod() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fchown.c b/ap/build/uClibc/libc/sysdeps/linux/common/fchown.c
new file mode 100644
index 0000000..61618dc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fchown.c
@@ -0,0 +1,38 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * fchown() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@codepoet.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <bits/wordsize.h>
+
+#if (__WORDSIZE == 32 && defined(__NR_fchown32)) || __WORDSIZE == 64
+# ifdef __NR_fchown32
+#  undef __NR_fchown
+#  define __NR_fchown __NR_fchown32
+# endif
+
+_syscall3(int, fchown, int, fd, uid_t, owner, gid_t, group)
+
+#else
+
+# define __NR___syscall_fchown __NR_fchown
+static __inline__ _syscall3(int, __syscall_fchown, int, fd,
+		__kernel_uid_t, owner, __kernel_gid_t, group)
+
+int fchown(int fd, uid_t owner, gid_t group)
+{
+	if (((owner + 1) > (uid_t) ((__kernel_uid_t) - 1U))
+		|| ((group + 1) > (gid_t) ((__kernel_gid_t) - 1U))) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return (__syscall_fchown(fd, owner, group));
+}
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fchownat.c b/ap/build/uClibc/libc/sysdeps/linux/common/fchownat.c
new file mode 100644
index 0000000..707164d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fchownat.c
@@ -0,0 +1,16 @@
+/*
+ * fchownat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_fchownat
+_syscall5(int, fchownat, int, fd, const char *, file, uid_t, owner, gid_t, group, int, flag)
+#else
+/* should add emulation with fchown() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fdatasync.c b/ap/build/uClibc/libc/sysdeps/linux/common/fdatasync.c
new file mode 100644
index 0000000..e51c723
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fdatasync.c
@@ -0,0 +1,43 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * fdatasync() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#if !defined __NR_fdatasync && defined __NR_osf_fdatasync
+# define __NR_fdatasync __NR_osf_fdatasync
+#endif
+
+#ifdef __NR_fdatasync
+
+# ifdef __UCLIBC_HAS_THREADS_NATIVE__
+# include <sysdep-cancel.h>
+# else
+# define SINGLE_THREAD_P 1
+# endif
+
+#define __NR___syscall_fdatasync __NR_fdatasync
+
+static __always_inline
+_syscall1(int, __syscall_fdatasync, int, fd)
+
+int fdatasync(int fd)
+{
+	if (SINGLE_THREAD_P)
+		return __syscall_fdatasync(fd);
+
+# ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype = LIBC_CANCEL_ASYNC ();
+	int result = __syscall_fdatasync(fd);
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+# endif
+}
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/flock.c b/ap/build/uClibc/libc/sysdeps/linux/common/flock.c
new file mode 100644
index 0000000..3dcd1ae
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/flock.c
@@ -0,0 +1,19 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * flock() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/file.h>
+
+#define __NR___syscall_flock __NR_flock
+static __inline__ _syscall2(int, __syscall_flock, int, fd, int, operation)
+
+int flock(int fd, int operation)
+{
+	return (__syscall_flock(fd, operation));
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fork.c b/ap/build/uClibc/libc/sysdeps/linux/common/fork.c
new file mode 100644
index 0000000..14e00a2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fork.c
@@ -0,0 +1,23 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * fork() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __ARCH_USE_MMU__
+
+#ifdef __NR_fork
+#define __NR___libc_fork __NR_fork
+extern __typeof(fork) __libc_fork;
+_syscall0(pid_t, __libc_fork)
+weak_alias(__libc_fork,fork)
+libc_hidden_weak(fork)
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fpu_control.h b/ap/build/uClibc/libc/sysdeps/linux/common/fpu_control.h
new file mode 100644
index 0000000..de261c2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fpu_control.h
@@ -0,0 +1,41 @@
+/* FPU control word definitions.  Stub version.
+   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _FPU_CONTROL_H
+#define _FPU_CONTROL_H
+
+#define _FPU_RESERVED 0xffffffff    /* These bits are reserved and not changed.  */
+
+/* The fdlibm code requires no interrupts for exceptions.  Don't
+   change the rounding mode, it would break long double I/O!  */
+#define _FPU_DEFAULT  0x00000000 /* Default value.  */
+
+/* Type of the control word.  */
+typedef unsigned int fpu_control_t;
+
+/* Macros for accessing the hardware control word.  */
+#define _FPU_GETCW(cw) 0
+#define _FPU_SETCW(cw) do { } while (0)
+
+#if 0
+/* Default control word set at startup.  */
+extern fpu_control_t __fpu_control;
+#endif
+
+#endif /* _FPU_CONTROL_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fstat.c b/ap/build/uClibc/libc/sysdeps/linux/common/fstat.c
new file mode 100644
index 0000000..4726a68
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fstat.c
@@ -0,0 +1,44 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * fstat() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include "xstatconv.h"
+
+int fstat(int fd, struct stat *buf)
+{
+	int result;
+#ifdef __NR_fstat64
+	/* normal stat call has limited values for various stat elements
+	 * e.g. uid device major/minor etc.
+	 * so we use 64 variant if available
+	 * in order to get newer versions of stat elements
+	 */
+	struct kernel_stat64 kbuf;
+	result = INLINE_SYSCALL(fstat64, 2, fd, &kbuf);
+	if (result == 0) {
+		__xstat32_conv(&kbuf, buf);
+	}
+#else
+	struct kernel_stat kbuf;
+
+	result = INLINE_SYSCALL(fstat, 2, fd, &kbuf);
+	if (result == 0) {
+		__xstat_conv(&kbuf, buf);
+	}
+#endif
+	return result;
+}
+libc_hidden_def(fstat)
+
+#if ! defined __NR_fstat64 && defined __UCLIBC_HAS_LFS__
+strong_alias_untyped(fstat,fstat64)
+libc_hidden_def(fstat64)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fstat64.c b/ap/build/uClibc/libc/sysdeps/linux/common/fstat64.c
new file mode 100644
index 0000000..6061343
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fstat64.c
@@ -0,0 +1,34 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * fstat64() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+#if defined __UCLIBC_HAS_LFS__ && defined __NR_fstat64
+#include <unistd.h>
+#include <sys/stat.h>
+#include "xstatconv.h"
+
+
+#define __NR___syscall_fstat64 __NR_fstat64
+static __inline__ _syscall2(int, __syscall_fstat64,
+		int, filedes, struct kernel_stat64 *, buf)
+
+int fstat64(int fd, struct stat64 *buf)
+{
+	int result;
+	struct kernel_stat64 kbuf;
+
+	result = __syscall_fstat64(fd, &kbuf);
+	if (result == 0) {
+		__xstat64_conv(&kbuf, buf);
+	}
+	return result;
+}
+libc_hidden_def(fstat64)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fstatat.c b/ap/build/uClibc/libc/sysdeps/linux/common/fstatat.c
new file mode 100644
index 0000000..33daa7c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fstatat.c
@@ -0,0 +1,32 @@
+/*
+ * fstatat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/stat.h>
+#include "xstatconv.h"
+
+/* 64bit ports tend to favor newfstatat() */
+#ifdef __NR_newfstatat
+# define __NR_fstatat64 __NR_newfstatat
+#endif
+
+#ifdef __NR_fstatat64
+int fstatat(int fd, const char *file, struct stat *buf, int flag)
+{
+	int ret;
+	struct kernel_stat64 kbuf;
+
+	ret = INLINE_SYSCALL(fstatat64, 4, fd, file, &kbuf, flag);
+	if (ret == 0)
+		__xstat32_conv(&kbuf, buf);
+
+	return ret;
+}
+#else
+/* should add emulation with fstat() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fstatat64.c b/ap/build/uClibc/libc/sysdeps/linux/common/fstatat64.c
new file mode 100644
index 0000000..95627af
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fstatat64.c
@@ -0,0 +1,36 @@
+/*
+ * fstatat64() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/stat.h>
+#include "xstatconv.h"
+
+#ifdef __UCLIBC_HAS_LFS__
+
+/* 64bit ports tend to favor newfstatat() */
+#ifdef __NR_newfstatat
+# define __NR_fstatat64 __NR_newfstatat
+#endif
+
+#ifdef __NR_fstatat64
+int fstatat64(int fd, const char *file, struct stat64 *buf, int flag)
+{
+	int ret;
+	struct kernel_stat64 kbuf;
+
+	ret = INLINE_SYSCALL(fstatat64, 4, fd, file, &kbuf, flag);
+	if (ret == 0)
+		__xstat64_conv(&kbuf, buf);
+
+	return ret;
+}
+#else
+/* should add emulation with fstat64() and /proc/self/fd/ ... */
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fstatfs.c b/ap/build/uClibc/libc/sysdeps/linux/common/fstatfs.c
new file mode 100644
index 0000000..fa0024a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fstatfs.c
@@ -0,0 +1,31 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * fstatfs() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/vfs.h>
+
+#ifndef __USE_FILE_OFFSET64
+extern int fstatfs (int __fildes, struct statfs *__buf)
+     __THROW __nonnull ((2));
+#else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (fstatfs, (int __fildes, struct statfs *__buf),
+	fstatfs64) __nonnull ((2));
+# else
+#  define fstatfs fstatfs64
+# endif
+#endif
+
+extern __typeof(fstatfs) __libc_fstatfs attribute_hidden;
+#define __NR___libc_fstatfs __NR_fstatfs
+_syscall2(int, __libc_fstatfs, int, fd, struct statfs *, buf)
+
+#if defined __UCLIBC_LINUX_SPECIFIC__
+weak_alias(__libc_fstatfs,fstatfs)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/fsync.c b/ap/build/uClibc/libc/sysdeps/linux/common/fsync.c
new file mode 100644
index 0000000..711811f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/fsync.c
@@ -0,0 +1,37 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * fsync() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include "sysdep-cancel.h"
+#else
+#define SINGLE_THREAD_P 1
+#endif
+
+#define __NR___syscall_fsync __NR_fsync
+static inline _syscall1(int, __syscall_fsync, int, fd)
+
+extern __typeof(fsync) __libc_fsync;
+
+int __libc_fsync(int fd)
+{
+	if (SINGLE_THREAD_P)
+		return __syscall_fsync(fd);
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype = LIBC_CANCEL_ASYNC ();
+	int result = __syscall_fsync(fd);
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+#endif
+}
+
+weak_alias(__libc_fsync, fsync)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/ftruncate.c b/ap/build/uClibc/libc/sysdeps/linux/common/ftruncate.c
new file mode 100644
index 0000000..3bdef3f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/ftruncate.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * ftruncate() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+
+_syscall2(int, ftruncate, int, fd, __off_t, length)
+libc_hidden_def(ftruncate)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/ftruncate64.c b/ap/build/uClibc/libc/sysdeps/linux/common/ftruncate64.c
new file mode 100644
index 0000000..c5a6160
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/ftruncate64.c
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ *
+ * ftruncate64 syscall.  Copes with 64 bit and 32 bit machines
+ * and on 32 bit machines this sends things into the kernel as
+ * two 32-bit arguments (high and low 32 bits of length) that
+ * are ordered based on endianess.  It turns out endian.h has
+ * just the macro we need to order things, __LONG_LONG_PAIR.
+ */
+
+#include <features.h>
+
+#ifdef __UCLIBC_HAS_LFS__
+
+# include <unistd.h>
+# include <errno.h>
+# include <endian.h>
+# include <stdint.h>
+# include <sys/types.h>
+# include <sys/syscall.h>
+
+
+# ifdef __NR_ftruncate64
+
+#  if __WORDSIZE == 64
+
+/* For a 64 bit machine, life is simple... */
+_syscall2(int, ftruncate64, int, fd, __off64_t, length)
+
+#  elif __WORDSIZE == 32
+
+/* The exported ftruncate64 function.  */
+int ftruncate64 (int fd, __off64_t length)
+{
+    uint32_t low = length & 0xffffffff;
+    uint32_t high = length >> 32;
+#   if defined(__UCLIBC_TRUNCATE64_HAS_4_ARGS__)
+    return INLINE_SYSCALL(ftruncate64,
+	    4, fd, 0, __LONG_LONG_PAIR (high, low));
+#   else
+    return INLINE_SYSCALL(ftruncate64, 3, fd,
+	    __LONG_LONG_PAIR (high, low));
+#   endif
+}
+
+#  else /* __WORDSIZE */
+#   error Your machine is not 64 bit or 32 bit, I am dazed and confused.
+#  endif /* __WORDSIZE */
+
+# else  /* __NR_ftruncate64 */
+
+
+int ftruncate64 (int fd, __off64_t length)
+{
+	__off_t x = (__off_t) length;
+
+	if (x == length) {
+		return ftruncate(fd, x);
+	}
+
+	__set_errno((x < 0) ? EINVAL : EFBIG);
+
+	return -1;
+}
+
+# endif /* __NR_ftruncate64 */
+libc_hidden_def(ftruncate64)
+
+#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/futimens.c b/ap/build/uClibc/libc/sysdeps/linux/common/futimens.c
new file mode 100644
index 0000000..0eaf26a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/futimens.c
@@ -0,0 +1,29 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * futimens() implementation for uClibc
+ *
+ * Copyright (C) 2009 Bernhard Reutner-Fischer <uclibc@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <time.h>
+#ifdef __NR_utimensat
+/* To avoid superfluous warnings about passing NULL to the non-null annotated
+ * 2nd param "__path" below, we bypass inclusion of sys/stat.h and use
+ * a non annotated, local decl.
+ * Note that due to not including the header, we have to alias the call
+ * manually.
+ */
+extern int utimensat (int __fd, __const char *__path,
+	__const struct timespec __times[2],
+	int __flags) __THROW;
+libc_hidden_proto(utimensat)
+
+int futimens (int __fd, __const struct timespec __times[2]) __THROW;
+int futimens (int fd, __const struct timespec ts[2])
+{
+	return utimensat(fd, 0, ts, 0);
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/futimesat.c b/ap/build/uClibc/libc/sysdeps/linux/common/futimesat.c
new file mode 100644
index 0000000..bd73eae
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/futimesat.c
@@ -0,0 +1,16 @@
+/*
+ * futimesat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/time.h>
+
+#ifdef __NR_futimesat
+_syscall3(int, futimesat, int, fd, const char *, file, const struct timeval *, tvp)
+#else
+/* should add emulation with futimes() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/get_kernel_syms.c b/ap/build/uClibc/libc/sysdeps/linux/common/get_kernel_syms.c
new file mode 100644
index 0000000..6124a81
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/get_kernel_syms.c
@@ -0,0 +1,16 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * get_kernel_syms() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+struct kernel_sym;
+int get_kernel_syms(struct kernel_sym *table attribute_unused);
+#ifdef __NR_get_kernel_syms
+_syscall1(int, get_kernel_syms, struct kernel_sym *, table)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getcwd.c b/ap/build/uClibc/libc/sysdeps/linux/common/getcwd.c
new file mode 100644
index 0000000..8751001
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getcwd.c
@@ -0,0 +1,199 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+/* These functions find the absolute path to the current working directory.  */
+
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <dirent.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <sys/syscall.h>
+
+
+
+#ifdef __NR_getcwd
+
+# define __NR___syscall_getcwd __NR_getcwd
+static __always_inline
+_syscall2(int, __syscall_getcwd, char *, buf, unsigned long, size)
+
+#else
+
+/* If the syscall is not present, we have to walk up the
+ * directory tree till we hit the root.  Now we _could_
+ * use /proc/self/cwd if /proc is mounted... That approach
+ * is left an an exercise for the reader... */
+
+
+/* Seems a few broken filesystems (like coda) don't like this */
+/* #undef FAST_DIR_SEARCH_POSSIBLE on Linux */
+
+
+/* Routine to find the step back down */
+static char *search_dir(dev_t this_dev, ino_t this_ino, char *path_buf, int path_size)
+{
+	DIR *dp;
+	struct dirent *d;
+	char *ptr;
+	int slen;
+	struct stat st;
+
+# ifdef FAST_DIR_SEARCH_POSSIBLE
+	/* The test is for ELKS lib 0.0.9, this should be fixed in the real kernel */
+	int slow_search = (sizeof(ino_t) != sizeof(d->d_ino));
+# endif
+
+	if (stat(path_buf, &st) < 0) {
+		goto oops;
+	}
+# ifdef FAST_DIR_SEARCH_POSSIBLE
+	if (this_dev != st.st_dev)
+		slow_search = 1;
+# endif
+
+	slen = strlen(path_buf);
+	ptr = path_buf + slen - 1;
+	if (*ptr != '/') {
+		if (slen + 2 > path_size) {
+			goto oops;
+		}
+		strcpy(++ptr, "/");
+		slen++;
+	}
+	slen++;
+
+	dp = opendir(path_buf);
+	if (!dp) {
+	    goto oops;
+	}
+
+	while ((d = readdir(dp)) != 0) {
+# ifdef FAST_DIR_SEARCH_POSSIBLE
+		if (slow_search || this_ino == d->d_ino) {
+# endif
+			if (slen + strlen(d->d_name) > path_size) {
+			    closedir(dp);
+			    goto oops;
+			}
+			strcpy(ptr + 1, d->d_name);
+			if (stat(path_buf, &st) < 0)
+				continue;
+			if (st.st_ino == this_ino && st.st_dev == this_dev) {
+				closedir(dp);
+				return path_buf;
+			}
+# ifdef FAST_DIR_SEARCH_POSSIBLE
+		}
+# endif
+	}
+
+	closedir(dp);
+	return 0;
+
+oops:
+	__set_errno(ERANGE);
+	return 0;
+}
+
+/* Routine to go up tree */
+static char *recurser(char *path_buf, int path_size, dev_t root_dev, ino_t root_ino)
+{
+	struct stat st;
+	dev_t this_dev;
+	ino_t this_ino;
+
+	if (stat(path_buf, &st) < 0) {
+	    if (errno != EFAULT)
+		goto oops;
+	    return 0;
+	}
+	this_dev = st.st_dev;
+	this_ino = st.st_ino;
+	if (this_dev == root_dev && this_ino == root_ino) {
+		if (path_size < 2) {
+		    goto oops;
+		}
+		strcpy(path_buf, "/");
+		return path_buf;
+	}
+	if (strlen(path_buf) + 4 > path_size) {
+	    goto oops;
+	}
+	strcat(path_buf, "/..");
+	if (recurser(path_buf, path_size, root_dev, root_ino) == 0)
+		return 0;
+
+	return search_dir(this_dev, this_ino, path_buf, path_size);
+oops:
+	__set_errno(ERANGE);
+	return 0;
+}
+
+static __always_inline
+int __syscall_getcwd(char * buf, unsigned long size)
+{
+    int len;
+    char *cwd;
+    struct stat st;
+    int olderrno;
+
+    olderrno = errno;
+    len = -1;
+
+    /* get stat for root to have a valid parameters for the terminating condition */
+    if (stat("/", &st) < 0) {
+	/* root dir not found! */
+	return -1;
+    }
+    /* start with actual dir */
+    if (buf) strncpy(buf, ".", size);
+
+    cwd = recurser(buf, size, st.st_dev, st.st_ino);
+    if (cwd) {
+	len = strlen(buf) + 1;
+	__set_errno(olderrno);
+    }
+    return len;
+}
+
+#endif /* __NR_getcwd */
+
+char *getcwd(char *buf, size_t size)
+{
+    int ret;
+    char *path;
+    size_t alloc_size = size;
+
+    if (size == 0) {
+	if (buf != NULL) {
+	    __set_errno(EINVAL);
+	    return NULL;
+	}
+	alloc_size = MAX (PATH_MAX, getpagesize ());
+    }
+    path=buf;
+    if (buf == NULL) {
+	path = malloc(alloc_size);
+	if (path == NULL)
+	    return NULL;
+    }
+    ret = __syscall_getcwd(path, alloc_size);
+    if (ret >= 0)
+    {
+	if (buf == NULL && size == 0)
+	    buf = realloc(path, ret);
+	if (buf == NULL)
+	    buf = path;
+	return buf;
+    }
+    if (buf == NULL)
+	free (path);
+    return NULL;
+}
+libc_hidden_def(getcwd)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getdents.c b/ap/build/uClibc/libc/sysdeps/linux/common/getdents.c
new file mode 100644
index 0000000..46f7b8e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getdents.c
@@ -0,0 +1,174 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <assert.h>
+#include <errno.h>
+#include <dirent.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <bits/kernel_types.h>
+#include <bits/kernel-features.h>
+#include <bits/uClibc_alloc.h>
+
+#if !(defined __UCLIBC_HAS_LFS__ && defined __NR_getdents64 && __WORDSIZE == 64)
+/* If the condition above is met, __getdents is defined as an alias
+ * for __getdents64 (see getdents64.c). Otherwise...
+ */
+
+/* With newer versions of linux, the getdents syscall returns d_type
+ * information after the name field.
+ *
+ * See __ASSUME_GETDENTS32_D_TYPE in glibc's kernel-features.h for specific
+ * version / arch details.
+ */
+
+#ifndef offsetof
+# define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+
+struct kernel_dirent
+{
+	long int d_ino;
+	__kernel_off_t d_off;
+	unsigned short int d_reclen;
+	char d_name[256];
+};
+
+ssize_t __getdents (int fd, char *buf, size_t nbytes) attribute_hidden;
+
+#define __NR___syscall_getdents __NR_getdents
+static __always_inline _syscall3(int, __syscall_getdents, int, fd, unsigned char *, kdirp, size_t, count)
+
+#if defined __ASSUME_GETDENTS32_D_TYPE
+
+ssize_t __getdents (int fd, char *buf, size_t nbytes)
+{
+	ssize_t retval;
+
+	retval = __syscall_getdents(fd, (unsigned char *)buf, nbytes);
+
+	/* The kernel added the d_type value after the name.  Change
+	this now.  */
+	if (retval != -1) {
+		union {
+			struct kernel_dirent k;
+			struct dirent u;
+		} *kbuf = (void *) buf;
+
+		while ((char *) kbuf < buf + retval) {
+			char d_type = *((char *) kbuf + kbuf->k.d_reclen - 1);
+			memmove (kbuf->u.d_name, kbuf->k.d_name,
+			strlen (kbuf->k.d_name) + 1);
+			kbuf->u.d_type = d_type;
+
+			kbuf = (void *) ((char *) kbuf + kbuf->k.d_reclen);
+		}
+	}
+
+	return retval;
+}
+
+#elif ! defined __UCLIBC_HAS_LFS__ || ! defined __NR_getdents64
+
+ssize_t __getdents (int fd, char *buf, size_t nbytes)
+{
+    struct dirent *dp;
+    off_t last_offset = -1;
+    ssize_t retval;
+    size_t red_nbytes;
+    struct kernel_dirent *skdp, *kdp;
+    const size_t size_diff = (offsetof (struct dirent, d_name)
+	    - offsetof (struct kernel_dirent, d_name));
+
+    red_nbytes = MIN (nbytes - ((nbytes /
+		    (offsetof (struct dirent, d_name) + 14)) * size_diff),
+	    nbytes - size_diff);
+
+    dp = (struct dirent *) buf;
+    skdp = kdp = stack_heap_alloc(red_nbytes);
+
+    retval = __syscall_getdents(fd, (unsigned char *)kdp, red_nbytes);
+    if (retval == -1) {
+	stack_heap_free(skdp);
+	return -1;
+    }
+
+    while ((char *) kdp < (char *) skdp + retval) {
+	const size_t alignment = __alignof__ (struct dirent);
+	/* Since kdp->d_reclen is already aligned for the kernel structure
+	   this may compute a value that is bigger than necessary.  */
+	size_t new_reclen = ((kdp->d_reclen + size_diff + alignment - 1)
+		& ~(alignment - 1));
+	if ((char *) dp + new_reclen > buf + nbytes) {
+	    /* Our heuristic failed.  We read too many entries.  Reset
+	       the stream.  */
+	    assert (last_offset != -1);
+	    lseek(fd, last_offset, SEEK_SET);
+
+	    if ((char *) dp == buf) {
+		/* The buffer the user passed in is too small to hold even
+		   one entry.  */
+		stack_heap_free(skdp);
+		__set_errno (EINVAL);
+		return -1;
+	    }
+	    break;
+	}
+
+	last_offset = kdp->d_off;
+	dp->d_ino = kdp->d_ino;
+	dp->d_off = kdp->d_off;
+	dp->d_reclen = new_reclen;
+	dp->d_type = DT_UNKNOWN;
+	memcpy (dp->d_name, kdp->d_name,
+		kdp->d_reclen - offsetof (struct kernel_dirent, d_name));
+	dp = (struct dirent *) ((char *) dp + new_reclen);
+	kdp = (struct kernel_dirent *) (((char *) kdp) + kdp->d_reclen);
+    }
+    stack_heap_free(skdp);
+    return (char *) dp - buf;
+}
+
+#elif __WORDSIZE == 32
+
+extern __typeof(__getdents) __getdents64 attribute_hidden;
+ssize_t __getdents (int fd, char *buf, size_t nbytes)
+{
+    struct dirent *dp;
+    struct dirent64 *dp64;
+    ssize_t ret = __getdents64 (fd, buf, nbytes);
+
+    if (ret <= 0)
+	return ret;
+
+    dp64 = (struct dirent64 *) buf;
+    buf += ret;
+    while ((void *) dp64 < (void *) buf) {
+	dp = (struct dirent *) dp64;
+	dp->d_ino = dp64->d_ino;
+	dp->d_off = dp64->d_off;
+	dp->d_reclen = dp64->d_reclen;
+	dp->d_type = dp64->d_type;
+	memmove (dp->d_name, dp64->d_name, dp->d_reclen - offsetof (struct dirent64, d_name));
+	memmove (dp64, dp, dp->d_reclen);
+	dp64 = ((void *) dp64) + dp->d_reclen;
+    }
+
+    return ret;
+}
+
+#endif
+
+#if defined __UCLIBC_HAS_LFS__ && ! defined __NR_getdents64
+attribute_hidden strong_alias(__getdents,__getdents64)
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getdents64.c b/ap/build/uClibc/libc/sysdeps/linux/common/getdents64.c
new file mode 100644
index 0000000..30686f2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getdents64.c
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <features.h>
+#include <assert.h>
+#include <errno.h>
+#include <dirent.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <bits/kernel_types.h>
+#include <bits/uClibc_alloc.h>
+
+#if defined __UCLIBC_HAS_LFS__ && defined __NR_getdents64
+
+# ifndef offsetof
+#  define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+# endif
+
+struct kernel_dirent64
+{
+    uint64_t		d_ino;
+    int64_t		d_off;
+    unsigned short	d_reclen;
+    unsigned char	d_type;
+    char		d_name[256];
+};
+
+# define __NR___syscall_getdents64 __NR_getdents64
+static __inline__ _syscall3(int, __syscall_getdents64, int, fd, unsigned char *, dirp, size_t, count)
+
+ssize_t __getdents64 (int fd, char *buf, size_t nbytes) attribute_hidden;
+ssize_t __getdents64 (int fd, char *buf, size_t nbytes)
+{
+    struct dirent64 *dp;
+    off64_t last_offset = -1;
+    ssize_t retval;
+    size_t red_nbytes;
+    struct kernel_dirent64 *skdp, *kdp;
+    const size_t size_diff = (offsetof (struct dirent64, d_name)
+	    - offsetof (struct kernel_dirent64, d_name));
+
+    red_nbytes = MIN (nbytes - ((nbytes /
+		    (offsetof (struct dirent64, d_name) + 14)) * size_diff),
+	    nbytes - size_diff);
+
+    dp = (struct dirent64 *) buf;
+    skdp = kdp = stack_heap_alloc(red_nbytes);
+
+    retval = __syscall_getdents64(fd, (unsigned char *)kdp, red_nbytes);
+    if (retval == -1) {
+	stack_heap_free(skdp);
+	return -1;
+    }
+
+    while ((char *) kdp < (char *) skdp + retval) {
+	const size_t alignment = __alignof__ (struct dirent64);
+	/* Since kdp->d_reclen is already aligned for the kernel structure
+	   this may compute a value that is bigger than necessary.  */
+	size_t new_reclen = ((kdp->d_reclen + size_diff + alignment - 1)
+		& ~(alignment - 1));
+	if ((char *) dp + new_reclen > buf + nbytes) {
+	    /* Our heuristic failed.  We read too many entries.  Reset
+	       the stream.  */
+	    assert (last_offset != -1);
+	    lseek64(fd, last_offset, SEEK_SET);
+
+	    if ((char *) dp == buf) {
+		/* The buffer the user passed in is too small to hold even
+		   one entry.  */
+		stack_heap_free(skdp);
+		__set_errno (EINVAL);
+		return -1;
+	    }
+	    break;
+	}
+
+	last_offset = kdp->d_off;
+	dp->d_ino = kdp->d_ino;
+	dp->d_off = kdp->d_off;
+	dp->d_reclen = new_reclen;
+	dp->d_type = kdp->d_type;
+	memcpy (dp->d_name, kdp->d_name,
+		kdp->d_reclen - offsetof (struct kernel_dirent64, d_name));
+	dp = (struct dirent64 *) ((char *) dp + new_reclen);
+	kdp = (struct kernel_dirent64 *) (((char *) kdp) + kdp->d_reclen);
+    }
+    stack_heap_free(skdp);
+    return (char *) dp - buf;
+}
+
+#if __WORDSIZE == 64
+/* since getdents doesnt give us d_type but getdents64 does, try and
+ * use getdents64 as much as possible */
+attribute_hidden strong_alias(__getdents64,__getdents)
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getdirname.c b/ap/build/uClibc/libc/sysdeps/linux/common/getdirname.c
new file mode 100644
index 0000000..c02f66b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getdirname.c
@@ -0,0 +1,58 @@
+/* vi: set sw=4 ts=4: */
+/* Copyright (C) 1992, 1997, 1998, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <features.h>
+
+#ifdef __USE_GNU
+#include <unistd.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* Return a malloc'd string containing the current directory name.
+   If the environment variable `PWD' is set, and its value is correct,
+   that value is used.  */
+
+char *
+get_current_dir_name (void)
+{
+	char *pwd;
+#ifdef __UCLIBC_HAS_LFS__
+	struct stat64 dotstat, pwdstat;
+#else
+	struct stat dotstat, pwdstat;
+#endif
+
+	pwd = getenv ("PWD");
+	if (pwd != NULL
+#ifdef __UCLIBC_HAS_LFS__
+		&& stat64 (".", &dotstat) == 0
+		&& stat64 (pwd, &pwdstat) == 0
+#else
+		&& stat (".", &dotstat) == 0
+		&& stat (pwd, &pwdstat) == 0
+#endif
+		&& pwdstat.st_dev == dotstat.st_dev
+		&& pwdstat.st_ino == dotstat.st_ino)
+		/* The PWD value is correct.  Use it.  */
+		return strdup (pwd);
+
+	return getcwd ((char *) NULL, 0);
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getdomainname.c b/ap/build/uClibc/libc/sysdeps/linux/common/getdomainname.c
new file mode 100644
index 0000000..8590283
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getdomainname.c
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <features.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sys/utsname.h>
+
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
+
+int
+#ifndef __UCLIBC_BSD_SPECIFIC__
+attribute_hidden
+#endif
+getdomainname(char *name, size_t len)
+{
+  struct utsname uts;
+
+  if (name == NULL) {
+    __set_errno(EINVAL);
+    return -1;
+  }
+
+  if (uname(&uts) == -1) return -1;
+
+#ifdef __USE_GNU
+  if (strlen(uts.domainname)+1 > len) {
+#else
+  if (strlen(uts.__domainname)+1 > len) {
+#endif
+    __set_errno(EINVAL);
+    return -1;
+  }
+#ifdef __USE_GNU
+  strcpy(name, uts.domainname);
+#else
+  strcpy(name, uts.__domainname);
+#endif
+  return 0;
+}
+# ifdef __UCLIBC_BSD_SPECIFIC__
+libc_hidden_def(getdomainname)
+# endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getdtablesize.c b/ap/build/uClibc/libc/sysdeps/linux/common/getdtablesize.c
new file mode 100644
index 0000000..7dd3a54
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getdtablesize.c
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/resource.h>
+#include <limits.h>
+
+/* XXX: _BSD || _XOPEN_SOURCE >= 500 */
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+
+
+#define __LOCAL_OPEN_MAX	    256
+
+/* Return the maximum number of file descriptors
+   the current process could possibly have.  */
+int getdtablesize (void)
+{
+  struct rlimit ru;
+
+  /* This should even work if `getrlimit' is not implemented.  POSIX.1
+     does not define this function but we will generate a stub which
+     returns -1.  */
+  return getrlimit (RLIMIT_NOFILE, &ru) < 0 ? __LOCAL_OPEN_MAX : ru.rlim_cur;
+}
+libc_hidden_def(getdtablesize)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getegid.c b/ap/build/uClibc/libc/sysdeps/linux/common/getegid.c
new file mode 100644
index 0000000..80a8ac9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getegid.c
@@ -0,0 +1,21 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getegid() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_getegid32
+# undef __NR_getegid
+# define __NR_getegid __NR_getegid32
+#endif
+
+#ifdef __NR_getegid
+_syscall_noerr0(gid_t, getegid)
+libc_hidden_def(getegid)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/geteuid.c b/ap/build/uClibc/libc/sysdeps/linux/common/geteuid.c
new file mode 100644
index 0000000..610fbc1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/geteuid.c
@@ -0,0 +1,21 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * geteuid() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_geteuid32
+# undef __NR_geteuid
+# define __NR_geteuid __NR_geteuid32
+#endif
+
+#ifdef __NR_geteuid
+_syscall_noerr0(uid_t, geteuid)
+libc_hidden_def(geteuid)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getgid.c b/ap/build/uClibc/libc/sysdeps/linux/common/getgid.c
new file mode 100644
index 0000000..ccfbfc0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getgid.c
@@ -0,0 +1,27 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getgid() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_getxgid
+# undef __NR_getgid
+# define __NR_getgid __NR_getxgid
+#endif
+#ifdef __NR_getgid32
+# undef __NR_getgid
+# define __NR_getgid __NR_getgid32
+#endif
+
+_syscall_noerr0(gid_t, getgid)
+libc_hidden_def(getgid)
+#if !defined __NR_getegid32 && !defined __NR_getegid
+strong_alias(getgid,getegid)
+libc_hidden_def(getegid)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getgroups.c b/ap/build/uClibc/libc/sysdeps/linux/common/getgroups.c
new file mode 100644
index 0000000..ddc2cae
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getgroups.c
@@ -0,0 +1,60 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getgroups() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <grp.h>
+
+
+#if defined(__NR_getgroups32)
+# undef __NR_getgroups
+# define __NR_getgroups __NR_getgroups32
+_syscall2(int, getgroups, int, size, gid_t *, list)
+
+#elif __WORDSIZE == 64
+_syscall2(int, getgroups, int, size, gid_t *, list)
+
+#else
+
+#define MIN(a,b) (((a)<(b))?(a):(b))
+
+#define __NR___syscall_getgroups __NR_getgroups
+static __inline__ _syscall2(int, __syscall_getgroups,
+		int, size, __kernel_gid_t *, list)
+
+int getgroups(int size, gid_t groups[])
+{
+	if (unlikely(size < 0)) {
+ret_error:
+		__set_errno(EINVAL);
+		return -1;
+	} else {
+		int i, ngids;
+		__kernel_gid_t *kernel_groups;
+
+		size = MIN(size, sysconf(_SC_NGROUPS_MAX));
+		kernel_groups = (__kernel_gid_t *)malloc(sizeof(*kernel_groups) * size);
+		if (size && kernel_groups == NULL)
+			goto ret_error;
+
+		ngids = __syscall_getgroups(size, kernel_groups);
+		if (size != 0 && ngids > 0) {
+			for (i = 0; i < ngids; i++) {
+				groups[i] = kernel_groups[i];
+			}
+		}
+
+		free(kernel_groups);
+		return ngids;
+	}
+}
+#endif
+
+libc_hidden_def(getgroups)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/gethostname.c b/ap/build/uClibc/libc/sysdeps/linux/common/gethostname.c
new file mode 100644
index 0000000..3b59e56
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/gethostname.c
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <string.h>
+#include <unistd.h>
+#include <sys/utsname.h>
+#include <errno.h>
+
+
+
+int
+gethostname(char *name, size_t len)
+{
+  struct utsname uts;
+
+  if (name == NULL) {
+    __set_errno(EINVAL);
+    return -1;
+  }
+
+  if (uname(&uts) == -1) return -1;
+
+  if (strlen(uts.nodename)+1 > len) {
+    __set_errno(EINVAL);
+    return -1;
+  }
+  strcpy(name, uts.nodename);
+  return 0;
+}
+libc_hidden_def(gethostname)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getitimer.c b/ap/build/uClibc/libc/sysdeps/linux/common/getitimer.c
new file mode 100644
index 0000000..b324233
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getitimer.c
@@ -0,0 +1,12 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getitimer() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/time.h>
+_syscall2(int, getitimer, __itimer_which_t, which, struct itimerval *, value)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getpagesize.c b/ap/build/uClibc/libc/sysdeps/linux/common/getpagesize.c
new file mode 100644
index 0000000..1faa548
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getpagesize.c
@@ -0,0 +1,47 @@
+/* Copyright (C) 1991,1992,1995-1997,2000,2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <unistd.h>
+#include <features.h>
+#include <sys/param.h>
+
+extern size_t __pagesize;
+
+/* Return the system page size.  */
+/* couldn't make __getpagesize hidden, because shm.h uses it in a macro */
+extern __typeof(getpagesize) __getpagesize;
+int __getpagesize(void)
+{
+  if (__pagesize != 0)
+    return __pagesize;
+
+#ifdef	EXEC_PAGESIZE
+  return EXEC_PAGESIZE;
+#else	/* No EXEC_PAGESIZE.  */
+#ifdef	NBPG
+#ifndef	CLSIZE
+#define	CLSIZE	1
+#endif	/* No CLSIZE.  */
+  return NBPG * CLSIZE;
+#else	/* No NBPG.  */
+  return NBPC;
+#endif	/* NBPG.  */
+#endif	/* EXEC_PAGESIZE.  */
+}
+strong_alias(__getpagesize,getpagesize)
+libc_hidden_def(getpagesize)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getpgid.c b/ap/build/uClibc/libc/sysdeps/linux/common/getpgid.c
new file mode 100644
index 0000000..8e7516f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getpgid.c
@@ -0,0 +1,25 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getpgid() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+#if defined __USE_UNIX98
+#include <unistd.h>
+
+#define __NR___syscall_getpgid __NR_getpgid
+static __inline__ _syscall1(__kernel_pid_t, __syscall_getpgid, __kernel_pid_t, pid)
+
+pid_t __getpgid(pid_t pid)
+{
+	return (__syscall_getpgid(pid));
+}
+#ifdef __USE_XOPEN_EXTENDED
+weak_alias(__getpgid,getpgid)
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getpgrp.c b/ap/build/uClibc/libc/sysdeps/linux/common/getpgrp.c
new file mode 100644
index 0000000..14912c3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getpgrp.c
@@ -0,0 +1,21 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getpgrp() for uClibc
+ *
+ * Copyright (C) 2000-2008 by Erik Andersen <andersen@codepoet.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_getpgrp
+/* According to the manpage the POSIX.1 version is favoured */
+_syscall_noerr0(pid_t, getpgrp)
+#elif defined __NR_getpgid
+pid_t getpgrp(void)
+{
+	return getpgid(0);
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getpid.c b/ap/build/uClibc/libc/sysdeps/linux/common/getpid.c
new file mode 100644
index 0000000..d9a6908
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getpid.c
@@ -0,0 +1,22 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getpid() for uClibc
+ *
+ * Copyright (C) 2000-2006 by Erik Andersen <andersen@codepoet.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_getxpid
+# undef __NR_getpid
+# define __NR_getpid __NR_getxpid
+#endif
+
+_syscall_noerr0(pid_t, getpid)
+libc_hidden_weak(getpid)
+#ifndef __NR_getppid
+strong_alias(getpid,getppid)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getppid.c b/ap/build/uClibc/libc/sysdeps/linux/common/getppid.c
new file mode 100644
index 0000000..9d85661
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getppid.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getppid() for uClibc
+ *
+ * Copyright (C) 2000-2006 by Erik Andersen <andersen@codepoet.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef	__NR_getppid
+_syscall_noerr0(pid_t, getppid)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getpriority.c b/ap/build/uClibc/libc/sysdeps/linux/common/getpriority.c
new file mode 100644
index 0000000..eba54a5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getpriority.c
@@ -0,0 +1,30 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getpriority() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/resource.h>
+
+
+#define __NR___syscall_getpriority __NR_getpriority
+static __inline__ _syscall2(int, __syscall_getpriority,
+		__priority_which_t, which, id_t, who)
+
+/* The return value of __syscall_getpriority is biased by this value
+ * to avoid returning negative values.  */
+#define PZERO 20
+int getpriority(__priority_which_t which, id_t who)
+{
+	int res;
+
+	res = __syscall_getpriority(which, who);
+	if (res >= 0)
+		res = PZERO - res;
+	return res;
+}
+libc_hidden_def(getpriority)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getresgid.c b/ap/build/uClibc/libc/sysdeps/linux/common/getresgid.c
new file mode 100644
index 0000000..425263e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getresgid.c
@@ -0,0 +1,38 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getresgid() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#ifdef __USE_GNU
+#include <unistd.h>
+
+#if defined(__NR_getresgid32)
+# undef __NR_getresgid
+# define __NR_getresgid __NR_getresgid32
+_syscall3(int, getresgid, gid_t *, rgid, gid_t *, egid, gid_t *, sgid)
+
+#elif defined(__NR_getresgid)
+# define __NR___syscall_getresgid __NR_getresgid
+static __inline__ _syscall3(int, __syscall_getresgid, __kernel_gid_t *, rgid,
+		  __kernel_gid_t *, egid, __kernel_gid_t *, sgid)
+
+int getresgid(gid_t * rgid, gid_t * egid, gid_t * sgid)
+{
+	int result;
+	__kernel_gid_t k_rgid, k_egid, k_sgid;
+
+	result = __syscall_getresgid(&k_rgid, &k_egid, &k_sgid);
+	if (result == 0) {
+		*rgid = (gid_t) k_rgid;
+		*egid = (gid_t) k_egid;
+		*sgid = (gid_t) k_sgid;
+	}
+	return result;
+}
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getresuid.c b/ap/build/uClibc/libc/sysdeps/linux/common/getresuid.c
new file mode 100644
index 0000000..87cf6d6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getresuid.c
@@ -0,0 +1,38 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getresuid() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#ifdef __USE_GNU
+#include <unistd.h>
+
+#if defined(__NR_getresuid32)
+# undef __NR_getresuid
+# define __NR_getresuid __NR_getresuid32
+_syscall3(int, getresuid, uid_t *, ruid, uid_t *, euid, uid_t *, suid)
+
+#elif defined(__NR_getresuid)
+# define __NR___syscall_getresuid __NR_getresuid
+static __inline__ _syscall3(int, __syscall_getresuid, __kernel_uid_t *, ruid,
+		  __kernel_uid_t *, euid, __kernel_uid_t *, suid)
+
+int getresuid(uid_t * ruid, uid_t * euid, uid_t * suid)
+{
+	int result;
+	__kernel_uid_t k_ruid, k_euid, k_suid;
+
+	result = __syscall_getresuid(&k_ruid, &k_euid, &k_suid);
+	if (result == 0) {
+		*ruid = (uid_t) k_ruid;
+		*euid = (uid_t) k_euid;
+		*suid = (uid_t) k_suid;
+	}
+	return result;
+}
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getrlimit.c b/ap/build/uClibc/libc/sysdeps/linux/common/getrlimit.c
new file mode 100644
index 0000000..4d3163f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getrlimit.c
@@ -0,0 +1,67 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getrlimit() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define getrlimit64 __hide_getrlimit64
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <sys/resource.h>
+#undef getrlimit64
+
+
+/* Only wrap getrlimit if the new ugetrlimit is not present and getrlimit sucks */
+
+#if defined __NR_ugetrlimit
+
+/* just call ugetrlimit() */
+# define __NR___syscall_ugetrlimit __NR_ugetrlimit
+static __always_inline
+_syscall2(int, __syscall_ugetrlimit, enum __rlimit_resource, resource,
+          struct rlimit *, rlim)
+int getrlimit(__rlimit_resource_t resource, struct rlimit *rlimits)
+{
+	return (__syscall_ugetrlimit(resource, rlimits));
+}
+
+#elif !defined(__UCLIBC_HANDLE_OLDER_RLIMIT__)
+
+/* We don't need to wrap getrlimit() */
+_syscall2(int, getrlimit, __rlimit_resource_t, resource,
+		struct rlimit *, rlim)
+
+#else
+
+/* we have to handle old style getrlimit() */
+# define __NR___syscall_getrlimit __NR_getrlimit
+static __always_inline
+_syscall2(int, __syscall_getrlimit, int, resource, struct rlimit *, rlim)
+
+int getrlimit(__rlimit_resource_t resource, struct rlimit *rlimits)
+{
+	int result;
+
+	result = __syscall_getrlimit(resource, rlimits);
+
+	if (result == -1)
+		return result;
+
+	/* We might have to correct the limits values.  Since the old values
+	 * were signed the infinity value is too small.  */
+	if (rlimits->rlim_cur == RLIM_INFINITY >> 1)
+		rlimits->rlim_cur = RLIM_INFINITY;
+	if (rlimits->rlim_max == RLIM_INFINITY >> 1)
+		rlimits->rlim_max = RLIM_INFINITY;
+	return result;
+}
+#endif
+
+libc_hidden_def(getrlimit)
+
+#if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64
+strong_alias(getrlimit, getrlimit64)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getrlimit64.c b/ap/build/uClibc/libc/sysdeps/linux/common/getrlimit64.c
new file mode 100644
index 0000000..d537241
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getrlimit64.c
@@ -0,0 +1,50 @@
+/* Copyright (C) 1991, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <_lfs_64.h>
+
+#include <sys/types.h>
+#include <sys/resource.h>
+#include <bits/wordsize.h>
+
+/* the regular getrlimit will work just fine for 64bit users */
+
+#if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 32
+
+
+/* Put the soft and hard limits for RESOURCE in *RLIMITS.
+   Returns 0 if successful, -1 if not (and sets errno).  */
+int getrlimit64 (__rlimit_resource_t resource, struct rlimit64 *rlimits)
+{
+    struct rlimit rlimits32;
+
+    if (getrlimit (resource, &rlimits32) < 0)
+	return -1;
+
+    if (rlimits32.rlim_cur == RLIM_INFINITY)
+	rlimits->rlim_cur = RLIM64_INFINITY;
+    else
+	rlimits->rlim_cur = rlimits32.rlim_cur;
+    if (rlimits32.rlim_max == RLIM_INFINITY)
+	rlimits->rlim_max = RLIM64_INFINITY;
+    else
+	rlimits->rlim_max = rlimits32.rlim_max;
+
+    return 0;
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getrusage.c b/ap/build/uClibc/libc/sysdeps/linux/common/getrusage.c
new file mode 100644
index 0000000..3e719f2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getrusage.c
@@ -0,0 +1,13 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getrusage() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <wait.h>
+_syscall2(int, getrusage, __rusage_who_t, who, struct rusage *, usage)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getsid.c b/ap/build/uClibc/libc/sysdeps/linux/common/getsid.c
new file mode 100644
index 0000000..5a178bb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getsid.c
@@ -0,0 +1,23 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getsid() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __USE_XOPEN_EXTENDED
+
+#define __NR___syscall_getsid __NR_getsid
+static __inline__ _syscall1(__kernel_pid_t, __syscall_getsid, __kernel_pid_t, pid)
+
+pid_t getsid(pid_t pid)
+{
+	return (__syscall_getsid(pid));
+}
+libc_hidden_def(getsid)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/gettimeofday.c b/ap/build/uClibc/libc/sysdeps/linux/common/gettimeofday.c
new file mode 100644
index 0000000..52490fe
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/gettimeofday.c
@@ -0,0 +1,18 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * gettimeofday() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/time.h>
+
+#ifdef __USE_BSD
+_syscall2(int, gettimeofday, struct timeval *, tv, struct timezone *, tz)
+#else
+_syscall2(int, gettimeofday, struct timeval *, tv, void *, tz)
+#endif
+libc_hidden_def(gettimeofday)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/getuid.c b/ap/build/uClibc/libc/sysdeps/linux/common/getuid.c
new file mode 100644
index 0000000..f921acb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/getuid.c
@@ -0,0 +1,27 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getuid() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_getxuid
+# undef __NR_getuid
+# define __NR_getuid __NR_getxuid
+#endif
+#ifdef __NR_getuid32
+# undef __NR_getuid
+# define __NR_getuid __NR_getuid32
+#endif
+
+_syscall_noerr0(uid_t, getuid)
+libc_hidden_def(getuid)
+#if !defined __NR_geteuid32 && !defined __NR_geteuid
+strong_alias(getuid,geteuid)
+libc_hidden_def(geteuid)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/hp-timing.h b/ap/build/uClibc/libc/sysdeps/linux/common/hp-timing.h
new file mode 100644
index 0000000..099342d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/hp-timing.h
@@ -0,0 +1,83 @@
+/* High precision, low overhead timing functions.  Generic version.
+   Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _HP_TIMING_H
+#define _HP_TIMING_H	1
+
+
+/* There are no generic definitions for the times.  We could write something
+   using the `gettimeofday' system call where available but the overhead of
+   the system call might be too high.
+
+   In case a platform supports timers in the hardware the following macros
+   and types must be defined:
+
+   - HP_TIMING_AVAIL: test for availability.
+
+   - HP_TIMING_INLINE: this macro is non-zero if the functionality is not
+     implemented using function calls but instead uses some inlined code
+     which might simply consist of a few assembler instructions.  We have to
+     know this since we might want to use the macros here in places where we
+     cannot make function calls.
+
+   - hp_timing_t: This is the type for variables used to store the time
+     values.
+
+   - HP_TIMING_ZERO: clear `hp_timing_t' object.
+
+   - HP_TIMING_NOW: place timestamp for current time in variable given as
+     parameter.
+
+   - HP_TIMING_DIFF_INIT: do whatever is necessary to be able to use the
+     HP_TIMING_DIFF macro.
+
+   - HP_TIMING_DIFF: compute difference between two times and store it
+     in a third.  Source and destination might overlap.
+
+   - HP_TIMING_ACCUM: add time difference to another variable.  This might
+     be a bit more complicated to implement for some platforms as the
+     operation should be thread-safe and 64bit arithmetic on 32bit platforms
+     is not.
+
+   - HP_TIMING_ACCUM_NT: this is the variant for situations where we know
+     there are no threads involved.
+
+   - HP_TIMING_PRINT: write decimal representation of the timing value into
+     the given string.  This operation need not be inline even though
+     HP_TIMING_INLINE is specified.
+
+*/
+
+/* Provide dummy definitions.  */
+#define HP_TIMING_AVAIL		(0)
+#define HP_TIMING_INLINE	(0)
+typedef int hp_timing_t;
+#define HP_TIMING_ZERO(Var)
+#define HP_TIMING_NOW(var)
+#define HP_TIMING_DIFF_INIT()
+#define HP_TIMING_DIFF(Diff, Start, End)
+#define HP_TIMING_ACCUM(Sum, Diff)
+#define HP_TIMING_ACCUM_NT(Sum, Diff)
+#define HP_TIMING_PRINT(Buf, Len, Val)
+
+/* Since this implementation is not available we tell the user about it.  */
+#define HP_TIMING_NONAVAIL	1
+
+#endif	/* hp-timing.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/init_module.c b/ap/build/uClibc/libc/sysdeps/linux/common/init_module.c
new file mode 100644
index 0000000..cf6d747
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/init_module.c
@@ -0,0 +1,19 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * init_module() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+int init_module(void *first, void *second, void *third, void *fourth, void *fifth);
+#ifdef __NR_init_module
+/* This may have 5 arguments (for old 2.0 kernels) or 2 arguments
+ * (for 2.2 and 2.4 kernels).  Use the greatest common denominator,
+ * and let the kernel cope with whatever it gets.  It's good at that. */
+_syscall5(int, init_module, void *, first, void *, second, void *, third,
+		  void *, fourth, void *, fifth)
+#endif
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/inotify.c b/ap/build/uClibc/libc/sysdeps/linux/common/inotify.c
new file mode 100644
index 0000000..e2f3836
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/inotify.c
@@ -0,0 +1,28 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * inotify interface for uClibc
+ *
+ * Copyright (C) 2006 Austin Morgan <admorgan@morgancomputers.net>
+ * Copyright (C) 2006 by Erik Andersen <andersen@codepoet.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/inotify.h>
+
+#ifdef __NR_inotify_init
+_syscall0(int, inotify_init)
+#endif
+
+#ifdef __NR_inotify_init1
+_syscall1(int, inotify_init1, int, flags)
+#endif
+
+#ifdef __NR_inotify_add_watch
+_syscall3(int, inotify_add_watch, int, fd, const char *, path, uint32_t, mask)
+#endif
+
+#ifdef __NR_inotify_rm_watch
+_syscall2(int, inotify_rm_watch, int, fd, int, wd)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/ioctl.c b/ap/build/uClibc/libc/sysdeps/linux/common/ioctl.c
new file mode 100644
index 0000000..f2f0f53
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/ioctl.c
@@ -0,0 +1,46 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * ioctl() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <stdarg.h>
+#include <sys/ioctl.h>
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <sysdep-cancel.h>
+#else
+#define SINGLE_THREAD_P 1
+#endif
+
+libc_hidden_proto(ioctl)
+
+#define __NR___syscall_ioctl __NR_ioctl
+static __always_inline
+_syscall3(int, __syscall_ioctl, int, fd, unsigned long int, request, void *, arg)
+
+int ioctl(int fd, unsigned long int request, ...)
+{
+	void *arg;
+	va_list list;
+
+	va_start(list, request);
+	arg = va_arg(list, void *);
+
+	va_end(list);
+
+	if (SINGLE_THREAD_P)
+		return __syscall_ioctl(fd, request, arg);
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype = LIBC_CANCEL_ASYNC ();
+	int result = __syscall_ioctl(fd, request, arg);
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+#endif
+}
+libc_hidden_def(ioctl)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/ioperm.c b/ap/build/uClibc/libc/sysdeps/linux/common/ioperm.c
new file mode 100644
index 0000000..bca2fff
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/ioperm.c
@@ -0,0 +1,22 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * ioperm() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+#if defined __ARCH_USE_MMU__ && defined __NR_ioperm
+
+/* psm: can't #include <sys/io.h>, some archs miss it */
+extern int ioperm(unsigned long __from, unsigned long __num, int __turn_on) __THROW;
+/* Not needed internally;
+libc_hidden_proto(ioperm)
+*/
+_syscall3(int, ioperm, unsigned long, from, unsigned long, num, int, turn_on)
+/*libc_hidden_def(ioperm)*/
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/iopl.c b/ap/build/uClibc/libc/sysdeps/linux/common/iopl.c
new file mode 100644
index 0000000..4d9c458
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/iopl.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * iopl() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#if defined __ARCH_USE_MMU__ && defined __NR_iopl
+/* psm: can't #include <sys/io.h>, some archs miss it */
+extern int iopl(int __level) __THROW;
+_syscall1(int, iopl, int, level)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/kill.c b/ap/build/uClibc/libc/sysdeps/linux/common/kill.c
new file mode 100644
index 0000000..c11a0ed
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/kill.c
@@ -0,0 +1,21 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * kill() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <signal.h>
+
+
+#define __NR___syscall_kill __NR_kill
+static __inline__ _syscall2(int, __syscall_kill, __kernel_pid_t, pid, int, sig)
+
+int kill(pid_t pid, int sig)
+{
+	return (__syscall_kill(pid, sig));
+}
+libc_hidden_def(kill)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/klogctl.c b/ap/build/uClibc/libc/sysdeps/linux/common/klogctl.c
new file mode 100644
index 0000000..58467df
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/klogctl.c
@@ -0,0 +1,18 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * klogctl() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <sys/klog.h>
+#define __NR__syslog		__NR_syslog
+static __inline__ _syscall3(int, _syslog, int, type, char *, buf, int, len)
+int klogctl(int type, char *buf, int len)
+{
+	return (_syslog(type, buf, len));
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/lchown.c b/ap/build/uClibc/libc/sysdeps/linux/common/lchown.c
new file mode 100644
index 0000000..c0f8ce7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/lchown.c
@@ -0,0 +1,38 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * lchown() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <bits/wordsize.h>
+
+#if (__WORDSIZE == 32 && defined(__NR_lchown32)) || __WORDSIZE == 64
+# ifdef __NR_lchown32
+#  undef __NR_lchown
+#  define __NR_lchown __NR_lchown32
+# endif
+
+_syscall3(int, lchown, const char *, path, uid_t, owner, gid_t, group)
+
+#else
+
+# define __NR___syscall_lchown __NR_lchown
+static __inline__ _syscall3(int, __syscall_lchown, const char *, path,
+		__kernel_uid_t, owner, __kernel_gid_t, group)
+
+int lchown(const char *path, uid_t owner, gid_t group)
+{
+	if (((owner + 1) > (uid_t) ((__kernel_uid_t) - 1U))
+		|| ((group + 1) > (gid_t) ((__kernel_gid_t) - 1U))) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return __syscall_lchown(path, owner, group);
+}
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/libgcc_s.h b/ap/build/uClibc/libc/sysdeps/linux/common/libgcc_s.h
new file mode 100644
index 0000000..e74a103
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/libgcc_s.h
@@ -0,0 +1,2 @@
+/* Name of libgcc_s library provided by gcc.  */
+#define LIBGCC_S_SO "libgcc_s.so.1"
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/link.c b/ap/build/uClibc/libc/sysdeps/linux/common/link.c
new file mode 100644
index 0000000..b5e5536
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/link.c
@@ -0,0 +1,12 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * link() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+_syscall2(int, link, const char *, oldpath, const char *, newpath)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/linkat.c b/ap/build/uClibc/libc/sysdeps/linux/common/linkat.c
new file mode 100644
index 0000000..9abe9ec
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/linkat.c
@@ -0,0 +1,16 @@
+/*
+ * linkat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_linkat
+_syscall5(int, linkat, int, fromfd, const char *, from, int, tofd, const char *, to, int, flags)
+#else
+/* should add emulation with link() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/llseek.c b/ap/build/uClibc/libc/sysdeps/linux/common/llseek.c
new file mode 100644
index 0000000..ff16917
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/llseek.c
@@ -0,0 +1,42 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * llseek/lseek64 syscall for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+/* Newer kernel ports have llseek() instead of _llseek() */
+#if !defined __NR__llseek && defined __NR_llseek
+# define __NR__llseek __NR_llseek
+#endif
+
+#if defined __NR__llseek && defined __UCLIBC_HAS_LFS__
+
+loff_t lseek64(int fd, loff_t offset, int whence)
+{
+	loff_t result;
+	return (loff_t)(INLINE_SYSCALL(_llseek, 5, fd, (off_t) (offset >> 32),
+				(off_t) (offset & 0xffffffff), &result, whence) ?: result);
+}
+
+#else
+
+loff_t lseek64(int fd, loff_t offset, int whence)
+{
+	return (loff_t)(lseek(fd, (off_t) (offset), whence));
+}
+
+#endif
+
+#ifndef __LINUXTHREADS_OLD__
+libc_hidden_def(lseek64)
+#else
+libc_hidden_weak(lseek64)
+strong_alias(lseek64,__libc_lseek64)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/longjmp.c b/ap/build/uClibc/libc/sysdeps/linux/common/longjmp.c
new file mode 100644
index 0000000..f3448bc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/longjmp.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 1991, 92, 94, 95, 97, 98, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <stddef.h>
+#include <setjmp.h>
+#include <signal.h>
+
+
+extern void __longjmp (__jmp_buf __env, int __val) attribute_noreturn;
+libc_hidden_proto(__longjmp)
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+extern void _longjmp_unwind (jmp_buf env, int val);
+#endif
+
+extern __typeof(longjmp) __libc_longjmp attribute_noreturn;
+/* Set the signal mask to the one specified in ENV, and jump
+   to the position specified in ENV, causing the setjmp
+   call there to return VAL, or 1 if VAL is 0.  */
+void __libc_longjmp (sigjmp_buf env, int val)
+{
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+  /* Perform any cleanups needed by the frames being unwound.  */
+  _longjmp_unwind (env, val);
+#endif
+
+  if (env[0].__mask_was_saved)
+    /* Restore the saved signal mask.  */
+    (void) sigprocmask (SIG_SETMASK, &env[0].__saved_mask, NULL);
+
+  /* Call the machine-dependent function to restore machine state.  */
+  __longjmp (env[0].__jmpbuf, val ?: 1);
+}
+
+weak_alias(__libc_longjmp,longjmp)
+weak_alias(__libc_longjmp,siglongjmp)
+strong_alias(__libc_longjmp,__libc_siglongjmp)
+strong_alias(__libc_longjmp,_longjmp)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/lseek.c b/ap/build/uClibc/libc/sysdeps/linux/common/lseek.c
new file mode 100644
index 0000000..9ff4240
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/lseek.c
@@ -0,0 +1,27 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * lseek() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_lseek
+_syscall3(__off_t, lseek, int, fildes, __off_t, offset, int, whence)
+#else
+
+__off_t lseek(int fildes, __off_t offset, int whence)
+{
+	return lseek64(fildes, offset, whence);
+}
+#endif
+#ifndef __LINUXTHREADS_OLD__
+libc_hidden_def(lseek)
+#else
+libc_hidden_weak(lseek)
+strong_alias(lseek,__libc_lseek)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/lstat.c b/ap/build/uClibc/libc/sysdeps/linux/common/lstat.c
new file mode 100644
index 0000000..db72d1f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/lstat.c
@@ -0,0 +1,44 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * lstat() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include "xstatconv.h"
+
+int lstat(const char *file_name, struct stat *buf)
+{
+	int result;
+#ifdef __NR_lstat64
+	/* normal stat call has limited values for various stat elements
+	 * e.g. uid device major/minor etc.
+	 * so we use 64 variant if available
+	 * in order to get newer versions of stat elements
+	 */
+	struct kernel_stat64 kbuf;
+	result = INLINE_SYSCALL(lstat64, 2, file_name, &kbuf);
+	if (result == 0) {
+		__xstat32_conv(&kbuf, buf);
+	}
+#else
+	struct kernel_stat kbuf;
+
+	result = INLINE_SYSCALL(lstat, 2, file_name, &kbuf);
+	if (result == 0) {
+		__xstat_conv(&kbuf, buf);
+	}
+#endif
+	return result;
+}
+libc_hidden_def(lstat)
+
+#if ! defined __NR_lstat64 && defined __UCLIBC_HAS_LFS__
+strong_alias_untyped(lstat,lstat64)
+libc_hidden_def(lstat64)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/lstat64.c b/ap/build/uClibc/libc/sysdeps/linux/common/lstat64.c
new file mode 100644
index 0000000..235b76d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/lstat64.c
@@ -0,0 +1,35 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * lstat64() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+#if defined __UCLIBC_HAS_LFS__ && defined __NR_lstat64
+# include <unistd.h>
+# include <sys/stat.h>
+# include "xstatconv.h"
+
+
+# define __NR___syscall_lstat64 __NR_lstat64
+static __inline__ _syscall2(int, __syscall_lstat64, const char *, file_name,
+		  struct kernel_stat64 *, buf)
+
+int lstat64(const char *file_name, struct stat64 *buf)
+{
+	int result;
+	struct kernel_stat64 kbuf;
+
+	result = __syscall_lstat64(file_name, &kbuf);
+	if (result == 0) {
+		__xstat64_conv(&kbuf, buf);
+	}
+	return result;
+}
+libc_hidden_def(lstat64)
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/lutimes.c b/ap/build/uClibc/libc/sysdeps/linux/common/lutimes.c
new file mode 100644
index 0000000..e01d40e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/lutimes.c
@@ -0,0 +1,38 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * lutimes() implementation for uClibc
+ *
+ * Copyright (C) 2010 Vladimir Zapolskiy <vzapolskiy@gmail.com>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <time.h>
+
+#ifdef __NR_lutimes
+_syscall2(int, lutimes, const char *, file, const struct timeval *, tvp)
+#elif defined __NR_utimensat
+#include <sys/time.h>
+#include <fcntl.h>
+
+int lutimes(const char *file, const struct timeval tvp[2])
+{
+	struct timespec ts[2];
+
+	if (tvp != NULL)
+	{
+		if (tvp[0].tv_usec < 0 || tvp[0].tv_usec >= 1000000
+		    || tvp[1].tv_usec < 0 || tvp[1].tv_usec >= 1000000)
+		{
+			__set_errno(EINVAL);
+			return -1;
+		}
+
+		TIMEVAL_TO_TIMESPEC(&tvp[0], &ts[0]);
+		TIMEVAL_TO_TIMESPEC(&tvp[1], &ts[1]);
+	}
+
+	return utimensat(AT_FDCWD, file, tvp ? ts : NULL, AT_SYMLINK_NOFOLLOW);
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/madvise.c b/ap/build/uClibc/libc/sysdeps/linux/common/madvise.c
new file mode 100644
index 0000000..e953d7b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/madvise.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * madvise() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/mman.h>
+#if defined __NR_madvise && defined __USE_BSD
+_syscall3(int, madvise, void *, __addr, size_t, __len, int, __advice)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mincore.c b/ap/build/uClibc/libc/sysdeps/linux/common/mincore.c
new file mode 100644
index 0000000..f1f3557
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mincore.c
@@ -0,0 +1,15 @@
+/*
+ * This file provides the mincore() system call to uClibc.
+ * Copyright (C) 20041215 - <solar@gentoo.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+#if defined __NR_mincore && (defined __USE_BSD || defined __USE_SVID)
+#include <unistd.h>
+#include <sys/mman.h>
+_syscall3(int, mincore, void *, start, size_t, length, unsigned char *, vec)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mkdir.c b/ap/build/uClibc/libc/sysdeps/linux/common/mkdir.c
new file mode 100644
index 0000000..fbc587d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mkdir.c
@@ -0,0 +1,22 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * mkdir() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/stat.h>
+
+
+#define __NR___syscall_mkdir __NR_mkdir
+static __inline__ _syscall2(int, __syscall_mkdir, const char *, pathname,
+		__kernel_mode_t, mode)
+
+int mkdir(const char *pathname, mode_t mode)
+{
+	return (__syscall_mkdir(pathname, mode));
+}
+libc_hidden_def(mkdir)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mkdirat.c b/ap/build/uClibc/libc/sysdeps/linux/common/mkdirat.c
new file mode 100644
index 0000000..4da9468
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mkdirat.c
@@ -0,0 +1,16 @@
+/*
+ * mkdirat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/stat.h>
+
+#ifdef __NR_mkdirat
+_syscall3(int, mkdirat, int, fd, const char *, path, mode_t, mode)
+#else
+/* should add emulation with mkdir() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mkfifo.c b/ap/build/uClibc/libc/sysdeps/linux/common/mkfifo.c
new file mode 100644
index 0000000..0616814
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mkfifo.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 1991, 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+
+/* Create a named pipe (FIFO) named PATH with protections MODE.  */
+int
+mkfifo (const char *path, mode_t mode)
+{
+  return mknod (path, mode | S_IFIFO, 0);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mkfifoat.c b/ap/build/uClibc/libc/sysdeps/linux/common/mkfifoat.c
new file mode 100644
index 0000000..e442fe2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mkfifoat.c
@@ -0,0 +1,19 @@
+/*
+ * mkfifoat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/stat.h>
+
+#ifdef __NR_mknodat
+int mkfifoat(int fd, const char *path, mode_t mode)
+{
+	return mknodat(fd, path, mode | S_IFIFO, 0);
+}
+#else
+/* should add emulation with mkfifo() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mknod.c b/ap/build/uClibc/libc/sysdeps/linux/common/mknod.c
new file mode 100644
index 0000000..b52c8c5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mknod.c
@@ -0,0 +1,22 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * mknod() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/stat.h>
+
+int mknod(const char *path, mode_t mode, dev_t dev)
+{
+	unsigned long long int k_dev;
+
+	/* We must convert the value to dev_t type used by the kernel.  */
+	k_dev = (dev) & ((1ULL << 32) - 1);
+
+	return INLINE_SYSCALL(mknod, 3, path, mode, (unsigned int)k_dev);
+}
+libc_hidden_def(mknod)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mknodat.c b/ap/build/uClibc/libc/sysdeps/linux/common/mknodat.c
new file mode 100644
index 0000000..93b9e6e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mknodat.c
@@ -0,0 +1,25 @@
+/*
+ * mknodat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/stat.h>
+
+#ifdef __NR_mknodat
+int mknodat(int fd, const char *path, mode_t mode, dev_t dev)
+{
+	unsigned long long int k_dev;
+
+	/* We must convert the value to dev_t type used by the kernel.  */
+	k_dev = (dev) & ((1ULL << 32) - 1);
+
+	return INLINE_SYSCALL(mknodat, 4, fd, path, mode, (unsigned int)k_dev);
+}
+libc_hidden_def(mknodat)
+#else
+/* should add emulation with mknod() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mlock.c b/ap/build/uClibc/libc/sysdeps/linux/common/mlock.c
new file mode 100644
index 0000000..12120d8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mlock.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * mlock() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/mman.h>
+#if defined __ARCH_USE_MMU__ && defined __NR_mlock
+_syscall2(int, mlock, const void *, addr, size_t, len)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mlockall.c b/ap/build/uClibc/libc/sysdeps/linux/common/mlockall.c
new file mode 100644
index 0000000..99f7201
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mlockall.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * mlockall() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/mman.h>
+#if defined __ARCH_USE_MMU__ && defined __NR_mlockall
+_syscall1(int, mlockall, int, flags)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mmap.c b/ap/build/uClibc/libc/sysdeps/linux/common/mmap.c
new file mode 100644
index 0000000..8995898
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mmap.c
@@ -0,0 +1,71 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * mmap() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <bits/uClibc_page.h>
+
+#ifdef __NR_mmap
+
+
+#ifdef __UCLIBC_MMAP_HAS_6_ARGS__
+
+_syscall6(void *, mmap, void *, start, size_t, length,
+		int, prot, int, flags, int, fd, off_t, offset)
+
+#else
+
+# define __NR__mmap __NR_mmap
+static __inline__ _syscall1(__ptr_t, _mmap, unsigned long *, buffer)
+__ptr_t mmap(__ptr_t addr, size_t len, int prot,
+			 int flags, int fd, __off_t offset)
+{
+	unsigned long buffer[6];
+
+	buffer[0] = (unsigned long) addr;
+	buffer[1] = (unsigned long) len;
+	buffer[2] = (unsigned long) prot;
+	buffer[3] = (unsigned long) flags;
+	buffer[4] = (unsigned long) fd;
+	buffer[5] = (unsigned long) offset;
+	return (__ptr_t) _mmap(buffer);
+}
+
+#endif
+
+libc_hidden_def(mmap)
+
+#elif defined(__NR_mmap2)
+
+
+#define __NR___syscall_mmap2 __NR_mmap2
+static __inline__ _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr,
+	size_t, len, int, prot, int, flags, int, fd, off_t, offset)
+
+/* Some architectures always use 12 as page shift for mmap2() eventhough the
+ * real PAGE_SHIFT != 12.  Other architectures use the same value as
+ * PAGE_SHIFT...
+ */
+# ifndef MMAP2_PAGE_SHIFT
+#  define MMAP2_PAGE_SHIFT 12
+# endif
+
+__ptr_t mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offset)
+{
+	if (offset & ((1 << MMAP2_PAGE_SHIFT) - 1)) {
+		__set_errno(EINVAL);
+		return MAP_FAILED;
+	}
+	return __syscall_mmap2(addr, len, prot, flags, fd, offset >> MMAP2_PAGE_SHIFT);
+}
+
+libc_hidden_def(mmap)
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mmap64.c b/ap/build/uClibc/libc/sysdeps/linux/common/mmap64.c
new file mode 100644
index 0000000..b6eb2b3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mmap64.c
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* Massivly hacked up for uClibc by Erik Andersen */
+
+#include <_lfs_64.h>
+
+#ifdef __UCLIBC_HAS_LFS__
+
+#include <errno.h>
+#include <stdint.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <sys/syscall.h>
+#include <bits/uClibc_page.h>
+
+
+# if !defined __NR_mmap2
+
+/*
+ * This version is a stub that just chops off everything at the mmap 32 bit
+ * mmap() address space...  You will probably need to add in an arch specific
+ * implementation to override this as there is not a generic way for me to
+ * implement this particular syscall if your arch lacks _syscall6...
+ *
+ */
+
+__ptr_t mmap64(__ptr_t addr, size_t len, int prot, int flags, int fd, __off64_t offset)
+{
+	if (offset != (off_t) offset ||
+	    (offset + len) != (off_t) (offset + len)) {
+		__set_errno(EINVAL);
+		return MAP_FAILED;
+	}
+
+	return mmap(addr, len, prot, flags, fd, (off_t) offset);
+}
+
+# else
+
+/* Some architectures always use 12 as page shift for mmap2() eventhough the
+ * real PAGE_SHIFT != 12.  Other architectures use the same value as
+ * PAGE_SHIFT...
+ */
+#  ifndef MMAP2_PAGE_SHIFT
+#   define MMAP2_PAGE_SHIFT 12
+#  endif
+
+__ptr_t mmap64(__ptr_t addr, size_t len, int prot, int flags, int fd, __off64_t offset)
+{
+	/*
+	 * Some arches check the size in INLINE_SYSCALL() and barf if it's
+	 * too big (i.e. a 64bit value getting truncated to 32bit).
+	 */
+# if __WORDSIZE == 32
+	uint32_t sysoff;
+# else
+	uint64_t sysoff;
+# endif
+
+	if (offset & ((1 << MMAP2_PAGE_SHIFT) - 1)) {
+		__set_errno(EINVAL);
+		return MAP_FAILED;
+	}
+
+	/*
+	 * We know __off64_t is always a signed 64-bit type, but need things
+	 * to be unsigned before doing the shift.  If it isn't, we might
+	 * sign extend things and pass in the wrong value.  So cast it to
+	 * an unsigned 64-bit value before doing the shift.
+	 */
+	sysoff = (uint64_t)offset >> MMAP2_PAGE_SHIFT;
+
+	return (__ptr_t) INLINE_SYSCALL(mmap2, 6, addr, len, prot, flags, fd, sysoff);
+}
+
+# endif
+#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/modify_ldt.c b/ap/build/uClibc/libc/sysdeps/linux/common/modify_ldt.c
new file mode 100644
index 0000000..d70bd40
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/modify_ldt.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * modify_ldt() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+int modify_ldt (int func, void *ptr, unsigned long bytecount);
+#ifdef __NR_modify_ldt
+_syscall3(int, modify_ldt, int, func, void *, ptr, unsigned long, bytecount)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mount.c b/ap/build/uClibc/libc/sysdeps/linux/common/mount.c
new file mode 100644
index 0000000..39e5db1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mount.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * mount() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/mount.h>
+_syscall5(int, mount, const char *, specialfile, const char *, dir,
+		  const char *, filesystemtype, unsigned long, rwflag,
+		  const void *, data)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mprotect.c b/ap/build/uClibc/libc/sysdeps/linux/common/mprotect.c
new file mode 100644
index 0000000..d60fc04
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mprotect.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * mprotect() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/mman.h>
+
+#if defined __NR_mprotect
+_syscall3(int, mprotect, void *, addr, size_t, len, int, prot)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/mremap.c b/ap/build/uClibc/libc/sysdeps/linux/common/mremap.c
new file mode 100644
index 0000000..0295a25
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/mremap.c
@@ -0,0 +1,28 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * mremap() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_mremap
+
+/* Why do we do this?! */
+
+#define mremap _hidemremap
+#include <sys/mman.h>
+#undef mremap
+
+void *mremap(void *, size_t, size_t, int, void *);
+libc_hidden_proto(mremap)
+
+_syscall5(void *, mremap, void *, old_address, size_t, old_size, size_t,
+		  new_size, int, may_move, void *, new_address)
+libc_hidden_def(mremap)
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/msync.c b/ap/build/uClibc/libc/sysdeps/linux/common/msync.c
new file mode 100644
index 0000000..844dbaa
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/msync.c
@@ -0,0 +1,45 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * msync() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <sys/mman.h>
+
+#ifdef __NR_msync
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <sysdep-cancel.h>
+#else
+#define SINGLE_THREAD_P 1
+#endif
+
+#define __NR___syscall_msync __NR_msync
+static __always_inline _syscall3(int, __syscall_msync, void *, addr, size_t, length,
+						int, flags)
+
+extern __typeof(msync) __libc_msync;
+int __libc_msync(void * addr, size_t length, int flags)
+{
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype, result;
+#endif
+
+	if (SINGLE_THREAD_P)
+		return __syscall_msync(addr, length, flags);
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	oldtype = LIBC_CANCEL_ASYNC ();
+	result = __syscall_msync(addr, length, flags);
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+#endif
+}
+weak_alias(__libc_msync,msync)
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/munlock.c b/ap/build/uClibc/libc/sysdeps/linux/common/munlock.c
new file mode 100644
index 0000000..07f9376
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/munlock.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * munlock() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/mman.h>
+#if defined __ARCH_USE_MMU__ && defined __NR_munlock
+_syscall2(int, munlock, const void *, addr, size_t, len)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/munlockall.c b/ap/build/uClibc/libc/sysdeps/linux/common/munlockall.c
new file mode 100644
index 0000000..cc15264
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/munlockall.c
@@ -0,0 +1,16 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * munlockall() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+#if defined __NR_munlockall && defined __ARCH_USE_MMU__
+#include <sys/mman.h>
+
+_syscall0(int, munlockall)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/munmap.c b/ap/build/uClibc/libc/sysdeps/linux/common/munmap.c
new file mode 100644
index 0000000..736bffe
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/munmap.c
@@ -0,0 +1,16 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * munmap() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <sys/mman.h>
+
+
+_syscall2(int, munmap, void *, start, size_t, length)
+libc_hidden_def(munmap)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/nanosleep.c b/ap/build/uClibc/libc/sysdeps/linux/common/nanosleep.c
new file mode 100644
index 0000000..26ce4a6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/nanosleep.c
@@ -0,0 +1,40 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * nanosleep() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <time.h>
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <sysdep-cancel.h>
+#include <pthreadP.h>
+#else
+#define SINGLE_THREAD_P 1
+#endif
+
+#define __NR___syscall_nanosleep __NR_nanosleep
+static inline _syscall2(int, __syscall_nanosleep, const struct timespec *, req,
+						struct timespec *, rem);
+
+extern __typeof(nanosleep) __libc_nanosleep;
+
+int __libc_nanosleep(const struct timespec *req, struct timespec *rem)
+{
+	if (SINGLE_THREAD_P)
+		return __syscall_nanosleep(req, rem);
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype = LIBC_CANCEL_ASYNC ();
+	int result = __syscall_nanosleep(req, rem);
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+#endif
+}
+
+weak_alias(__libc_nanosleep,nanosleep)
+libc_hidden_weak(nanosleep)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/nice.c b/ap/build/uClibc/libc/sysdeps/linux/common/nice.c
new file mode 100644
index 0000000..3694db8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/nice.c
@@ -0,0 +1,75 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * nice() for uClibc
+ *
+ * Copyright (C) 2005 by Manuel Novoa III <mjn3@codepoet.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <sys/resource.h>
+
+
+#ifdef __NR_nice
+
+# define __NR___syscall_nice __NR_nice
+static __inline__ _syscall1(int, __syscall_nice, int, incr)
+
+#else
+
+# include <limits.h>
+
+
+static __inline__ int int_add_no_wrap(int a, int b)
+{
+	int s = a + b;
+
+	if (b < 0) {
+		if (s > a) s = INT_MIN;
+	} else {
+		if (s < a) s = INT_MAX;
+	}
+
+	return s;
+}
+
+static __inline__ int __syscall_nice(int incr)
+{
+	int old_priority;
+# if 1
+	/* This should never fail. */
+	old_priority = getpriority(PRIO_PROCESS, 0);
+# else
+	/* But if you want to be paranoid... */
+	int old_errno;
+
+	old_errno = errno;
+	__set_errno(0);
+	old_priority = getpriority(PRIO_PROCESS, 0);
+	if ((old_priority == -1) && errno) {
+		return -1;
+	}
+	__set_errno(old_errno);
+# endif
+
+	if (setpriority(PRIO_PROCESS, 0, int_add_no_wrap(old_priority, incr))) {
+		__set_errno(EPERM);	/* SUSv3 mandates EPERM for nice failure. */
+		return -1;
+	}
+
+	return 0;
+}
+
+#endif
+
+int nice(int incr)
+{
+	if (__syscall_nice(incr)) {
+		return -1;
+	}
+
+	return getpriority(PRIO_PROCESS, 0);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/noophooks.c b/ap/build/uClibc/libc/sysdeps/linux/common/noophooks.c
new file mode 100644
index 0000000..a6c9d76
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/noophooks.c
@@ -0,0 +1,29 @@
+/* Noop hooks for the instrumenting functions.
+   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <libc-internal.h>
+
+void
+__cyg_profile_func_enter (attribute_unused void *this_fn, attribute_unused void *call_site);
+void
+__cyg_profile_func_enter (attribute_unused void *this_fn, attribute_unused void *call_site)
+{
+}
+strong_alias (__cyg_profile_func_enter, __cyg_profile_func_exit)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/not-cancel.h b/ap/build/uClibc/libc/sysdeps/linux/common/not-cancel.h
new file mode 100644
index 0000000..9418417
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/not-cancel.h
@@ -0,0 +1,60 @@
+/* Uncancelable versions of cancelable interfaces.  Linux version.
+   Copyright (C) 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+/* Uncancelable open.  */
+#define open_not_cancel(name, flags, mode) \
+   INLINE_SYSCALL (open, 3, (const char *) (name), (flags), (mode))
+#define open_not_cancel_2(name, flags) \
+   INLINE_SYSCALL (open, 2, (const char *) (name), (flags))
+
+/* Uncancelable close.  */
+#define close_not_cancel(fd) \
+  INLINE_SYSCALL (close, 1, fd)
+#define close_not_cancel_no_status(fd) \
+  (void) ({ INTERNAL_SYSCALL_DECL (err);				      \
+	    INTERNAL_SYSCALL (close, err, 1, (fd)); })
+
+/* Uncancelable read.  */
+#define read_not_cancel(fd, buf, n) \
+  INLINE_SYSCALL (read, 3, (fd), (buf), (n))
+
+/* Uncancelable write.  */
+#define write_not_cancel(fd, buf, n) \
+  INLINE_SYSCALL (write, 3, (fd), (buf), (n))
+
+/* Uncancelable writev.  */
+#define writev_not_cancel_no_status(fd, iov, n) \
+  (void) ({ INTERNAL_SYSCALL_DECL (err);				      \
+	    INTERNAL_SYSCALL (writev, err, 3, (fd), (iov), (n)); })
+
+/* Uncancelable fcntl.  */
+#define fcntl_not_cancel(fd, cmd, val) \
+  __fcntl_nocancel (fd, cmd, val)
+
+/* Uncancelable waitpid.  */
+#ifdef __NR_waitpid
+# define waitpid_not_cancel(pid, stat_loc, options) \
+  INLINE_SYSCALL (waitpid, 3, pid, stat_loc, options)
+#else
+# define waitpid_not_cancel(pid, stat_loc, options) \
+  INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/ntp_gettime.c b/ap/build/uClibc/libc/sysdeps/linux/common/ntp_gettime.c
new file mode 100644
index 0000000..83959e8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/ntp_gettime.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/timex.h>
+
+
+int ntp_gettime(struct ntptimeval *ntv)
+{
+    struct timex tntx;
+    int result;
+
+    tntx.modes = 0;
+    result = adjtimex(&tntx);
+    ntv->time = tntx.time;
+    ntv->maxerror = tntx.maxerror;
+    ntv->esterror = tntx.esterror;
+    return result;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/open.c b/ap/build/uClibc/libc/sysdeps/linux/common/open.c
new file mode 100644
index 0000000..9fb694d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/open.c
@@ -0,0 +1,39 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * open() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <fcntl.h>
+#include <string.h>
+#include <sys/param.h>
+
+#define __NR___syscall_open __NR_open
+static __inline__ _syscall3(int, __syscall_open, const char *, file,
+		int, flags, __kernel_mode_t, mode)
+
+int open(const char *file, int oflag, ...)
+{
+	mode_t mode = 0;
+
+	if (oflag & O_CREAT) {
+		va_list arg;
+		va_start(arg, oflag);
+		mode = va_arg(arg, mode_t);
+		va_end(arg);
+	}
+
+	return __syscall_open(file, oflag, mode);
+}
+#ifndef __LINUXTHREADS_OLD__
+libc_hidden_def(open)
+#else
+libc_hidden_weak(open)
+strong_alias(open,__libc_open)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/open64.c b/ap/build/uClibc/libc/sysdeps/linux/common/open64.c
new file mode 100644
index 0000000..c1f5400
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/open64.c
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <features.h>
+#include <fcntl.h>
+#include <stdarg.h>
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <errno.h>
+#include <sysdep-cancel.h>
+#endif
+
+#ifdef __UCLIBC_HAS_LFS__
+
+#ifndef O_LARGEFILE
+# define O_LARGEFILE	0100000
+#endif
+
+/* Open FILE with access OFLAG.  If OFLAG includes O_CREAT,
+   a third argument is the file protection.  */
+int open64 (const char *file, int oflag, ...)
+{
+    mode_t mode = 0;
+
+    if (oflag & O_CREAT)
+    {
+	va_list arg;
+	va_start (arg, oflag);
+	mode = va_arg (arg, mode_t);
+	va_end (arg);
+    }
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+  if (SINGLE_THREAD_P)
+    return INLINE_SYSCALL (open, 3, file, oflag | O_LARGEFILE, mode);
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  int result = INLINE_SYSCALL (open, 3, file, oflag | O_LARGEFILE, mode);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
+#else
+  return open(file, oflag | O_LARGEFILE, mode);
+#endif
+}
+#ifndef __LINUXTHREADS_OLD__
+libc_hidden_def(open64)
+#else
+libc_hidden_weak(open64)
+strong_alias(open64,__libc_open64)
+#endif
+
+#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/openat.c b/ap/build/uClibc/libc/sysdeps/linux/common/openat.c
new file mode 100644
index 0000000..8380ec6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/openat.c
@@ -0,0 +1,25 @@
+/*
+ * openat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define openat __xx_openat
+#include <sys/syscall.h>
+#include <fcntl.h>
+#undef openat
+
+#ifdef __NR_openat
+/* The openat() prototype is varargs based, but we don't care about that
+ * here, so need to provide our own dedicated signature.
+ */
+extern int openat(int fd, const char *file, int oflag, mode_t mode);
+libc_hidden_proto(openat)
+
+_syscall4(int, openat, int, fd, const char *, file, int, oflag, mode_t, mode)
+libc_hidden_def(openat)
+#else
+/* should add emulation with open() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/openat64.c b/ap/build/uClibc/libc/sysdeps/linux/common/openat64.c
new file mode 100644
index 0000000..06a5819
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/openat64.c
@@ -0,0 +1,32 @@
+/*
+ * openat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define openat64 __xx_openat
+#include <sys/syscall.h>
+#include <fcntl.h>
+#undef openat64
+
+#ifdef __UCLIBC_HAS_LFS__
+
+#ifdef __NR_openat
+/* The openat() prototype is varargs based, but we don't care about that
+ * here, so need to provide our own dedicated signature.
+ */
+extern int openat64(int fd, const char *file, int oflag, mode_t mode);
+libc_hidden_proto(openat64)
+
+int openat64(int fd, const char *file, int oflag, mode_t mode)
+{
+	return openat(fd, file, oflag | O_LARGEFILE, mode);
+}
+libc_hidden_def(openat64)
+#else
+/* should add emulation with open() and /proc/self/fd/ ... */
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/pause.c b/ap/build/uClibc/libc/sysdeps/linux/common/pause.c
new file mode 100644
index 0000000..ab16fa7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/pause.c
@@ -0,0 +1,41 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * pause() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define __UCLIBC_HIDE_DEPRECATED__
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <sysdep-cancel.h>
+#endif
+
+#include <signal.h>
+
+/* Suspend the process until a signal arrives.
+   This always returns -1 and sets errno to EINTR.  */
+extern __typeof(pause) __libc_pause;
+int
+__libc_pause (void)
+{
+  sigset_t set;
+
+  /*__sigemptyset (&set); - why? */
+  sigprocmask (SIG_BLOCK, NULL, &set);
+
+  /* pause is a cancellation point, but so is sigsuspend.
+     So no need for anything special here.  */
+
+  return sigsuspend (&set);
+}
+weak_alias (__libc_pause, pause)
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+LIBC_CANCEL_HANDLED ();		/* sigsuspend handles our cancellation.  */
+#endif
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/personality.c b/ap/build/uClibc/libc/sysdeps/linux/common/personality.c
new file mode 100644
index 0000000..fa304de
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/personality.c
@@ -0,0 +1,12 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * personality() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/personality.h>
+_syscall1(int, personality, unsigned long int, __persona)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/pipe.c b/ap/build/uClibc/libc/sysdeps/linux/common/pipe.c
new file mode 100644
index 0000000..8eae27c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/pipe.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * pipe() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+
+_syscall1(int, pipe, int *, filedes)
+libc_hidden_def(pipe)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/pipe2.c b/ap/build/uClibc/libc/sysdeps/linux/common/pipe2.c
new file mode 100644
index 0000000..0a3686d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/pipe2.c
@@ -0,0 +1,16 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * pipe2() for uClibc
+ *
+ * Copyright (C) 2011 Bernhard Reutner-Fischer <uclibc@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_pipe2
+_syscall2(int, pipe2, int *, filedes, int, flags)
+libc_hidden_def(pipe2)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/pivot_root.c b/ap/build/uClibc/libc/sysdeps/linux/common/pivot_root.c
new file mode 100644
index 0000000..0e738d5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/pivot_root.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * pivot_root() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+int pivot_root(const char *new_root, const char *put_old);
+#ifdef __NR_pivot_root
+_syscall2(int, pivot_root, const char *, new_root, const char *, put_old)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/poll.c b/ap/build/uClibc/libc/sysdeps/linux/common/poll.c
new file mode 100644
index 0000000..3895e0d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/poll.c
@@ -0,0 +1,230 @@
+/* Copyright (C) 1994,1996,1997,1998,1999,2001,2002
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/syscall.h>
+#include <sys/poll.h>
+#include <bits/kernel-features.h>
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <sysdep-cancel.h>
+#else
+#define SINGLE_THREAD_P 1
+#endif
+
+libc_hidden_proto(poll)
+
+#if defined __ASSUME_POLL_SYSCALL && defined __NR_poll
+
+#define __NR___syscall_poll __NR_poll
+static inline _syscall3(int, __syscall_poll, struct pollfd *, fds,
+			unsigned long int, nfds, int, timeout);
+
+int poll(struct pollfd *fds, nfds_t nfds, int timeout)
+{
+    if (SINGLE_THREAD_P)
+	return __syscall_poll(fds, nfds, timeout);
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+    int oldtype = LIBC_CANCEL_ASYNC ();
+    int result = __syscall_poll(fds, nfds, timeout);
+    LIBC_CANCEL_RESET (oldtype);
+    return result;
+#endif
+}
+#else /* !__NR_poll */
+
+#include <alloca.h>
+#include <sys/types.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/time.h>
+#include <sys/param.h>
+#include <unistd.h>
+
+libc_hidden_proto(getdtablesize)
+libc_hidden_proto(select)
+
+/* uClinux 2.0 doesn't have poll, emulate it using select */
+
+/* Poll the file descriptors described by the NFDS structures starting at
+   FDS.  If TIMEOUT is nonzero and not -1, allow TIMEOUT milliseconds for
+   an event to occur; if TIMEOUT is -1, block until an event occurs.
+   Returns the number of file descriptors with events, zero if timed out,
+   or -1 for errors.  */
+
+int poll(struct pollfd *fds, nfds_t nfds, int timeout)
+{
+    static int max_fd_size;
+    struct timeval tv;
+    fd_set *rset, *wset, *xset;
+    struct pollfd *f;
+    int ready;
+    int maxfd = 0;
+    int bytes;
+
+    if (!max_fd_size)
+	max_fd_size = getdtablesize ();
+
+    bytes = howmany (max_fd_size, __NFDBITS);
+    rset = alloca (bytes);
+    wset = alloca (bytes);
+    xset = alloca (bytes);
+
+    /* We can't call FD_ZERO, since FD_ZERO only works with sets
+       of exactly __FD_SETSIZE size.  */
+    memset (rset, 0, bytes);
+    memset (wset, 0, bytes);
+    memset (xset, 0, bytes);
+
+    for (f = fds; f < &fds[nfds]; ++f)
+    {
+	f->revents = 0;
+	if (f->fd >= 0)
+	{
+	    if (f->fd >= max_fd_size)
+	    {
+		/* The user provides a file descriptor number which is higher
+		   than the maximum we got from the `getdtablesize' call.
+		   Maybe this is ok so enlarge the arrays.  */
+		fd_set *nrset, *nwset, *nxset;
+		int nbytes;
+
+		max_fd_size = roundup (f->fd, __NFDBITS);
+		nbytes = howmany (max_fd_size, __NFDBITS);
+
+		nrset = alloca (nbytes);
+		nwset = alloca (nbytes);
+		nxset = alloca (nbytes);
+
+		memset ((char *) nrset + bytes, 0, nbytes - bytes);
+		memset ((char *) nwset + bytes, 0, nbytes - bytes);
+		memset ((char *) nxset + bytes, 0, nbytes - bytes);
+
+		rset = memcpy (nrset, rset, bytes);
+		wset = memcpy (nwset, wset, bytes);
+		xset = memcpy (nxset, xset, bytes);
+
+		bytes = nbytes;
+	    }
+
+	    if (f->events & POLLIN)
+		FD_SET (f->fd, rset);
+	    if (f->events & POLLOUT)
+		FD_SET (f->fd, wset);
+	    if (f->events & POLLPRI)
+		FD_SET (f->fd, xset);
+	    if (f->fd > maxfd && (f->events & (POLLIN|POLLOUT|POLLPRI)))
+		maxfd = f->fd;
+	}
+    }
+
+    tv.tv_sec = timeout / 1000;
+    tv.tv_usec = (timeout % 1000) * 1000;
+
+    while (1)
+    {
+	ready = select (maxfd + 1, rset, wset, xset,
+		timeout == -1 ? NULL : &tv);
+
+	/* It might be that one or more of the file descriptors is invalid.
+	   We now try to find and mark them and then try again.  */
+	if (ready == -1 && errno == EBADF)
+	{
+	    fd_set *sngl_rset = alloca (bytes);
+	    fd_set *sngl_wset = alloca (bytes);
+	    fd_set *sngl_xset = alloca (bytes);
+	    struct timeval sngl_tv;
+
+	    /* Clear the original set.  */
+	    memset (rset, 0, bytes);
+	    memset (wset, 0, bytes);
+	    memset (xset, 0, bytes);
+
+	    /* This means we don't wait for input.  */
+	    sngl_tv.tv_sec = 0;
+	    sngl_tv.tv_usec = 0;
+
+	    maxfd = -1;
+
+	    /* Reset the return value.  */
+	    ready = 0;
+
+	    for (f = fds; f < &fds[nfds]; ++f)
+		if (f->fd != -1 && (f->events & (POLLIN|POLLOUT|POLLPRI))
+			&& (f->revents & POLLNVAL) == 0)
+		{
+		    int n;
+
+		    memset (sngl_rset, 0, bytes);
+		    memset (sngl_wset, 0, bytes);
+		    memset (sngl_xset, 0, bytes);
+
+		    if (f->events & POLLIN)
+			FD_SET (f->fd, sngl_rset);
+		    if (f->events & POLLOUT)
+			FD_SET (f->fd, sngl_wset);
+		    if (f->events & POLLPRI)
+			FD_SET (f->fd, sngl_xset);
+
+		    n = select (f->fd + 1, sngl_rset, sngl_wset, sngl_xset,
+			    &sngl_tv);
+		    if (n != -1)
+		    {
+			/* This descriptor is ok.  */
+			if (f->events & POLLIN)
+			    FD_SET (f->fd, rset);
+			if (f->events & POLLOUT)
+			    FD_SET (f->fd, wset);
+			if (f->events & POLLPRI)
+			    FD_SET (f->fd, xset);
+			if (f->fd > maxfd)
+			    maxfd = f->fd;
+			if (n > 0)
+			    /* Count it as being available.  */
+			    ++ready;
+		    }
+		    else if (errno == EBADF)
+			f->revents |= POLLNVAL;
+		}
+	    /* Try again.  */
+	    continue;
+	}
+
+	break;
+    }
+
+    if (ready > 0)
+	for (f = fds; f < &fds[nfds]; ++f)
+	{
+	    if (f->fd >= 0)
+	    {
+		if (FD_ISSET (f->fd, rset))
+		    f->revents |= POLLIN;
+		if (FD_ISSET (f->fd, wset))
+		    f->revents |= POLLOUT;
+		if (FD_ISSET (f->fd, xset))
+		    f->revents |= POLLPRI;
+	    }
+	}
+
+    return ready;
+}
+
+#endif
+libc_hidden_def(poll)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/posix_fadvise.c b/ap/build/uClibc/libc/sysdeps/linux/common/posix_fadvise.c
new file mode 100644
index 0000000..17831c2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/posix_fadvise.c
@@ -0,0 +1,35 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * posix_fadvise() for uClibc
+ * http://www.opengroup.org/onlinepubs/009695399/functions/posix_fadvise.html
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <fcntl.h>
+
+#ifdef __NR_fadvise64
+#define __NR_posix_fadvise __NR_fadvise64
+int posix_fadvise(int fd, off_t offset, off_t len, int advice)
+{
+	INTERNAL_SYSCALL_DECL(err);
+	int ret = (int) (INTERNAL_SYSCALL(posix_fadvise, err, 5, fd,
+	 __LONG_LONG_PAIR (offset >> 31, offset), len, advice));
+    if (INTERNAL_SYSCALL_ERROR_P (ret, err))
+      return INTERNAL_SYSCALL_ERRNO (ret, err);
+    return 0;
+}
+
+#if defined __UCLIBC_HAS_LFS__ && !defined __NR_fadvise64_64
+strong_alias(posix_fadvise,posix_fadvise64)
+#endif
+
+#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)
+{
+	return ENOSYS;
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/posix_fadvise64.c b/ap/build/uClibc/libc/sysdeps/linux/common/posix_fadvise64.c
new file mode 100644
index 0000000..e8a530f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/posix_fadvise64.c
@@ -0,0 +1,70 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * posix_fadvise64() for uClibc
+ * http://www.opengroup.org/onlinepubs/009695399/functions/posix_fadvise.html
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <features.h>
+#include <unistd.h>
+#include <errno.h>
+#include <endian.h>
+#include <stdint.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <fcntl.h>
+
+#ifdef __UCLIBC_HAS_LFS__
+#ifdef __NR_fadvise64_64
+
+/* 64 bit implementation is cake ... or more like pie ... */
+#if __WORDSIZE == 64
+
+#define __NR_posix_fadvise64 __NR_fadvise64_64
+
+int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice)
+{
+  if (len != (off_t) len)
+    return EOVERFLOW;
+  INTERNAL_SYSCALL_DECL (err);
+    int ret = INTERNAL_SYSCALL (posix_fadvise64, err, 5, fd,
+                               __LONG_LONG_PAIR ((long) (offset >> 32),
+                                                 (long) offset),
+                               (off_t) len, advice);
+  if (!INTERNAL_SYSCALL_ERROR_P (ret, err))
+    return 0;
+  return INTERNAL_SYSCALL_ERRNO (ret, err);
+}
+
+/* 32 bit implementation is kind of a pita */
+#elif __WORDSIZE == 32
+
+int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice)
+{
+	INTERNAL_SYSCALL_DECL (err);
+	int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd,
+								__LONG_LONG_PAIR(offset >> 32, offset &  0xffffffff),
+								__LONG_LONG_PAIR(len >> 32, len & 0xffffffff),
+								advice);
+	if (!INTERNAL_SYSCALL_ERROR_P (ret, err))
+		return 0;
+	return INTERNAL_SYSCALL_ERRNO (ret, err);
+}
+
+#else
+#error your machine is neither 32 bit or 64 bit ... it must be magical
+#endif
+
+#elif !defined __NR_fadvise64 && defined __UCLIBC_HAS_STUBS__
+/* This is declared as a strong alias in posix_fadvise.c if __NR_fadvise64
+ * is defined.
+ */
+int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice)
+{
+	return ENOSYS;
+}
+#endif /* __NR_fadvise64_64 */
+#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/ppoll.c b/ap/build/uClibc/libc/sysdeps/linux/common/ppoll.c
new file mode 100644
index 0000000..09b2b15
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/ppoll.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <signal.h>
+#include <sys/syscall.h>
+#include <sys/poll.h>
+#define __need_NULL
+#include <stddef.h>
+
+#if defined __NR_ppoll && defined __UCLIBC_LINUX_SPECIFIC__
+# ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#  include <sysdep-cancel.h>
+# else
+#  define SINGLE_THREAD_P 1
+# endif
+
+int
+ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout,
+       const sigset_t *sigmask)
+{
+	/* The Linux kernel can in some situations update the timeout value.
+	   We do not want that so use a local variable.  */
+	struct timespec tval;
+	if (timeout != NULL) {
+		tval = *timeout;
+		timeout = &tval;
+	}
+  if (SINGLE_THREAD_P)
+		return INLINE_SYSCALL(ppoll, 5, fds, nfds, timeout, sigmask, _NSIG / 8);
+
+# ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype = LIBC_CANCEL_ASYNC ();
+	int result = INLINE_SYSCALL(ppoll, 5, fds, nfds, timeout, sigmask, _NSIG / 8);
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+# endif
+}
+libc_hidden_def(ppoll)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/prctl.c b/ap/build/uClibc/libc/sysdeps/linux/common/prctl.c
new file mode 100644
index 0000000..39c0d4f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/prctl.c
@@ -0,0 +1,17 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * prctl() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <stdarg.h>
+/* psm: including sys/prctl.h would depend on kernel headers */
+
+#ifdef __NR_prctl
+extern int prctl (int, long, long, long, long);
+_syscall5(int, prctl, int, option, long, _a2, long, _a3, long, _a4, long, _a5)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/pread_write.c b/ap/build/uClibc/libc/sysdeps/linux/common/pread_write.c
new file mode 100644
index 0000000..88e6957
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/pread_write.c
@@ -0,0 +1,187 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/*
+ * Based in part on the files
+ *		./sysdeps/unix/sysv/linux/pwrite.c,
+ *		./sysdeps/unix/sysv/linux/pread.c,
+ *		sysdeps/posix/pread.c
+ *		sysdeps/posix/pwrite.c
+ * from GNU libc 2.2.5, but reworked considerably...
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <stdint.h>
+#include <endian.h>
+
+extern __typeof(pread) __libc_pread;
+extern __typeof(pwrite) __libc_pwrite;
+#ifdef __UCLIBC_HAS_LFS__
+extern __typeof(pread64) __libc_pread64;
+extern __typeof(pwrite64) __libc_pwrite64;
+#endif
+
+#include <bits/kernel_types.h>
+
+#ifdef __NR_pread
+
+# define __NR___syscall_pread __NR_pread
+static __inline__ _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf,
+		size_t, count, off_t, offset_hi, off_t, offset_lo)
+
+ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
+{
+	return __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
+}
+weak_alias(__libc_pread,pread)
+
+# ifdef __UCLIBC_HAS_LFS__
+ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
+{
+	uint32_t low = offset & 0xffffffff;
+	uint32_t high = offset >> 32;
+	return __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low));
+}
+weak_alias(__libc_pread64,pread64)
+# endif /* __UCLIBC_HAS_LFS__  */
+
+#endif /* __NR_pread */
+
+#ifdef __NR_pwrite
+
+# define __NR___syscall_pwrite __NR_pwrite
+static __inline__ _syscall5(ssize_t, __syscall_pwrite, int, fd, const void *, buf,
+		size_t, count, off_t, offset_hi, off_t, offset_lo)
+
+ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset)
+{
+	return __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
+}
+weak_alias(__libc_pwrite,pwrite)
+
+# ifdef __UCLIBC_HAS_LFS__
+ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
+{
+	uint32_t low = offset & 0xffffffff;
+	uint32_t high = offset >> 32;
+	return __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low));
+}
+weak_alias(__libc_pwrite64,pwrite64)
+# endif /* __UCLIBC_HAS_LFS__  */
+#endif /* __NR_pwrite */
+
+#if ! defined __NR_pread || ! defined __NR_pwrite
+
+static ssize_t __fake_pread_write(int fd, void *buf,
+		size_t count, off_t offset, int do_pwrite)
+{
+	int save_errno;
+	ssize_t result;
+	off_t old_offset;
+
+	/* Since we must not change the file pointer preserve the
+	 * value so that we can restore it later.  */
+	if ((old_offset=lseek(fd, 0, SEEK_CUR)) == (off_t) -1)
+		return -1;
+
+	/* Set to wanted position.  */
+	if (lseek(fd, offset, SEEK_SET) == (off_t) -1)
+		return -1;
+
+	if (do_pwrite == 1) {
+		/* Write the data.  */
+		result = write(fd, buf, count);
+	} else {
+		/* Read the data.  */
+		result = read(fd, buf, count);
+	}
+
+	/* Now we have to restore the position.  If this fails we
+	 * have to return this as an error.  */
+	save_errno = errno;
+	if (lseek(fd, old_offset, SEEK_SET) == (off_t) -1)
+	{
+		if (result == -1)
+			__set_errno(save_errno);
+		return -1;
+	}
+	__set_errno(save_errno);
+	return(result);
+}
+
+# ifdef __UCLIBC_HAS_LFS__
+
+static ssize_t __fake_pread_write64(int fd, void *buf,
+		size_t count, off64_t offset, int do_pwrite)
+{
+	int save_errno;
+	ssize_t result;
+	off64_t old_offset;
+
+	/* Since we must not change the file pointer preserve the
+	 * value so that we can restore it later.  */
+	if ((old_offset=lseek64(fd, 0, SEEK_CUR)) == (off64_t) -1)
+		return -1;
+
+	/* Set to wanted position.  */
+	if (lseek64(fd, offset, SEEK_SET) == (off64_t) -1)
+		return -1;
+
+	if (do_pwrite == 1) {
+		/* Write the data.  */
+		result = write(fd, buf, count);
+	} else {
+		/* Read the data.  */
+		result = read(fd, buf, count);
+	}
+
+	/* Now we have to restore the position. */
+	save_errno = errno;
+	if (lseek64(fd, old_offset, SEEK_SET) == (off64_t) -1) {
+		if (result == -1)
+			__set_errno (save_errno);
+		return -1;
+	}
+	__set_errno (save_errno);
+	return result;
+}
+# endif /* __UCLIBC_HAS_LFS__  */
+#endif /*  ! defined __NR_pread || ! defined __NR_pwrite */
+
+#ifndef __NR_pread
+ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
+{
+	return __fake_pread_write(fd, buf, count, offset, 0);
+}
+weak_alias(__libc_pread,pread)
+
+# ifdef __UCLIBC_HAS_LFS__
+ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
+{
+	return __fake_pread_write64(fd, buf, count, offset, 0);
+}
+weak_alias(__libc_pread64,pread64)
+# endif /* __UCLIBC_HAS_LFS__  */
+#endif /* ! __NR_pread */
+
+#ifndef __NR_pwrite
+ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset)
+{
+	/* we won't actually be modifying the buffer,
+	 *just cast it to get rid of warnings */
+	return __fake_pread_write(fd, (void*)buf, count, offset, 1);
+}
+weak_alias(__libc_pwrite,pwrite)
+
+# ifdef __UCLIBC_HAS_LFS__
+ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
+{
+	return __fake_pread_write64(fd, (void*)buf, count, offset, 1);
+}
+weak_alias(__libc_pwrite64,pwrite64)
+# endif /* __UCLIBC_HAS_LFS__  */
+#endif /* ! __NR_pwrite */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/pselect.c b/ap/build/uClibc/libc/sysdeps/linux/common/pselect.c
new file mode 100644
index 0000000..7e93537
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/pselect.c
@@ -0,0 +1,94 @@
+/* Copyright (C) 1996-1998,2001,2002,2003,2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <signal.h>
+#include <stddef.h>	/* For NULL.  */
+#include <sys/time.h>
+#include <sys/select.h>
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <sysdep-cancel.h>
+#endif
+
+libc_hidden_proto(sigprocmask)
+libc_hidden_proto(select)
+
+
+/* Check the first NFDS descriptors each in READFDS (if not NULL) for read
+   readiness, in WRITEFDS (if not NULL) for write readiness, and in EXCEPTFDS
+   (if not NULL) for exceptional conditions.  If TIMEOUT is not NULL, time out
+   after waiting the interval specified therein.  Additionally set the sigmask
+   SIGMASK for this call.  Returns the number of ready descriptors, or -1 for
+   errors.  */
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+static int
+__pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
+#else
+int
+pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
+#endif
+	   const struct timespec *timeout, const sigset_t *sigmask)
+{
+  struct timeval tval;
+  int retval;
+  sigset_t savemask;
+
+  /* Change nanosecond number to microseconds.  This might mean losing
+     precision and therefore the `pselect` should be available.  But
+     for now it is hardly found.  */
+  if (timeout != NULL)
+    TIMESPEC_TO_TIMEVAL (&tval, timeout);
+
+  /* The setting and restoring of the signal mask and the select call
+     should be an atomic operation.  This can't be done without kernel
+     help.  */
+  if (sigmask != NULL)
+    sigprocmask (SIG_SETMASK, sigmask, &savemask);
+
+  /* Note the pselect() is a cancellation point.  But since we call
+     select() which itself is a cancellation point we do not have
+     to do anything here.  */
+  retval = select (nfds, readfds, writefds, exceptfds,
+		     timeout != NULL ? &tval : NULL);
+
+  if (sigmask != NULL)
+    sigprocmask (SIG_SETMASK, &savemask, NULL);
+
+  return retval;
+}
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+int
+pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
+	   const struct timespec *timeout, const sigset_t *sigmask)
+{
+	if (SINGLE_THREAD_P)
+		return __pselect (nfds, readfds, writefds, exceptfds,
+				  timeout, sigmask);
+
+	int oldtype = LIBC_CANCEL_ASYNC ();
+
+	int result = __pselect (nfds, readfds, writefds, exceptfds,
+				 timeout, sigmask);
+
+	LIBC_CANCEL_RESET (oldtype);
+
+	return result;
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/ptrace.c b/ap/build/uClibc/libc/sysdeps/linux/common/ptrace.c
new file mode 100644
index 0000000..8b8ebf0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/ptrace.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/types.h>
+#include <sys/ptrace.h>
+#include <stdarg.h>
+
+#if defined __NR_ptrace && defined __USE_BSD && defined __USE_MISC
+#define __NR___syscall_ptrace __NR_ptrace
+
+static __inline__ _syscall4(long, __syscall_ptrace, enum __ptrace_request, request,
+		__kernel_pid_t, pid, void*, addr, void*, data)
+
+long int
+ptrace (enum __ptrace_request request, ...)
+{
+  long int res, ret;
+  va_list ap;
+  pid_t pid;
+  void *addr, *data;
+
+  va_start (ap, request);
+  pid = va_arg (ap, pid_t);
+  addr = va_arg (ap, void *);
+  data = va_arg (ap, void *);
+  va_end (ap);
+
+  if (request > 0 && request < 4)
+    data = &ret;
+
+  res = __syscall_ptrace(request, pid, addr, data);
+  if (res >= 0 && request > 0 && request < 4) {
+      __set_errno(0);
+      return ret;
+    }
+
+  return res;
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/query_module.c b/ap/build/uClibc/libc/sysdeps/linux/common/query_module.c
new file mode 100644
index 0000000..7c168df
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/query_module.c
@@ -0,0 +1,16 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * query_module() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+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);
+#ifdef __NR_query_module
+_syscall5(int, query_module, const char *, name, int, which,
+		  void *, buf, size_t, bufsize, size_t *, ret)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/quotactl.c b/ap/build/uClibc/libc/sysdeps/linux/common/quotactl.c
new file mode 100644
index 0000000..edd5092
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/quotactl.c
@@ -0,0 +1,16 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * quotactl() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+#if defined __USE_BSD
+#include <sys/quota.h>
+_syscall4(int, quotactl, int, cmd, const char *, special,
+		  int, id, caddr_t, addr)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/read.c b/ap/build/uClibc/libc/sysdeps/linux/common/read.c
new file mode 100644
index 0000000..9e122fc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/read.c
@@ -0,0 +1,19 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * read() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+_syscall3(ssize_t, read, int, fd, __ptr_t, buf, size_t, count)
+#ifndef __LINUXTHREADS_OLD__
+libc_hidden_def(read)
+#else
+libc_hidden_weak(read)
+strong_alias(read,__libc_read)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/readahead.c b/ap/build/uClibc/libc/sysdeps/linux/common/readahead.c
new file mode 100644
index 0000000..cd40352
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/readahead.c
@@ -0,0 +1,58 @@
+/* Provide kernel hint to read ahead.
+   Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <bits/wordsize.h>
+
+#ifdef __UCLIBC_HAS_LFS__
+
+#include <_lfs_64.h>
+
+#ifdef __NR_readahead
+
+# define __NR___readahead __NR_readahead
+
+# if __WORDSIZE == 64
+
+static __inline__ _syscall3(ssize_t, __readahead, int, fd,
+	off_t, offset, size_t, count)
+
+ssize_t readahead(int fd, off_t offset, size_t count)
+{
+	return __readahead(fd, offset, count);
+}
+
+# else
+
+static __inline__ _syscall4(ssize_t, __readahead, int, fd,
+	off_t, high_offset, off_t, low_offset, size_t, count)
+
+ssize_t readahead(int fd, off64_t offset, size_t count)
+{
+	return __readahead(fd, (off_t) (offset >> 32), (off_t) (offset & 0xffffffff), count);
+}
+
+# endif
+
+#endif
+
+#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/readlink.c b/ap/build/uClibc/libc/sysdeps/linux/common/readlink.c
new file mode 100644
index 0000000..ef9e835
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/readlink.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * readlink() for uClibc
+ *
+ * Copyright (C) 2000-2007 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+_syscall3(ssize_t, readlink, const char *, path, char *, buf, size_t, bufsiz)
+libc_hidden_def(readlink)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/readlinkat.c b/ap/build/uClibc/libc/sysdeps/linux/common/readlinkat.c
new file mode 100644
index 0000000..d0a98e1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/readlinkat.c
@@ -0,0 +1,16 @@
+/*
+ * readlinkat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_readlinkat
+_syscall4(ssize_t, readlinkat, int, fd, const char *, path, char *, buf, size_t, len)
+#else
+/* should add emulation with readlink() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/readv.c b/ap/build/uClibc/libc/sysdeps/linux/common/readv.c
new file mode 100644
index 0000000..fce396d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/readv.c
@@ -0,0 +1,50 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * readv() for uClibc
+ *
+ * Copyright (C) 2006 by Steven J. Hill <sjhill@realitydiluted.com>
+ * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/uio.h>
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <sysdep-cancel.h>
+
+/* We should deal with kernel which have a smaller UIO_FASTIOV as well
+   as a very big count.  */
+static ssize_t __readv (int fd, const struct iovec *vector, int count)
+{
+  ssize_t bytes_read;
+
+  bytes_read = INLINE_SYSCALL (readv, 3, fd, vector, count);
+
+  if (bytes_read >= 0 || errno != EINVAL || count <= UIO_FASTIOV)
+    return bytes_read;
+
+  /* glibc tries again, but we do not. */
+  //return __atomic_readv_replacement (fd, vector, count);
+
+  return -1;
+}
+
+ssize_t readv (int fd, const struct iovec *vector, int count)
+{
+  if (SINGLE_THREAD_P)
+    return __readv (fd, vector, count);
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  int result = __readv (fd, vector, count);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
+}
+#else
+_syscall3(ssize_t, readv, int, filedes, const struct iovec *, vector,
+		  int, count)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/reboot.c b/ap/build/uClibc/libc/sysdeps/linux/common/reboot.c
new file mode 100644
index 0000000..ec271b1
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/reboot.c
@@ -0,0 +1,17 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * _reboot() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/reboot.h>
+#define __NR__reboot __NR_reboot
+static __inline__ _syscall3(int, _reboot, int, magic, int, magic2, int, flag)
+int reboot(int flag)
+{
+	return (_reboot((int) 0xfee1dead, 672274793, flag));
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/remap_file_pages.c b/ap/build/uClibc/libc/sysdeps/linux/common/remap_file_pages.c
new file mode 100644
index 0000000..0512b88
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/remap_file_pages.c
@@ -0,0 +1,16 @@
+/*
+ * remap_file_pages() for uClibc
+ *
+ * Copyright (C) 2008 Will Newton <will.newton@imgtec.com>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+#include <sys/mman.h>
+#include <sys/syscall.h>
+
+#ifdef __NR_remap_file_pages
+
+_syscall5(int, remap_file_pages, void *, __start, size_t, __size,
+			int, __prot, size_t, __pgoff, int, __flags)
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/rename.c b/ap/build/uClibc/libc/sysdeps/linux/common/rename.c
new file mode 100644
index 0000000..9d8397a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/rename.c
@@ -0,0 +1,24 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * rename() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/param.h>
+#include <stdio.h>
+
+#define __NR___syscall_rename __NR_rename
+static __inline__ _syscall2(int, __syscall_rename, const char *, oldpath,
+		const char *, newpath)
+
+int rename(const char * oldpath, const char * newpath)
+{
+	return __syscall_rename(oldpath, newpath);
+}
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/renameat.c b/ap/build/uClibc/libc/sysdeps/linux/common/renameat.c
new file mode 100644
index 0000000..a898f7b
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/renameat.c
@@ -0,0 +1,16 @@
+/*
+ * renameat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <stdio.h>
+
+#ifdef __NR_renameat
+_syscall4(int, renameat, int, oldfd, const char *, old, int, newfd, const char *, new)
+#else
+/* should add emulation with rename() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/rmdir.c b/ap/build/uClibc/libc/sysdeps/linux/common/rmdir.c
new file mode 100644
index 0000000..bad6654
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/rmdir.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * rmdir() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+
+_syscall1(int, rmdir, const char *, pathname)
+libc_hidden_def(rmdir)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sbrk.c b/ap/build/uClibc/libc/sysdeps/linux/common/sbrk.c
new file mode 100644
index 0000000..4f0a8c4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sbrk.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <unistd.h>
+#include <errno.h>
+
+
+/* Defined in brk.c.  */
+extern void *__curbrk attribute_hidden;
+
+/* Extend the process's data space by INCREMENT.
+   If INCREMENT is negative, shrink data space by - INCREMENT.
+   Return start of new space allocated, or -1 for errors.  */
+void * sbrk (intptr_t increment)
+{
+    void *oldbrk;
+
+    if (__curbrk == NULL)
+	if (brk (NULL) < 0)	/* Initialize the break.  */
+	    return (void *) -1;
+
+    if (increment == 0)
+	return __curbrk;
+
+    oldbrk = __curbrk;
+    if (brk (oldbrk + increment) < 0)
+	return (void *) -1;
+
+    return oldbrk;
+}
+libc_hidden_def(sbrk)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_cpucount.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_cpucount.c
new file mode 100644
index 0000000..331c0b8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_cpucount.c
@@ -0,0 +1,60 @@
+/* Copyright (C) 2007 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <limits.h>
+#include <sched.h>
+
+
+int
+__sched_cpucount (size_t setsize, const cpu_set_t *setp)
+{
+  int s = 0;
+  const __cpu_mask *p = setp->__bits;
+  const __cpu_mask *end = &setp->__bits[setsize / sizeof (__cpu_mask)];
+
+  while (p < end)
+    {
+      __cpu_mask l = *p++;
+
+#ifdef POPCNT
+      s += POPCNT (l);
+#else
+      if (l == 0)
+	continue;
+
+# if LONG_BIT > 32
+      l = (l & 0x5555555555555555ul) + ((l >> 1) & 0x5555555555555555ul);
+      l = (l & 0x3333333333333333ul) + ((l >> 2) & 0x3333333333333333ul);
+      l = (l & 0x0f0f0f0f0f0f0f0ful) + ((l >> 4) & 0x0f0f0f0f0f0f0f0ful);
+      l = (l & 0x00ff00ff00ff00fful) + ((l >> 8) & 0x00ff00ff00ff00fful);
+      l = (l & 0x0000ffff0000fffful) + ((l >> 16) & 0x0000ffff0000fffful);
+      l = (l & 0x00000000fffffffful) + ((l >> 32) & 0x00000000fffffffful);
+# else
+      l = (l & 0x55555555ul) + ((l >> 1) & 0x55555555ul);
+      l = (l & 0x33333333ul) + ((l >> 2) & 0x33333333ul);
+      l = (l & 0x0f0f0f0ful) + ((l >> 4) & 0x0f0f0f0ful);
+      l = (l & 0x00ff00fful) + ((l >> 8) & 0x00ff00fful);
+      l = (l & 0x0000fffful) + ((l >> 16) & 0x0000fffful);
+# endif
+
+      s += l;
+#endif
+    }
+
+  return s;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_get_priority_max.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_get_priority_max.c
new file mode 100644
index 0000000..cf5447c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_get_priority_max.c
@@ -0,0 +1,12 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sched_get_priority_max() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sched.h>
+_syscall1(int, sched_get_priority_max, int, policy)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_get_priority_min.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_get_priority_min.c
new file mode 100644
index 0000000..884efed
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_get_priority_min.c
@@ -0,0 +1,12 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sched_get_priority_min() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sched.h>
+_syscall1(int, sched_get_priority_min, int, policy)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_getaffinity.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_getaffinity.c
new file mode 100644
index 0000000..8982582
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_getaffinity.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <features.h>
+#ifdef __USE_GNU
+
+#include <sched.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+#include <string.h>
+#include <sys/param.h>
+
+#if defined __NR_sched_getaffinity
+#define __NR___syscall_sched_getaffinity __NR_sched_getaffinity
+static __inline__ _syscall3(int, __syscall_sched_getaffinity, __kernel_pid_t, pid,
+			size_t, cpusetsize, cpu_set_t *, cpuset)
+
+int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *cpuset)
+{
+	int res = (__syscall_sched_getaffinity(pid, MIN(INT_MAX, cpusetsize),
+					       cpuset));
+
+	if (res != -1) {
+		/* Clean the rest of the memory the kernel didn't do.  */
+		memset ((char *) cpuset + res, '\0', cpusetsize - res);
+
+		res = 0;
+	}
+	return res;
+}
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_getcpu.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_getcpu.c
new file mode 100644
index 0000000..bc858ba
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_getcpu.c
@@ -0,0 +1,24 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sched_getcpu() for uClibc
+ *
+ * Copyright (C) 2011 Bernhard Reutner-Fischer <uclibc@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <stdlib.h>
+#include <errno.h>
+#include <sched.h>
+#include <sysdep.h>
+
+#if defined __NR_getcpu
+int
+sched_getcpu (void)
+{
+  unsigned int cpu;
+  int r = INLINE_SYSCALL (getcpu, 3, &cpu, NULL, NULL);
+
+  return r == -1 ? r : cpu;
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_getparam.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_getparam.c
new file mode 100644
index 0000000..eb17e25
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_getparam.c
@@ -0,0 +1,21 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sched_getparam() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sched.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+#define __NR___syscall_sched_getparam __NR_sched_getparam
+static __inline__ _syscall2(int, __syscall_sched_getparam,
+		__kernel_pid_t, pid, struct sched_param *, p)
+
+int sched_getparam(pid_t pid, struct sched_param *p)
+{
+	return (__syscall_sched_getparam(pid, p));
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_getscheduler.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_getscheduler.c
new file mode 100644
index 0000000..e657abd
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_getscheduler.c
@@ -0,0 +1,20 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sched_getscheduler() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sched.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+#define __NR___syscall_sched_getscheduler __NR_sched_getscheduler
+static __inline__ _syscall1(int, __syscall_sched_getscheduler, __kernel_pid_t, pid)
+
+int sched_getscheduler(pid_t pid)
+{
+	return (__syscall_sched_getscheduler(pid));
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_rr_get_interval.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_rr_get_interval.c
new file mode 100644
index 0000000..31d620f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_rr_get_interval.c
@@ -0,0 +1,21 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sched_rr_get_interval() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sched.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+#define __NR___syscall_sched_rr_get_interval __NR_sched_rr_get_interval
+static __inline__ _syscall2(int, __syscall_sched_rr_get_interval,
+		__kernel_pid_t, pid, struct timespec *, tp)
+
+int sched_rr_get_interval(pid_t pid, struct timespec *tp)
+{
+	return (__syscall_sched_rr_get_interval(pid, tp));
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_setaffinity.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_setaffinity.c
new file mode 100644
index 0000000..980c441
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_setaffinity.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <features.h>
+#ifdef __USE_GNU
+
+#include <sched.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <alloca.h>
+
+#if defined __NR_sched_setaffinity
+
+#define __NR___syscall_sched_setaffinity __NR_sched_setaffinity
+static __inline__ _syscall3(int, __syscall_sched_setaffinity, __kernel_pid_t, pid,
+			size_t, cpusetsize, cpu_set_t *, cpuset)
+
+static size_t __kernel_cpumask_size;
+
+int sched_setaffinity(pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)
+{
+	size_t cnt;
+	if (unlikely (__kernel_cpumask_size == 0)) {
+		INTERNAL_SYSCALL_DECL (err);
+		int res;
+		size_t psize = 128;
+		void *p = alloca (psize);
+
+		while (res = INTERNAL_SYSCALL (sched_getaffinity, err, 3, getpid (),
+					       psize, p),
+		       INTERNAL_SYSCALL_ERROR_P (res, err)
+		       && INTERNAL_SYSCALL_ERRNO (res, err) == EINVAL)
+			p = extend_alloca (p, psize, 2 * psize);
+
+		if (res == 0 || INTERNAL_SYSCALL_ERROR_P (res, err)) {
+			__set_errno (INTERNAL_SYSCALL_ERRNO (res, err));
+			return -1;
+		}
+
+		__kernel_cpumask_size = res;
+	}
+
+	/* We now know the size of the kernel cpumask_t.  Make sure the user
+	   does not request to set a bit beyond that.  */
+	for (cnt = __kernel_cpumask_size; cnt < cpusetsize; ++cnt)
+		if (((char *) cpuset)[cnt] != '\0') {
+			/* Found a nonzero byte.  This means the user request cannot be
+			   fulfilled.  */
+			__set_errno (EINVAL);
+			return -1;
+		}
+
+	return INLINE_SYSCALL (sched_setaffinity, 3, pid, cpusetsize, cpuset);
+}
+#endif
+#endif /* __USE_GNU */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_setparam.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_setparam.c
new file mode 100644
index 0000000..0f5f74f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_setparam.c
@@ -0,0 +1,21 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sched_setparam() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sched.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+#define __NR___syscall_sched_setparam __NR_sched_setparam
+static __inline__ _syscall2(int, __syscall_sched_setparam,
+		__kernel_pid_t, pid, const struct sched_param *, p)
+
+int sched_setparam(pid_t pid, const struct sched_param *p)
+{
+	return (__syscall_sched_setparam(pid, p));
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_setscheduler.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_setscheduler.c
new file mode 100644
index 0000000..0af498f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_setscheduler.c
@@ -0,0 +1,21 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sched_setscheduler() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sched.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+#define __NR___syscall_sched_setscheduler __NR_sched_setscheduler
+static __inline__ _syscall3(int, __syscall_sched_setscheduler,
+		__kernel_pid_t, pid, int, policy, const struct sched_param *, p)
+
+int sched_setscheduler(pid_t pid, int policy, const struct sched_param *p)
+{
+	return (__syscall_sched_setscheduler(pid, policy, p));
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sched_yield.c b/ap/build/uClibc/libc/sysdeps/linux/common/sched_yield.c
new file mode 100644
index 0000000..2d584bd
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sched_yield.c
@@ -0,0 +1,12 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sched_yield() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sched.h>
+_syscall0(int, sched_yield)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/select.c b/ap/build/uClibc/libc/sysdeps/linux/common/select.c
new file mode 100644
index 0000000..029fb08
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/select.c
@@ -0,0 +1,94 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * select() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/select.h>
+#include <stdint.h>
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <sysdep-cancel.h>
+#else
+#define SINGLE_THREAD_P 1
+#endif
+
+#define USEC_PER_SEC 1000000L
+
+extern __typeof(select) __libc_select;
+
+#if !defined(__NR__newselect) && !defined(__NR_select) && defined __USE_XOPEN2K
+# define __NR___libc_pselect6 __NR_pselect6
+static _syscall6(int, __libc_pselect6, int, n, fd_set *, readfds, fd_set *, writefds,
+        fd_set *, exceptfds, const struct timespec *, timeout,
+        const sigset_t *, sigmask)
+
+int __libc_select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
+                  struct timeval *timeout)
+{
+	struct timespec _ts, *ts = 0;
+	if (timeout) {
+		uint32_t usec;
+		_ts.tv_sec = timeout->tv_sec;
+
+		/* GNU extension: allow for timespec values where the sub-sec
+		* field is equal to or more than 1 second.  The kernel will
+		* reject this on us, so take care of the time shift ourself.
+		* Some applications (like readline and linphone) do this.
+		* See 'clarification on select() type calls and invalid timeouts'
+		* on the POSIX general list for more information.
+		*/
+		usec = timeout->tv_usec;
+		if (usec >= USEC_PER_SEC) {
+			_ts.tv_sec += usec / USEC_PER_SEC;
+			usec %= USEC_PER_SEC;
+		}
+		_ts.tv_nsec = usec * 1000;
+
+		ts = &_ts;
+	}
+
+	if (SINGLE_THREAD_P)
+		return __libc_pselect6(n, readfds, writefds, exceptfds, ts, 0);
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype = LIBC_CANCEL_ASYNC ();
+	int result = __libc_pselect6(n, readfds, writefds, exceptfds, ts, 0);
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+#endif
+
+}
+
+#else
+
+#ifdef __NR__newselect
+# define __NR___syscall_select __NR__newselect
+#else
+# define __NR___syscall_select __NR_select
+#endif
+
+static _syscall5(int, __syscall_select, int, n, fd_set *, readfds,
+		fd_set *, writefds, fd_set *, exceptfds, struct timeval *, timeout);
+
+int __libc_select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
+                  struct timeval *timeout)
+{
+	if (SINGLE_THREAD_P)
+		return __syscall_select(n, readfds, writefds, exceptfds, timeout);
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype = LIBC_CANCEL_ASYNC ();
+	int result = __syscall_select(n, readfds, writefds, exceptfds, timeout);
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+#endif
+}
+
+#endif
+
+weak_alias(__libc_select,select)
+libc_hidden_weak(select)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sendfile.c b/ap/build/uClibc/libc/sysdeps/linux/common/sendfile.c
new file mode 100644
index 0000000..89bab9f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sendfile.c
@@ -0,0 +1,23 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sendfile() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <sys/sendfile.h>
+
+#ifdef __NR_sendfile
+
+_syscall4(ssize_t, sendfile, int, out_fd, int, in_fd, __off_t *, offset,
+		  size_t, count)
+
+#if ! defined __NR_sendfile64 && defined __UCLIBC_HAS_LFS__
+strong_alias(sendfile,sendfile64)
+#endif
+
+#endif /* __NR_sendfile */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sendfile64.c b/ap/build/uClibc/libc/sysdeps/linux/common/sendfile64.c
new file mode 100644
index 0000000..fc5155f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sendfile64.c
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* sendfile64 syscall.  Copes with 64 bit and 32 bit machines
+ * and on 32 bit machines this sends things into the kernel as
+ * two 32-bit arguments (high and low 32 bits of length) that
+ * are ordered based on endianess.  It turns out endian.h has
+ * just the macro we need to order things, __LONG_LONG_PAIR.
+ */
+
+#include <features.h>
+#include <unistd.h>
+#include <errno.h>
+#include <endian.h>
+#include <stdint.h>
+#include <sys/sendfile.h>
+#include <sys/syscall.h>
+#include <bits/wordsize.h>
+
+#if defined __UCLIBC_HAS_LFS__ && defined __NR_sendfile64
+_syscall4(ssize_t,sendfile64, int, out_fd, int, in_fd, __off64_t *, offset, size_t, count)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setdomainname.c b/ap/build/uClibc/libc/sysdeps/linux/common/setdomainname.c
new file mode 100644
index 0000000..6b768b7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setdomainname.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setdomainname() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
+_syscall2(int, setdomainname, const char *, name, size_t, len)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setegid.c b/ap/build/uClibc/libc/sysdeps/linux/common/setegid.c
new file mode 100644
index 0000000..eae57f5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setegid.c
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <errno.h>
+#include <grp.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+
+#if !defined __UCLIBC_LINUX_SPECIFIC__
+#undef __NR_setresgid
+#undef __NR_setresgid32
+#endif
+
+int setegid(gid_t gid)
+{
+    int result;
+
+    if (gid == (gid_t) ~0)
+    {
+	__set_errno (EINVAL);
+	return -1;
+    }
+
+#if (defined __NR_setresgid || defined __NR_setresgid32) && defined __USE_GNU
+    result = setresgid(-1, gid, -1);
+    if (result == -1 && errno == ENOSYS)
+	/* Will also set the saved group ID if egid != gid,
+	 * making it impossible to switch back...*/
+#endif
+	result = setregid(-1, gid);
+
+    return result;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/seteuid.c b/ap/build/uClibc/libc/sysdeps/linux/common/seteuid.c
new file mode 100644
index 0000000..3e1611d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/seteuid.c
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <errno.h>
+#include <pwd.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+#if !defined __UCLIBC_LINUX_SPECIFIC__
+#undef __NR_setresuid
+#undef __NR_setresuid32
+#endif
+
+int seteuid(uid_t uid)
+{
+    int result;
+
+    if (uid == (uid_t) ~0)
+    {
+	__set_errno (EINVAL);
+	return -1;
+    }
+
+#if (defined __NR_setresuid || defined __NR_setresuid32) && defined __USE_GNU
+    result = setresuid(-1, uid, -1);
+    if (result == -1 && errno == ENOSYS)
+	/* Will also set the saved user ID if euid != uid,
+	 * making it impossible to switch back...*/
+#endif
+	result = setreuid(-1, uid);
+
+    return result;
+}
+libc_hidden_def(seteuid)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setfsgid.c b/ap/build/uClibc/libc/sysdeps/linux/common/setfsgid.c
new file mode 100644
index 0000000..78d35dd
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setfsgid.c
@@ -0,0 +1,35 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setfsgid() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/fsuid.h>
+#include <bits/wordsize.h>
+
+#if (__WORDSIZE == 32 && defined(__NR_setfsgid32)) || __WORDSIZE == 64
+# ifdef __NR_setfsgid32
+#  undef __NR_setfsgid
+#  define __NR_setfsgid __NR_setfsgid32
+# endif
+
+_syscall1(int, setfsgid, gid_t, gid)
+
+#else
+
+# define __NR___syscall_setfsgid __NR_setfsgid
+static __inline__ _syscall1(int, __syscall_setfsgid, __kernel_gid_t, gid)
+
+int setfsgid(gid_t gid)
+{
+	if (gid != (gid_t) ((__kernel_gid_t) gid)) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return (__syscall_setfsgid(gid));
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setfsuid.c b/ap/build/uClibc/libc/sysdeps/linux/common/setfsuid.c
new file mode 100644
index 0000000..a7372bd
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setfsuid.c
@@ -0,0 +1,35 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setfsuid() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/fsuid.h>
+#include <bits/wordsize.h>
+
+#if (__WORDSIZE == 32 && defined(__NR_setfsuid32)) || __WORDSIZE == 64
+# ifdef __NR_setfsuid32
+#  undef __NR_setfsuid
+#  define __NR_setfsuid __NR_setfsuid32
+# endif
+
+_syscall1(int, setfsuid, uid_t, uid)
+
+#else
+
+# define __NR___syscall_setfsuid __NR_setfsuid
+static __inline__ _syscall1(int, __syscall_setfsuid, __kernel_uid_t, uid)
+
+int setfsuid(uid_t uid)
+{
+	if (uid != (uid_t) ((__kernel_uid_t) uid)) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return (__syscall_setfsuid(uid));
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setgid.c b/ap/build/uClibc/libc/sysdeps/linux/common/setgid.c
new file mode 100644
index 0000000..88341ba
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setgid.c
@@ -0,0 +1,35 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setgid() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <bits/wordsize.h>
+
+#if (__WORDSIZE == 32 && defined(__NR_setgid32)) || __WORDSIZE == 64
+# ifdef __NR_setgid32
+#  undef __NR_setgid
+#  define __NR_setgid __NR_setgid32
+# endif
+
+_syscall1(int, setgid, gid_t, gid)
+
+#else
+
+# define __NR___syscall_setgid __NR_setgid
+static __inline__ _syscall1(int, __syscall_setgid, __kernel_gid_t, gid)
+
+int setgid(gid_t gid)
+{
+	if (gid == (gid_t) ~ 0 || gid != (gid_t) ((__kernel_gid_t) gid)) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return (__syscall_setgid(gid));
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setgroups.c b/ap/build/uClibc/libc/sysdeps/linux/common/setgroups.c
new file mode 100644
index 0000000..72c9878
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setgroups.c
@@ -0,0 +1,64 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setgroups() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <grp.h>
+
+#ifdef __USE_BSD
+
+
+#if defined(__NR_setgroups32)
+# undef __NR_setgroups
+# define __NR_setgroups __NR_setgroups32
+_syscall2(int, setgroups, size_t, size, const gid_t *, list)
+
+#elif __WORDSIZE == 64
+_syscall2(int, setgroups, size_t, size, const gid_t *, list)
+
+#else
+
+
+#define __NR___syscall_setgroups __NR_setgroups
+static __inline__ _syscall2(int, __syscall_setgroups,
+		size_t, size, const __kernel_gid_t *, list)
+
+int setgroups(size_t size, const gid_t *groups)
+{
+	if (size > (size_t) sysconf(_SC_NGROUPS_MAX)) {
+ret_error:
+		__set_errno(EINVAL);
+		return -1;
+	} else {
+		size_t i;
+		__kernel_gid_t *kernel_groups = NULL;
+
+		if (size) {
+			kernel_groups = (__kernel_gid_t *)malloc(sizeof(*kernel_groups) * size);
+			if (kernel_groups == NULL)
+				goto ret_error;
+		}
+
+		for (i = 0; i < size; i++) {
+			kernel_groups[i] = (groups)[i];
+			if (groups[i] != (gid_t) ((__kernel_gid_t) groups[i])) {
+				goto ret_error;
+			}
+		}
+
+		i = __syscall_setgroups(size, kernel_groups);
+		free(kernel_groups);
+		return i;
+	}
+}
+#endif
+
+libc_hidden_def(setgroups)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sethostname.c b/ap/build/uClibc/libc/sysdeps/linux/common/sethostname.c
new file mode 100644
index 0000000..1ceb2a0
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sethostname.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sethostname() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
+_syscall2(int, sethostname, const char *, name, size_t, len)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setitimer.c b/ap/build/uClibc/libc/sysdeps/linux/common/setitimer.c
new file mode 100644
index 0000000..427ff1e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setitimer.c
@@ -0,0 +1,16 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setitimer() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/time.h>
+
+
+_syscall3(int, setitimer, __itimer_which_t, which,
+		  const struct itimerval *, new, struct itimerval *, old)
+libc_hidden_def(setitimer)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setpgid.c b/ap/build/uClibc/libc/sysdeps/linux/common/setpgid.c
new file mode 100644
index 0000000..0410c64
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setpgid.c
@@ -0,0 +1,25 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setpgid() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+#if defined __USE_UNIX98 || defined __USE_SVID
+#include <unistd.h>
+
+
+#define __NR___syscall_setpgid __NR_setpgid
+static __inline__ _syscall2(int, __syscall_setpgid,
+		__kernel_pid_t, pid, __kernel_pid_t, pgid)
+
+int setpgid(pid_t pid, pid_t pgid)
+{
+	return (__syscall_setpgid(pid, pgid));
+}
+libc_hidden_def(setpgid)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setpgrp.c b/ap/build/uClibc/libc/sysdeps/linux/common/setpgrp.c
new file mode 100644
index 0000000..1a82ac8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setpgrp.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <syscall.h>
+#include <unistd.h>
+
+
+int setpgrp(void)
+{
+	return setpgid(0,0);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setpriority.c b/ap/build/uClibc/libc/sysdeps/linux/common/setpriority.c
new file mode 100644
index 0000000..05d5dd9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setpriority.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setpriority() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/resource.h>
+
+
+_syscall3(int, setpriority, __priority_which_t, which, id_t, who, int, prio)
+libc_hidden_def(setpriority)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setregid.c b/ap/build/uClibc/libc/sysdeps/linux/common/setregid.c
new file mode 100644
index 0000000..15d590a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setregid.c
@@ -0,0 +1,40 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setregid() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <bits/wordsize.h>
+
+
+#if (__WORDSIZE == 32 && defined(__NR_setregid32)) || __WORDSIZE == 64
+# ifdef __NR_setregid32
+#  undef __NR_setregid
+#  define __NR_setregid __NR_setregid32
+# endif
+
+_syscall2(int, setregid, gid_t, rgid, gid_t, egid)
+
+#else
+
+# define __NR___syscall_setregid __NR_setregid
+static __inline__ _syscall2(int, __syscall_setregid,
+		__kernel_gid_t, rgid, __kernel_gid_t, egid)
+
+int setregid(gid_t rgid, gid_t egid)
+{
+	if (((rgid + 1) > (gid_t) ((__kernel_gid_t) - 1U))
+		|| ((egid + 1) > (gid_t) ((__kernel_gid_t) - 1U))) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return (__syscall_setregid(rgid, egid));
+}
+#endif
+
+libc_hidden_def(setregid)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setresgid.c b/ap/build/uClibc/libc/sysdeps/linux/common/setresgid.c
new file mode 100644
index 0000000..95decc2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setresgid.c
@@ -0,0 +1,41 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setresgid() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#ifdef __USE_GNU
+#include <unistd.h>
+
+#if defined(__NR_setresgid32)
+# undef __NR_setresgid
+# define __NR_setresgid __NR_setresgid32
+
+_syscall3(int, setresgid, gid_t, rgid, gid_t, egid, gid_t, sgid)
+libc_hidden_def(setresgid)
+
+#elif defined(__NR_setresgid)
+
+# define __NR___syscall_setresgid __NR_setresgid
+static __inline__ _syscall3(int, __syscall_setresgid,
+		__kernel_gid_t, rgid, __kernel_gid_t, egid, __kernel_gid_t, sgid)
+
+int setresgid(gid_t rgid, gid_t egid, gid_t sgid)
+{
+	if (((rgid + 1) > (gid_t) ((__kernel_gid_t) - 1U))
+		|| ((egid + 1) > (gid_t) ((__kernel_gid_t) - 1U))
+		|| ((sgid + 1) > (gid_t) ((__kernel_gid_t) - 1U))) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return (__syscall_setresgid(rgid, egid, sgid));
+}
+libc_hidden_def(setresgid)
+
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setresuid.c b/ap/build/uClibc/libc/sysdeps/linux/common/setresuid.c
new file mode 100644
index 0000000..022ccfe
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setresuid.c
@@ -0,0 +1,41 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setresuid() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
+#include <unistd.h>
+
+#if defined(__NR_setresuid32)
+# undef __NR_setresuid
+# define __NR_setresuid __NR_setresuid32
+
+_syscall3(int, setresuid, uid_t, ruid, uid_t, euid, uid_t, suid)
+libc_hidden_def(setresuid)
+
+#elif defined(__NR_setresuid)
+
+# define __NR___syscall_setresuid __NR_setresuid
+static __inline__ _syscall3(int, __syscall_setresuid,
+		__kernel_uid_t, rgid, __kernel_uid_t, egid, __kernel_uid_t, sgid)
+
+int setresuid(uid_t ruid, uid_t euid, uid_t suid)
+{
+	if (((ruid + 1) > (uid_t) ((__kernel_uid_t) - 1U))
+		|| ((euid + 1) > (uid_t) ((__kernel_uid_t) - 1U))
+		|| ((suid + 1) > (uid_t) ((__kernel_uid_t) - 1U))) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return (__syscall_setresuid(ruid, euid, suid));
+}
+libc_hidden_def(setresuid)
+
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setreuid.c b/ap/build/uClibc/libc/sysdeps/linux/common/setreuid.c
new file mode 100644
index 0000000..a9eea6d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setreuid.c
@@ -0,0 +1,40 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setreuid() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <bits/wordsize.h>
+
+
+#if (__WORDSIZE == 32 && defined(__NR_setreuid32)) || __WORDSIZE == 64
+# ifdef __NR_setreuid32
+#  undef __NR_setreuid
+#  define __NR_setreuid __NR_setreuid32
+# endif
+
+_syscall2(int, setreuid, uid_t, ruid, uid_t, euid)
+
+#else
+
+# define __NR___syscall_setreuid __NR_setreuid
+static __inline__ _syscall2(int, __syscall_setreuid,
+		__kernel_uid_t, ruid, __kernel_uid_t, euid)
+
+int setreuid(uid_t ruid, uid_t euid)
+{
+	if (((ruid + 1) > (uid_t) ((__kernel_uid_t) - 1U))
+		|| ((euid + 1) > (uid_t) ((__kernel_uid_t) - 1U))) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return (__syscall_setreuid(ruid, euid));
+}
+#endif
+
+libc_hidden_def(setreuid)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setrlimit.c b/ap/build/uClibc/libc/sysdeps/linux/common/setrlimit.c
new file mode 100644
index 0000000..ed773f7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setrlimit.c
@@ -0,0 +1,69 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setrlimit() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define setrlimit64 __hide_setrlimit64
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <sys/resource.h>
+#undef setrlimit64
+
+
+/* Only wrap setrlimit if the new usetrlimit is not present and setrlimit sucks */
+
+#if defined(__NR_usetrlimit)
+
+/* just call usetrlimit() */
+# define __NR___syscall_usetrlimit __NR_usetrlimit
+static __always_inline
+_syscall2(int, __syscall_usetrlimit, enum __rlimit_resource, resource,
+          const struct rlimit *, rlim)
+int setrlimit(__rlimit_resource_t resource, struct rlimit *rlimits)
+{
+	return (__syscall_usetrlimit(resource, rlimits));
+}
+
+#elif !defined(__UCLIBC_HANDLE_OLDER_RLIMIT__)
+
+/* We don't need to wrap setrlimit() */
+_syscall2(int, setrlimit, __rlimit_resource_t, resource,
+		const struct rlimit *, rlim)
+
+#else
+
+/* we have to handle old style setrlimit() */
+# define __NR___syscall_setrlimit __NR_setrlimit
+static __always_inline
+_syscall2(int, __syscall_setrlimit, int, resource, const struct rlimit *, rlim)
+
+int setrlimit(__rlimit_resource_t resource, const struct rlimit *rlimits)
+{
+	struct rlimit rlimits_small;
+
+	if (rlimits == NULL) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+
+	/* We might have to correct the limits values.  Since the old values
+	 * were signed the new values might be too large.  */
+# define RMIN(x, y) ((x) < (y) ? (x) : (y))
+	rlimits_small.rlim_cur = RMIN((unsigned long int) rlimits->rlim_cur,
+								  RLIM_INFINITY >> 1);
+	rlimits_small.rlim_max = RMIN((unsigned long int) rlimits->rlim_max,
+								  RLIM_INFINITY >> 1);
+#undef RMIN
+	return (__syscall_setrlimit(resource, &rlimits_small));
+}
+#endif
+
+libc_hidden_def(setrlimit)
+
+#if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64
+strong_alias(setrlimit, setrlimit64)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setrlimit64.c b/ap/build/uClibc/libc/sysdeps/linux/common/setrlimit64.c
new file mode 100644
index 0000000..8705c6f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setrlimit64.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 1991,1995,1996,1997,1998,2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <_lfs_64.h>
+
+#include <sys/types.h>
+#include <sys/resource.h>
+#include <bits/wordsize.h>
+
+/* the regular setrlimit will work just fine for 64bit users */
+
+#if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 32
+
+
+/* Set the soft and hard limits for RESOURCE to *RLIMITS.
+   Only the super-user can increase hard limits.
+   Return 0 if successful, -1 if not (and sets errno).  */
+int setrlimit64 (__rlimit_resource_t resource, const struct rlimit64 *rlimits)
+{
+    struct rlimit rlimits32;
+
+    if (rlimits->rlim_cur >= RLIM_INFINITY)
+	rlimits32.rlim_cur = RLIM_INFINITY;
+    else
+	rlimits32.rlim_cur = rlimits->rlim_cur;
+    if (rlimits->rlim_max >= RLIM_INFINITY)
+	rlimits32.rlim_max = RLIM_INFINITY;
+    else
+	rlimits32.rlim_max = rlimits->rlim_max;
+
+    return setrlimit (resource, &rlimits32);
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setsid.c b/ap/build/uClibc/libc/sysdeps/linux/common/setsid.c
new file mode 100644
index 0000000..4ca95fc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setsid.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setsid() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+
+_syscall0(pid_t, setsid)
+libc_hidden_def(setsid)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/settimeofday.c b/ap/build/uClibc/libc/sysdeps/linux/common/settimeofday.c
new file mode 100644
index 0000000..7e508ae
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/settimeofday.c
@@ -0,0 +1,19 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * settimeofday() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/time.h>
+
+#ifdef __USE_BSD
+
+
+_syscall2(int, settimeofday, const struct timeval *, tv,
+		  const struct timezone *, tz)
+libc_hidden_def(settimeofday)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/setuid.c b/ap/build/uClibc/libc/sysdeps/linux/common/setuid.c
new file mode 100644
index 0000000..7fd8c65
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/setuid.c
@@ -0,0 +1,35 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * setuid() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <bits/wordsize.h>
+
+#if (__WORDSIZE == 32 && defined(__NR_setuid32)) || __WORDSIZE == 64
+# ifdef __NR_setuid32
+#  undef __NR_setuid
+#  define __NR_setuid __NR_setuid32
+# endif
+
+_syscall1(int, setuid, uid_t, uid)
+
+#else
+
+# define __NR___syscall_setuid __NR_setuid
+static __inline__ _syscall1(int, __syscall_setuid, __kernel_uid_t, uid)
+
+int setuid(uid_t uid)
+{
+	if (uid == (uid_t) ~ 0 || uid != (uid_t) ((__kernel_uid_t) uid)) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return (__syscall_setuid(uid));
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sigaltstack.c b/ap/build/uClibc/libc/sysdeps/linux/common/sigaltstack.c
new file mode 100644
index 0000000..964e16f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sigaltstack.c
@@ -0,0 +1,17 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sigaltstack() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <signal.h>
+
+#if defined __NR_sigaltstack && (defined __USE_BSD || defined __USE_UNIX98)
+
+_syscall2(int, sigaltstack, const struct sigaltstack *, ss,
+		  struct sigaltstack *, oss)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/signalfd.c b/ap/build/uClibc/libc/sysdeps/linux/common/signalfd.c
new file mode 100644
index 0000000..a0c995a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/signalfd.c
@@ -0,0 +1,37 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * signalfd() for uClibc
+ *
+ * Copyright (C) 2008 Bernhard Reutner-Fischer <uclibc@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <signal.h>
+#include <sys/signalfd.h>
+
+#if defined __NR_signalfd4
+#define __NR___syscall_signalfd4 __NR_signalfd4
+static __inline__ _syscall4(int, __syscall_signalfd4, int, fd,
+		const sigset_t *, mask, size_t, sizemask, int, flags)
+#elif defined __NR_signalfd
+#define __NR___syscall_signalfd __NR_signalfd
+static __inline__ _syscall3(int, __syscall_signalfd, int, fd,
+		const sigset_t *, mask, size_t, sizemask)
+#endif
+
+#if defined __NR_signalfd4 || defined __NR_signalfd
+int signalfd (int fd, const sigset_t *mask, int flags)
+{
+#if defined __NR___syscall_signalfd4
+	return __syscall_signalfd4(fd, mask, _NSIG / 8, flags);
+#elif defined __NR___syscall_signalfd
+	if (flags != 0) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	return __syscall_signalfd(fd, mask, _NSIG / 8);
+#endif
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sigpending.c b/ap/build/uClibc/libc/sysdeps/linux/common/sigpending.c
new file mode 100644
index 0000000..8fa2a51
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sigpending.c
@@ -0,0 +1,27 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sigpending() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+#if defined __USE_POSIX
+#include <signal.h>
+#undef sigpending
+
+#ifdef __NR_rt_sigpending
+# define __NR___rt_sigpending __NR_rt_sigpending
+static __inline__ _syscall2(int, __rt_sigpending, sigset_t *, set, size_t, size)
+
+int sigpending(sigset_t * set)
+{
+	return __rt_sigpending(set, _NSIG / 8);
+}
+#else
+_syscall1(int, sigpending, sigset_t *, set)
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sigprocmask.c b/ap/build/uClibc/libc/sysdeps/linux/common/sigprocmask.c
new file mode 100644
index 0000000..bc3e64d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sigprocmask.c
@@ -0,0 +1,92 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sigprocmask() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+#if defined __USE_POSIX
+#include <signal.h>
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+# include <pthreadP.h>	/* SIGCANCEL */
+#endif
+
+#undef sigprocmask
+
+libc_hidden_proto(sigprocmask)
+
+#ifdef __NR_rt_sigprocmask
+
+# define __NR___rt_sigprocmask __NR_rt_sigprocmask
+static __always_inline
+_syscall4(int, __rt_sigprocmask, int, how, const sigset_t *, set,
+		  sigset_t *, oldset, size_t, size)
+
+int sigprocmask(int how, const sigset_t * set, sigset_t * oldset)
+{
+#ifdef SIGCANCEL
+	sigset_t local_newmask;
+
+	/*
+	 * The only thing we have to make sure here is that SIGCANCEL and
+	 * SIGSETXID are not blocked.
+	 */
+	if (set != NULL && (__builtin_expect (__sigismember (set, SIGCANCEL), 0)
+# ifdef SIGSETXID
+		|| __builtin_expect (__sigismember (set, SIGSETXID), 0)
+# endif
+		))
+	{
+		local_newmask = *set;
+		__sigdelset (&local_newmask, SIGCANCEL);
+# ifdef SIGSETXID
+		__sigdelset (&local_newmask, SIGSETXID);
+# endif
+		set = &local_newmask;
+	}
+#endif
+
+	return __rt_sigprocmask(how, set, oldset, _NSIG / 8);
+}
+
+
+#else
+
+# define __NR___syscall_sigprocmask __NR_sigprocmask
+static __always_inline
+_syscall3(int, __syscall_sigprocmask, int, how, const sigset_t *, set,
+		  sigset_t *, oldset)
+
+int sigprocmask(int how, const sigset_t * set, sigset_t * oldset)
+{
+#ifdef SIGCANCEL
+	sigset_t local_newmask;
+
+	/*
+	 * The only thing we have to make sure here is that SIGCANCEL and
+	 * SIGSETXID are not blocked.
+	 */
+	if (set != NULL && (__builtin_expect (__sigismember (set, SIGCANCEL), 0)
+# ifdef SIGSETXID
+		|| __builtin_expect (__sigismember (set, SIGSETXID), 0)
+# endif
+		))
+	{
+		local_newmask = *set;
+		__sigdelset (&local_newmask, SIGCANCEL);
+# ifdef SIGSETXID
+		__sigdelset (&local_newmask, SIGSETXID);
+# endif
+		set = &local_newmask;
+	}
+#endif
+
+	return (__syscall_sigprocmask(how, set, oldset));
+}
+#endif
+libc_hidden_def(sigprocmask)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sigqueue.c b/ap/build/uClibc/libc/sysdeps/linux/common/sigqueue.c
new file mode 100644
index 0000000..e55d3b3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sigqueue.c
@@ -0,0 +1,52 @@
+/* Copyright (C) 1997, 1998, 2000, 2003, 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <signal.h>
+#include <unistd.h>
+#include <string.h>
+
+#include <sys/syscall.h>
+#if defined __USE_POSIX199309
+
+
+#ifdef __NR_rt_sigqueueinfo
+
+# define __NR___libc_rt_sigqueueinfo __NR_rt_sigqueueinfo
+static __inline__ _syscall3(int, __libc_rt_sigqueueinfo, pid_t, pid, int, sig, void*, value)
+
+/* Return any pending signal or wait for one for the given time.  */
+int sigqueue (pid_t pid, int sig, const union sigval val)
+{
+  siginfo_t info;
+
+  /* First, clear the siginfo_t structure, so that we don't pass our
+     stack content to other tasks.  */
+  memset (&info, 0, sizeof (siginfo_t));
+  /* We must pass the information about the data in a siginfo_t value.  */
+  info.si_signo = sig;
+  info.si_code = SI_QUEUE;
+  info.si_pid = getpid ();
+  info.si_uid = getuid ();
+  info.si_value = val;
+
+  return __libc_rt_sigqueueinfo(pid, sig, &info);
+}
+
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sigsuspend.c b/ap/build/uClibc/libc/sysdeps/linux/common/sigsuspend.c
new file mode 100644
index 0000000..ded2aad
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sigsuspend.c
@@ -0,0 +1,59 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sigsuspend() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+#if defined __USE_POSIX
+#include <signal.h>
+#undef sigsuspend
+
+libc_hidden_proto(sigsuspend)
+
+#ifdef __NR_rt_sigsuspend
+# define __NR___rt_sigsuspend __NR_rt_sigsuspend
+
+# ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#  include <errno.h>
+#  include <sysdep-cancel.h>
+
+/* Change the set of blocked signals to SET,
+   wait until a signal arrives, and restore the set of blocked signals.  */
+int sigsuspend (const sigset_t *set)
+{
+	if (SINGLE_THREAD_P)
+		return INLINE_SYSCALL (rt_sigsuspend, 2, set, _NSIG / 8);
+
+	int oldtype = LIBC_CANCEL_ASYNC ();
+
+	int result = INLINE_SYSCALL (rt_sigsuspend, 2, set, _NSIG / 8);
+
+	LIBC_CANCEL_RESET (oldtype);
+
+	return result;
+}
+# else
+static inline _syscall2(int, __rt_sigsuspend, const sigset_t *, mask, size_t, size)
+
+int sigsuspend(const sigset_t * mask)
+{
+	return __rt_sigsuspend(mask, _NSIG / 8);
+}
+# endif
+#else
+# define __NR___syscall_sigsuspend __NR_sigsuspend
+static __inline__ _syscall3(int, __syscall_sigsuspend, int, a, unsigned long int, b,
+		  unsigned long int, c)
+
+int sigsuspend(const sigset_t * set)
+{
+	return __syscall_sigsuspend(0, 0, set->__val[0]);
+}
+#endif
+libc_hidden_def(sigsuspend)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/splice.c b/ap/build/uClibc/libc/sysdeps/linux/common/splice.c
new file mode 100644
index 0000000..83f348a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/splice.c
@@ -0,0 +1,16 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * splice() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <fcntl.h>
+
+#ifdef __NR_splice
+_syscall6(ssize_t, splice, int, __fdin, __off64_t *, __offin, int, __fdout,
+	__off64_t *, __offout, size_t, __len, unsigned int, __flags)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/ssp-local.c b/ap/build/uClibc/libc/sysdeps/linux/common/ssp-local.c
new file mode 100644
index 0000000..202d956
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/ssp-local.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/*
+ * Peter S. Mazinger ps.m[@]gmx.net
+ * copied stack_chk_fail_local.c from glibc and adapted for uClibc
+ */
+
+#include <features.h>
+
+extern void __stack_chk_fail (void) attribute_noreturn;
+
+/* On some architectures, this helps needless PIC pointer setup
+   that would be needed just for the __stack_chk_fail call.  */
+
+void __stack_chk_fail_local (void) attribute_noreturn attribute_hidden;
+void __stack_chk_fail_local (void)
+{
+  __stack_chk_fail ();
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/ssp.c b/ap/build/uClibc/libc/sysdeps/linux/common/ssp.c
new file mode 100644
index 0000000..df242cc
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/ssp.c
@@ -0,0 +1,122 @@
+/*
+ * Distributed under the terms of the GNU Lesser General Public License
+ * $Header: $
+ *
+ * This is a modified version of Hiroaki Etoh's stack smashing routines
+ * implemented for glibc.
+ *
+ * The following people have contributed input to this code.
+ * Ned Ludd - <solar[@]gentoo.org>
+ * Alexander Gabert - <pappy[@]gentoo.org>
+ * The PaX Team - <pageexec[@]freemail.hu>
+ * Peter S. Mazinger - <ps.m[@]gmx.net>
+ * Yoann Vandoorselaere - <yoann[@]prelude-ids.org>
+ * Robert Connolly - <robert[@]linuxfromscratch.org>
+ * Cory Visi <cory[@]visi.name>
+ * Mike Frysinger <vapier[@]gentoo.org>
+ */
+
+#if defined __SSP__ || defined __SSP_ALL__
+#error "file must not be compiled with stack protection enabled on it. Use -fno-stack-protector"
+#endif
+
+#ifdef __PROPOLICE_BLOCK_SEGV__
+# define SSP_SIGTYPE SIGSEGV
+#else
+# define SSP_SIGTYPE SIGABRT
+#endif
+
+#include <string.h>
+#include <unistd.h>
+#include <signal.h>
+#if defined __UCLIBC_HAS_SYSLOG__
+#include <sys/syslog.h>
+
+#endif
+
+
+static void block_signals(void)
+{
+	struct sigaction sa;
+	sigset_t mask;
+
+	__sigfillset(&mask);
+	__sigdelset(&mask, SSP_SIGTYPE);	/* Block all signal handlers */
+	sigprocmask(SIG_BLOCK, &mask, NULL);	/* except SSP_SIGTYPE */
+
+	/* Make the default handler associated with the signal handler */
+	memset(&sa, 0, sizeof(sa));
+	__sigfillset(&sa.sa_mask);	/* Block all signals */
+	if (SIG_DFL) /* if it's constant zero, it's already done */
+		sa.sa_handler = SIG_DFL;
+	sigaction(SSP_SIGTYPE, &sa, NULL);
+}
+
+static void __cold ssp_write(int fd, const char *msg1, const char *msg2, const char *msg3)
+{
+	write(fd, msg1, strlen(msg1));
+	write(fd, msg2, strlen(msg2));
+	write(fd, msg3, strlen(msg3));
+	write(fd, "()\n", 3);
+#if defined __UCLIBC_HAS_SYSLOG__
+	openlog("ssp", LOG_CONS | LOG_PID, LOG_USER);
+	syslog(LOG_INFO, "%s%s%s()", msg1, msg2, msg3);
+	closelog();
+#endif
+}
+
+static attribute_noreturn void terminate(void)
+{
+	(void) kill(getpid(), SSP_SIGTYPE);
+	_exit(127);
+}
+
+#ifdef __UCLIBC_HAS_SSP_COMPAT__
+void __stack_smash_handler(char func[], int damaged __attribute__ ((unused))) attribute_noreturn __cold;
+void __stack_smash_handler(char func[], int damaged)
+{
+	static const char message[] = ": stack smashing attack in function ";
+
+	block_signals();
+
+	ssp_write(STDERR_FILENO, __uclibc_progname, message, func);
+
+	/* The loop is added only to keep gcc happy. */
+	while(1)
+		terminate();
+}
+#endif
+
+#ifdef __UCLIBC_HAS_SSP__
+void __stack_chk_fail(void) attribute_noreturn __cold;
+void __stack_chk_fail(void)
+{
+	static const char msg1[] = "stack smashing detected: ";
+	static const char msg3[] = " terminated";
+
+	block_signals();
+
+	ssp_write(STDERR_FILENO, msg1, __uclibc_progname, msg3);
+
+	/* The loop is added only to keep gcc happy. */
+	while(1)
+		terminate();
+}
+#endif
+
+#ifdef __UCLIBC_HAS_FORTIFY__
+void __chk_fail(void)
+{
+	static const char msg1[] = "buffer overflow detected: ";
+	static const char msg3[] = " terminated";
+
+	block_signals();
+
+	ssp_write(STDERR_FILENO, msg1, __uclibc_progname, msg3);
+
+	/* The loop is added only to keep gcc happy. */
+	while(1)
+		terminate();
+}
+libc_hidden_def(__chk_fail)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/stat.c b/ap/build/uClibc/libc/sysdeps/linux/common/stat.c
new file mode 100644
index 0000000..829f35a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/stat.c
@@ -0,0 +1,46 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * stat() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include "xstatconv.h"
+
+#undef stat
+
+int stat(const char *file_name, struct stat *buf)
+{
+	int result;
+#ifdef __NR_stat64
+	/* normal stat call has limited values for various stat elements
+	 * e.g. uid device major/minor etc.
+	 * so we use 64 variant if available
+	 * in order to get newer versions of stat elements
+	 */
+	struct kernel_stat64 kbuf;
+	result = INLINE_SYSCALL(stat64, 2, file_name, &kbuf);
+	if (result == 0) {
+		__xstat32_conv(&kbuf, buf);
+	}
+#else
+	struct kernel_stat kbuf;
+
+	result = INLINE_SYSCALL(stat, 2, file_name, &kbuf);
+	if (result == 0) {
+		__xstat_conv(&kbuf, buf);
+	}
+#endif
+	return result;
+}
+libc_hidden_def(stat)
+
+#if ! defined __NR_stat64 && defined __UCLIBC_HAS_LFS__
+strong_alias_untyped(stat,stat64)
+libc_hidden_def(stat64)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/stat64.c b/ap/build/uClibc/libc/sysdeps/linux/common/stat64.c
new file mode 100644
index 0000000..a76f182
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/stat64.c
@@ -0,0 +1,34 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * stat64() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/stat.h>
+
+#if defined __UCLIBC_HAS_LFS__ && defined __NR_stat64
+
+# define __NR___syscall_stat64 __NR_stat64
+# include <unistd.h>
+# include "xstatconv.h"
+
+static __inline__ _syscall2(int, __syscall_stat64,
+		const char *, file_name, struct kernel_stat64 *, buf)
+
+int stat64(const char *file_name, struct stat64 *buf)
+{
+	int result;
+	struct kernel_stat64 kbuf;
+
+	result = __syscall_stat64(file_name, &kbuf);
+	if (result == 0) {
+		__xstat64_conv(&kbuf, buf);
+	}
+	return result;
+}
+libc_hidden_def(stat64)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/statfs.c b/ap/build/uClibc/libc/sysdeps/linux/common/statfs.c
new file mode 100644
index 0000000..d24bc9d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/statfs.c
@@ -0,0 +1,22 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * statfs() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <string.h>
+#include <sys/param.h>
+#include <sys/vfs.h>
+
+extern __typeof(statfs) __libc_statfs attribute_hidden;
+#define __NR___libc_statfs __NR_statfs
+_syscall2(int, __libc_statfs, const char *, path, struct statfs *, buf)
+
+#if defined __UCLIBC_LINUX_SPECIFIC__ || defined __UCLIBC_HAS_THREADS_NATIVE__
+/* statfs is used by NPTL, so it must exported in case */
+weak_alias(__libc_statfs,statfs)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/stime.c b/ap/build/uClibc/libc/sysdeps/linux/common/stime.c
new file mode 100644
index 0000000..cb7e804
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/stime.c
@@ -0,0 +1,32 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * stime() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <time.h>
+#include <sys/time.h>
+
+#ifdef __USE_SVID
+#ifdef __NR_stime
+_syscall1(int, stime, const time_t *, t)
+#else
+
+int stime(const time_t * when)
+{
+	struct timeval tv;
+
+	if (when == NULL) {
+		__set_errno(EINVAL);
+		return -1;
+	}
+	tv.tv_sec = *when;
+	tv.tv_usec = 0;
+	return settimeofday(&tv, (struct timezone *) 0);
+}
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/stubs.c b/ap/build/uClibc/libc/sysdeps/linux/common/stubs.c
new file mode 100644
index 0000000..4d1e26c
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/stubs.c
@@ -0,0 +1,413 @@
+/*
+ * 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 <bits/wordsize.h>
+#include <sys/syscall.h>
+
+#ifdef __UCLIBC_HAS_STUBS__
+
+static int enosys_stub(void) __attribute_used__;
+static int enosys_stub(void)
+{
+	__set_errno(ENOSYS);
+	return -1;
+}
+
+#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
+
+#if !defined __NR_accept && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(accept)
+#endif
+
+#if !defined __NR_accept4 && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__ && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(accept4)
+#endif
+
+#if !defined __NR_arch_prctl && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(arch_prctl)
+#endif
+
+#if !defined __NR_capget && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(capget)
+#endif
+
+#if !defined __NR_capset && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(capset)
+#endif
+
+#if !defined __NR_bdflush && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(bdflush)
+#endif
+
+#if !defined __NR_bind && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(bind)
+#endif
+
+#ifndef __NR_capget
+make_stub(capget)
+#endif
+
+#ifndef __NR_capset
+make_stub(capset)
+#endif
+
+#if !defined __NR_connect && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(connect)
+#endif
+
+#if !defined __NR_create_module && defined __UCLIBC_LINUX_MODULE_24__
+make_stub(create_module)
+#endif
+
+#if !defined __NR_delete_module && defined __UCLIBC_LINUX_MODULE_26__
+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
+
+#if !defined __NR_eventfd && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(eventfd)
+#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
+
+#if !defined __NR_fstatfs && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(fstatfs)
+#endif
+
+#ifndef __NR_get_kernel_syms
+make_stub(get_kernel_syms)
+#endif
+
+#if !defined __NR_getcpu && defined __UCLIBC_LINUX_SPECIFIC__ && ((defined __x86_64__ && !defined __UCLIBC_HAS_TLS__) || !defined __x86_64__)
+make_stub(sched_getcpu)
+#endif
+
+#if !defined __NR_getpeername && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(getpeername)
+#endif
+
+#if !defined __NR_getpgrp && !defined __NR_getpgid
+make_stub(getpgrp)
+#endif
+
+#if !defined __NR_getsockname && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(getsockname)
+#endif
+
+#if !defined __NR_getsockopt && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(getsockopt)
+#endif
+
+#ifndef __NR_getxattr
+make_stub(getxattr)
+#endif
+
+#if !defined __NR_init_module && defined __UCLIBC_LINUX_MODULE_26__
+make_stub(init_module)
+#endif
+
+#if !defined __NR_inotify_init && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(inotify_init)
+#endif
+
+#if !defined __NR_inotify_init1 && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(inotify_init1)
+#endif
+
+#if !defined __NR_inotify_add_watch && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(inotify_add_watch)
+#endif
+
+#if !defined __NR_inotify_rm_watch && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(inotify_rm_watch)
+#endif
+
+#if !defined __NR_ioperm && defined __UCLIBC_LINUX_SPECIFIC__ && !defined __arm__
+make_stub(ioperm)
+#endif
+
+#if !defined __NR_iopl && defined __UCLIBC_LINUX_SPECIFIC__ && !defined __arm__
+make_stub(iopl)
+#endif
+
+#ifndef __NR_lgetxattr
+make_stub(lgetxattr)
+#endif
+
+#if !defined __NR_listen && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(listen)
+#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
+
+#if !defined __NR_madvise && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(madvise)
+#endif
+
+#if !defined __NR_modify_ldt && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(modify_ldt)
+#endif
+
+#if !defined __NR_personality && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(personality)
+#endif
+
+#if !defined __NR_pipe2 && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(pipe2)
+#endif
+
+#if !defined __NR_pivot_root && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(pivot_root)
+#endif
+
+#if !defined __NR_ppoll && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(ppoll)
+#endif
+
+#if !defined __NR_prctl && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(prctl)
+#endif
+
+#if !defined __NR_readahead && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(readahead)
+#endif
+
+#if !defined __NR_reboot && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(reboot)
+#endif
+
+#if !defined __NR_query_module && defined __UCLIBC_LINUX_MODULE_24__
+make_stub(query_module)
+#endif
+
+#if !defined __NR_recv && !defined __NR_socketcall && !defined __NR_recvfrom && defined __UCLIBC_HAS_SOCKET__
+make_stub(recv)
+#endif
+
+#if !defined __NR_recvfrom && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(recvfrom)
+#endif
+
+#if !defined __NR_recvmsg && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(recvmsg)
+#endif
+
+#if !defined __NR_remap_file_pages && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(remap_file_pages)
+#endif
+
+#ifndef __NR_removexattr
+make_stub(removexattr)
+#endif
+
+#if !defined __NR_sched_getaffinity && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(sched_getaffinity)
+#endif
+
+#if !defined __NR_sched_setaffinity && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(sched_setaffinity)
+#endif
+
+#if !defined __NR_send && !defined __NR_socketcall && !defined __NR_sendto && defined __UCLIBC_HAS_SOCKET__
+make_stub(send)
+#endif
+
+#if !defined __NR_sendfile && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(sendfile)
+#endif
+
+#if !defined __NR_sendfile64 && !defined __NR_sendfile && defined __UCLIBC_LINUX_SPECIFIC__ && defined __UCLIBC_HAS_LFS__
+make_stub(sendfile64)
+#endif
+
+#if !defined __NR_sendmsg && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(sendmsg)
+#endif
+
+#if !defined __NR_sendto && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(sendto)
+#endif
+
+#if ((__WORDSIZE == 32 && (!defined __NR_setfsgid32 && !defined __NR_setfsgid)) || (__WORDSIZE == 64 && !defined __NR_setfsgid)) && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(setfsgid)
+#endif
+
+#if ((__WORDSIZE == 32 && (!defined __NR_setfsuid32 && !defined __NR_setfsuid)) || (__WORDSIZE == 64 && !defined __NR_setfsuid)) && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(setfsuid)
+#endif
+
+#if !defined __NR_setresgid32 && !defined __NR_setresgid && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(setresgid)
+#endif
+
+#if !defined __NR_setresuid32 && !defined __NR_setresuid && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(setresuid)
+#endif
+
+#if !defined __NR_setsockopt && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(setsockopt)
+#endif
+
+#ifndef __NR_setxattr
+make_stub(setxattr)
+#endif
+
+#if !defined __NR_shutdown && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(shutdown)
+#endif
+
+#if !defined __NR_signalfd4 && !defined __NR_signalfd && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(signalfd)
+#endif
+
+#if !defined __NR_socket && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(socket)
+#endif
+
+#if !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(socketcall)
+#endif
+
+#if !defined __NR_socketpair && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
+make_stub(socketpair)
+#endif
+
+#ifndef __NR_rt_sigtimedwait
+make_stub(sigtimedwait)
+make_stub(sigwaitinfo)
+#endif
+
+#if !defined __NR_splice && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(splice)
+#endif
+
+#if !defined __NR_swapoff && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(swapoff)
+#endif
+
+#if !defined __NR_swapon && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(swapon)
+#endif
+
+#if !defined __NR_sync_file_range && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(sync_file_range)
+#endif
+
+#if !defined __NR__sysctl && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(_sysctl)
+#endif
+
+#if !defined __NR_sysinfo && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(sysinfo)
+#endif
+
+#if !defined __NR_tee && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(tee)
+#endif
+
+#if !defined __NR_timerfd_create && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(timerfd_create)
+#endif
+
+#if !defined __NR_timerfd_settime && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(timerfd_settime)
+#endif
+
+#if !defined __NR_timerfd_gettime && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(timerfd_gettime)
+#endif
+
+#if !defined __NR_umount && !defined __NR_umount2 && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(umount)
+#endif
+
+#if !defined __NR_umount2 && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(umount2)
+#endif
+
+#if !defined __NR_unshare && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(unshare)
+#endif
+
+#ifndef __NR_utimensat
+make_stub(futimens)
+make_stub(utimensat)
+# ifndef __NR_lutimes
+make_stub(lutimes)
+# endif
+#endif
+
+#if !defined __NR_vhangup && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(vhangup)
+#endif
+
+#ifndef __NR_vmsplice
+make_stub(vmsplice)
+#endif
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/swapoff.c b/ap/build/uClibc/libc/sysdeps/linux/common/swapoff.c
new file mode 100644
index 0000000..db0b9be
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/swapoff.c
@@ -0,0 +1,17 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * swapoff() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+#ifdef __NR_swapoff
+
+#include <sys/swap.h>
+_syscall1(int, swapoff, const char *, path)
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/swapon.c b/ap/build/uClibc/libc/sysdeps/linux/common/swapon.c
new file mode 100644
index 0000000..5d6b6e2
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/swapon.c
@@ -0,0 +1,17 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * swapon() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+#ifdef __NR_swapon
+
+#include <sys/swap.h>
+_syscall2(int, swapon, const char *, path, int, swapflags)
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/symlink.c b/ap/build/uClibc/libc/sysdeps/linux/common/symlink.c
new file mode 100644
index 0000000..e53e8d4
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/symlink.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * symlink() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K
+#include <unistd.h>
+_syscall2(int, symlink, const char *, oldpath, const char *, newpath)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/symlinkat.c b/ap/build/uClibc/libc/sysdeps/linux/common/symlinkat.c
new file mode 100644
index 0000000..6381b33
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/symlinkat.c
@@ -0,0 +1,16 @@
+/*
+ * symlinkat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_symlinkat
+_syscall3(int, symlinkat, const char *, from, int, tofd, const char *, to)
+#else
+/* should add emulation with symlink() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sync.c b/ap/build/uClibc/libc/sysdeps/linux/common/sync.c
new file mode 100644
index 0000000..126f40d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sync.c
@@ -0,0 +1,19 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sync syscall for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+# if defined __USE_BSD || defined __USE_UNIX98
+#include <sys/types.h>
+#include <unistd.h>
+
+void sync(void)
+{
+	INLINE_SYSCALL(sync, 0);
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sync_file_range.c b/ap/build/uClibc/libc/sysdeps/linux/common/sync_file_range.c
new file mode 100644
index 0000000..d24403e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sync_file_range.c
@@ -0,0 +1,27 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sync_file_range() for uClibc
+ *
+ * Copyright (C) 2008 Bernhard Reutner-Fischer <uclibc@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#if defined __USE_GNU
+#include <fcntl.h>
+
+#if defined __NR_sync_file_range && defined __UCLIBC_HAS_LFS__
+#define __NR___syscall_sync_file_range __NR_sync_file_range
+static __inline__ _syscall6(int, __syscall_sync_file_range, int, fd,
+		off_t, offset_hi, off_t, offset_lo,
+		off_t, nbytes_hi, off_t, nbytes_lo, unsigned int, flags)
+int sync_file_range(int fd, off64_t offset, off64_t nbytes, unsigned int flags)
+{
+	return __syscall_sync_file_range(fd,
+		__LONG_LONG_PAIR((long)(offset >> 32), (long)(offset & 0xffffffff)),
+		__LONG_LONG_PAIR((long)(nbytes >> 32), (long)(nbytes & 0xffffffff)),
+		flags);
+}
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sys/acct.h b/ap/build/uClibc/libc/sysdeps/linux/common/sys/acct.h
new file mode 100644
index 0000000..9ee8564
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sys/acct.h
@@ -0,0 +1,77 @@
+/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_ACCT_H
+#define _SYS_ACCT_H	1
+
+#include <features.h>
+
+#define	__need_time_t
+#include <time.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+#define ACCT_COMM 16
+
+/*
+  comp_t is a 16-bit "floating" point number with a 3-bit base 8
+  exponent and a 13-bit fraction. See linux/kernel/acct.c for the
+  specific encoding system used.
+*/
+
+typedef u_int16_t comp_t;
+
+struct acct
+  {
+    char ac_flag;			/* Accounting flags.  */
+    u_int16_t ac_uid;			/* Accounting user ID.  */
+    u_int16_t ac_gid;			/* Accounting group ID.  */
+    u_int16_t ac_tty;			/* Controlling tty.  */
+    u_int32_t ac_btime;			/* Beginning time.  */
+    comp_t ac_utime;			/* Accounting user time.  */
+    comp_t ac_stime;			/* Accounting system time.  */
+    comp_t ac_etime;			/* Accounting elapsed time.  */
+    comp_t ac_mem;			/* Accounting average memory usage.  */
+    comp_t ac_io;			/* Accounting chars transferred.  */
+    comp_t ac_rw;			/* Accounting blocks read or written.  */
+    comp_t ac_minflt;			/* Accounting minor pagefaults.  */
+    comp_t ac_majflt;			/* Accounting major pagefaults.  */
+    comp_t ac_swaps;			/* Accounting number of swaps.  */
+    u_int32_t ac_exitcode;		/* Accounting process exitcode.  */
+    char ac_comm[ACCT_COMM+1];		/* Accounting command name.  */
+    char ac_pad[10];			/* Accounting padding bytes.  */
+  };
+
+enum
+  {
+    AFORK = 0x01,		/* Has executed fork, but no exec.  */
+    ASU = 0x02,			/* Used super-user privileges.  */
+    ACORE = 0x08,		/* Dumped core.  */
+    AXSIG = 0x10		/* Killed by a signal.  */
+  };
+
+#define AHZ     100
+
+
+/* Switch process accounting on and off.  */
+extern int acct (__const char *__filename) __THROW;
+
+__END_DECLS
+
+#endif	/* sys/acct.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sys/epoll.h b/ap/build/uClibc/libc/sysdeps/linux/common/sys/epoll.h
new file mode 100644
index 0000000..a55ebad
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sys/epoll.h
@@ -0,0 +1,140 @@
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_EPOLL_H
+#define	_SYS_EPOLL_H	1
+
+#include <stdint.h>
+#include <sys/types.h>
+
+/* Get __sigset_t.  */
+#include <bits/sigset.h>
+
+#ifndef __sigset_t_defined
+# define __sigset_t_defined
+typedef __sigset_t sigset_t;
+#endif
+
+/* Get the platform-dependent flags.  */
+#include <bits/epoll.h>
+
+#ifndef __EPOLL_PACKED
+# define __EPOLL_PACKED
+#endif
+
+
+enum EPOLL_EVENTS
+  {
+    EPOLLIN = 0x001,
+#define EPOLLIN EPOLLIN
+    EPOLLPRI = 0x002,
+#define EPOLLPRI EPOLLPRI
+    EPOLLOUT = 0x004,
+#define EPOLLOUT EPOLLOUT
+    EPOLLRDNORM = 0x040,
+#define EPOLLRDNORM EPOLLRDNORM
+    EPOLLRDBAND = 0x080,
+#define EPOLLRDBAND EPOLLRDBAND
+    EPOLLWRNORM = 0x100,
+#define EPOLLWRNORM EPOLLWRNORM
+    EPOLLWRBAND = 0x200,
+#define EPOLLWRBAND EPOLLWRBAND
+    EPOLLMSG = 0x400,
+#define EPOLLMSG EPOLLMSG
+    EPOLLERR = 0x008,
+#define EPOLLERR EPOLLERR
+    EPOLLHUP = 0x010,
+#define EPOLLHUP EPOLLHUP
+    EPOLLRDHUP = 0x2000,
+#define EPOLLRDHUP EPOLLRDHUP
+    EPOLLONESHOT = 1u << 30,
+#define EPOLLONESHOT EPOLLONESHOT
+    EPOLLET = 1u << 31
+#define EPOLLET EPOLLET
+  };
+
+
+/* Valid opcodes ( "op" parameter ) to issue to epoll_ctl().  */
+#define EPOLL_CTL_ADD 1	/* Add a file descriptor to the interface.  */
+#define EPOLL_CTL_DEL 2	/* Remove a file descriptor from the interface.  */
+#define EPOLL_CTL_MOD 3	/* Change file descriptor epoll_event structure.  */
+
+
+typedef union epoll_data
+{
+  void *ptr;
+  int fd;
+  uint32_t u32;
+  uint64_t u64;
+} epoll_data_t;
+
+struct epoll_event
+{
+  uint32_t events;	/* Epoll events */
+  epoll_data_t data;	/* User data variable */
+} __EPOLL_PACKED;
+
+
+__BEGIN_DECLS
+
+/* Creates an epoll instance.  Returns an fd for the new instance.
+   The "size" parameter is a hint specifying the number of file
+   descriptors to be associated with the new instance.  The fd
+   returned by epoll_create() should be closed with close().  */
+extern int epoll_create (int __size) __THROW;
+
+/* Same as epoll_create but with an FLAGS parameter.  The unused SIZE
+   parameter has been dropped.  */
+extern int epoll_create1 (int __flags) __THROW;
+
+
+/* Manipulate an epoll instance "epfd". Returns 0 in case of success,
+   -1 in case of error ( the "errno" variable will contain the
+   specific error code ) The "op" parameter is one of the EPOLL_CTL_*
+   constants defined above. The "fd" parameter is the target of the
+   operation. The "event" parameter describes which events the caller
+   is interested in and any associated user data.  */
+extern int epoll_ctl (int __epfd, int __op, int __fd,
+		      struct epoll_event *__event) __THROW;
+
+
+/* Wait for events on an epoll instance "epfd". Returns the number of
+   triggered events returned in "events" buffer. Or -1 in case of
+   error with the "errno" variable set to the specific error code. The
+   "events" parameter is a buffer that will contain triggered
+   events. The "maxevents" is the maximum number of events to be
+   returned ( usually size of "events" ). The "timeout" parameter
+   specifies the maximum wait time in milliseconds (-1 == infinite).
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern int epoll_wait (int __epfd, struct epoll_event *__events,
+		       int __maxevents, int __timeout);
+
+
+/* Same as epoll_wait, but the thread's signal mask is temporarily
+   and atomically replaced with the one provided as parameter.
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern int epoll_pwait (int __epfd, struct epoll_event *__events,
+			int __maxevents, int __timeout,
+			const __sigset_t *__ss);
+
+__END_DECLS
+
+#endif /* sys/epoll.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sys/eventfd.h b/ap/build/uClibc/libc/sysdeps/linux/common/sys/eventfd.h
new file mode 100644
index 0000000..311f803
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sys/eventfd.h
@@ -0,0 +1,48 @@
+/* Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef	_SYS_EVENTFD_H
+#define	_SYS_EVENTFD_H	1
+
+#include <stdint.h>
+
+
+/* Type for event counter.  */
+typedef uint64_t eventfd_t;
+
+/* Flags for signalfd.  */
+enum
+  {
+    EFD_SEMAPHORE = 1,
+#define EFD_SEMAPHORE EFD_SEMAPHORE
+    EFD_CLOEXEC = 02000000,
+#define EFD_CLOEXEC EFD_CLOEXEC
+    EFD_NONBLOCK = 04000
+#define EFD_NONBLOCK EFD_NONBLOCK
+  };
+
+
+__BEGIN_DECLS
+
+/* Return file descriptor for generic event channel.  Set initial
+   value to COUNT.  */
+extern int eventfd (int __count, int __flags) __THROW;
+
+__END_DECLS
+
+#endif /* sys/eventfd.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sys/inotify.h b/ap/build/uClibc/libc/sysdeps/linux/common/sys/inotify.h
new file mode 100644
index 0000000..a1d74d6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sys/inotify.h
@@ -0,0 +1,99 @@
+/* Copyright (C) 2005-2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_INOTIFY_H
+#define	_SYS_INOTIFY_H	1
+
+#include <stdint.h>
+
+/* Get the platform-dependent flags.  */
+#include <bits/inotify.h>
+
+
+/* Structure describing an inotify event.  */
+struct inotify_event
+{
+  int wd;		/* Watch descriptor.  */
+  uint32_t mask;	/* Watch mask.  */
+  uint32_t cookie;	/* Cookie to synchronize two events.  */
+  uint32_t len;		/* Length (including NULs) of name.  */
+  char name __flexarr;	/* Name.  */
+};
+
+
+/* Supported events suitable for MASK parameter of INOTIFY_ADD_WATCH.  */
+#define IN_ACCESS	 0x00000001	/* File was accessed.  */
+#define IN_MODIFY	 0x00000002	/* File was modified.  */
+#define IN_ATTRIB	 0x00000004	/* Metadata changed.  */
+#define IN_CLOSE_WRITE	 0x00000008	/* Writtable file was closed.  */
+#define IN_CLOSE_NOWRITE 0x00000010	/* Unwrittable file closed.  */
+#define IN_CLOSE	 (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* Close.  */
+#define IN_OPEN		 0x00000020	/* File was opened.  */
+#define IN_MOVED_FROM	 0x00000040	/* File was moved from X.  */
+#define IN_MOVED_TO      0x00000080	/* File was moved to Y.  */
+#define IN_MOVE		 (IN_MOVED_FROM | IN_MOVED_TO) /* Moves.  */
+#define IN_CREATE	 0x00000100	/* Subfile was created.  */
+#define IN_DELETE	 0x00000200	/* Subfile was deleted.  */
+#define IN_DELETE_SELF	 0x00000400	/* Self was deleted.  */
+#define IN_MOVE_SELF	 0x00000800	/* Self was moved.  */
+
+/* Events sent by the kernel.  */
+#define IN_UNMOUNT	 0x00002000	/* Backing fs was unmounted.  */
+#define IN_Q_OVERFLOW	 0x00004000	/* Event queued overflowed.  */
+#define IN_IGNORED	 0x00008000	/* File was ignored.  */
+
+/* Helper events.  */
+#define IN_CLOSE	 (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE)	/* Close.  */
+#define IN_MOVE		 (IN_MOVED_FROM | IN_MOVED_TO)		/* Moves.  */
+
+/* Special flags.  */
+#define IN_ONLYDIR	 0x01000000	/* Only watch the path if it is a
+					   directory.  */
+#define IN_DONT_FOLLOW	 0x02000000	/* Do not follow a sym link.  */
+#define IN_EXCL_UNLINK	 0x04000000	/* Exclude events on unlinked
+					   objects.  */
+#define IN_MASK_ADD	 0x20000000	/* Add to the mask of an already
+					   existing watch.  */
+#define IN_ISDIR	 0x40000000	/* Event occurred against dir.  */
+#define IN_ONESHOT	 0x80000000	/* Only send event once.  */
+
+/* All events which a program can wait on.  */
+#define IN_ALL_EVENTS	 (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE  \
+			  | IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM	      \
+			  | IN_MOVED_TO | IN_CREATE | IN_DELETE		      \
+			  | IN_DELETE_SELF | IN_MOVE_SELF)
+
+
+__BEGIN_DECLS
+
+/* Create and initialize inotify instance.  */
+extern int inotify_init (void) __THROW;
+
+/* Create and initialize inotify instance.  */
+extern int inotify_init1 (int __flags) __THROW;
+
+/* Add watch of object NAME to inotify instance FD.  Notify about
+   events specified by MASK.  */
+extern int inotify_add_watch (int __fd, const char *__name, uint32_t __mask)
+  __THROW;
+
+/* Remove the watch specified by WD from the inotify instance FD.  */
+extern int inotify_rm_watch (int __fd, int __wd) __THROW;
+
+__END_DECLS
+
+#endif /* sys/inotify.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sys/prctl.h b/ap/build/uClibc/libc/sysdeps/linux/common/sys/prctl.h
new file mode 100644
index 0000000..7e9b72d
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sys/prctl.h
@@ -0,0 +1,32 @@
+/* Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_PRCTL_H
+#define _SYS_PRCTL_H	1
+
+#include <features.h>
+#include <linux/prctl.h>  /*  The magic values come from here  */
+
+__BEGIN_DECLS
+
+/* Control process execution.  */
+extern int prctl (int __option, ...) __THROW;
+
+__END_DECLS
+
+#endif  /* sys/prctl.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sys/ptrace.h b/ap/build/uClibc/libc/sysdeps/linux/common/sys/ptrace.h
new file mode 100644
index 0000000..08658f9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sys/ptrace.h
@@ -0,0 +1,168 @@
+/* `ptrace' debugger support interface.  Linux version.
+   Copyright (C) 1996-1999,2000,2006,2007 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_PTRACE_H
+#define _SYS_PTRACE_H	1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Type of the REQUEST argument to `ptrace.'  */
+enum __ptrace_request
+{
+  /* Indicate that the process making this request should be traced.
+     All signals received by this process can be intercepted by its
+     parent, and its parent can use the other `ptrace' requests.  */
+  PTRACE_TRACEME = 0,
+#define PT_TRACE_ME PTRACE_TRACEME
+
+  /* Return the word in the process's text space at address ADDR.  */
+  PTRACE_PEEKTEXT = 1,
+#define PT_READ_I PTRACE_PEEKTEXT
+
+  /* Return the word in the process's data space at address ADDR.  */
+  PTRACE_PEEKDATA = 2,
+#define PT_READ_D PTRACE_PEEKDATA
+
+  /* Return the word in the process's user area at offset ADDR.  */
+  PTRACE_PEEKUSER = 3,
+#define PT_READ_U PTRACE_PEEKUSER
+
+  /* Write the word DATA into the process's text space at address ADDR.  */
+  PTRACE_POKETEXT = 4,
+#define PT_WRITE_I PTRACE_POKETEXT
+
+  /* Write the word DATA into the process's data space at address ADDR.  */
+  PTRACE_POKEDATA = 5,
+#define PT_WRITE_D PTRACE_POKEDATA
+
+  /* Write the word DATA into the process's user area at offset ADDR.  */
+  PTRACE_POKEUSER = 6,
+#define PT_WRITE_U PTRACE_POKEUSER
+
+  /* Continue the process.  */
+  PTRACE_CONT = 7,
+#define PT_CONTINUE PTRACE_CONT
+
+  /* Kill the process.  */
+  PTRACE_KILL = 8,
+#define PT_KILL PTRACE_KILL
+
+  /* Single step the process.
+     This is not supported on all machines.  */
+  PTRACE_SINGLESTEP = 9,
+#define PT_STEP PTRACE_SINGLESTEP
+
+  /* Get all general purpose registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_GETREGS = 12,
+#define PT_GETREGS PTRACE_GETREGS
+
+  /* Set all general purpose registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_SETREGS = 13,
+#define PT_SETREGS PTRACE_SETREGS
+
+  /* Get all floating point registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_GETFPREGS = 14,
+#define PT_GETFPREGS PTRACE_GETFPREGS
+
+  /* Set all floating point registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_SETFPREGS = 15,
+#define PT_SETFPREGS PTRACE_SETFPREGS
+
+  /* Attach to a process that is already running. */
+  PTRACE_ATTACH = 16,
+#define PT_ATTACH PTRACE_ATTACH
+
+  /* Detach from a process attached to with PTRACE_ATTACH.  */
+  PTRACE_DETACH = 17,
+#define PT_DETACH PTRACE_DETACH
+
+  /* Get all extended floating point registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_GETFPXREGS = 18,
+#define PT_GETFPXREGS PTRACE_GETFPXREGS
+
+  /* Set all extended floating point registers used by a processes.
+     This is not supported on all machines.  */
+   PTRACE_SETFPXREGS = 19,
+#define PT_SETFPXREGS PTRACE_SETFPXREGS
+
+  /* Continue and stop at the next (return from) syscall.  */
+  PTRACE_SYSCALL = 24,
+#define PT_SYSCALL PTRACE_SYSCALL
+
+  /* Set ptrace filter options.  */
+  PTRACE_SETOPTIONS = 0x4200,
+#define PT_SETOPTIONS PTRACE_SETOPTIONS
+
+  /* Get last ptrace message.  */
+  PTRACE_GETEVENTMSG = 0x4201,
+#define PT_GETEVENTMSG PTRACE_GETEVENTMSG
+
+  /* Get siginfo for process.  */
+  PTRACE_GETSIGINFO = 0x4202,
+#define PT_GETSIGINFO PTRACE_GETSIGINFO
+
+  /* Set new siginfo for process.  */
+  PTRACE_SETSIGINFO = 0x4203
+#define PT_SETSIGINFO PTRACE_SETSIGINFO
+};
+
+
+/* Options set using PTRACE_SETOPTIONS.  */
+enum __ptrace_setoptions {
+  PTRACE_O_TRACESYSGOOD	= 0x00000001,
+  PTRACE_O_TRACEFORK	= 0x00000002,
+  PTRACE_O_TRACEVFORK   = 0x00000004,
+  PTRACE_O_TRACECLONE	= 0x00000008,
+  PTRACE_O_TRACEEXEC	= 0x00000010,
+  PTRACE_O_TRACEVFORKDONE = 0x00000020,
+  PTRACE_O_TRACEEXIT	= 0x00000040,
+  PTRACE_O_MASK		= 0x0000007f
+};
+
+/* Wait extended result codes for the above trace options.  */
+enum __ptrace_eventcodes {
+  PTRACE_EVENT_FORK	= 1,
+  PTRACE_EVENT_VFORK	= 2,
+  PTRACE_EVENT_CLONE	= 3,
+  PTRACE_EVENT_EXEC	= 4,
+  PTRACE_EVENT_VFORK_DONE = 5,
+  PTRACE_EVENT_EXIT	= 6
+};
+
+/* Perform process tracing functions.  REQUEST is one of the values
+   above, and determines the action to be taken.
+   For all requests except PTRACE_TRACEME, PID specifies the process to be
+   traced.
+
+   PID and the other arguments described above for the various requests should
+   appear (those that are used for the particular request) as:
+     pid_t PID, void *ADDR, int DATA, void *ADDR2
+   after REQUEST.  */
+extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_PTRACE_H */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sys/signalfd.h b/ap/build/uClibc/libc/sysdeps/linux/common/sys/signalfd.h
new file mode 100644
index 0000000..46a8d47
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sys/signalfd.h
@@ -0,0 +1,58 @@
+/* Copyright (C) 2007-2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_SIGNALFD_H
+#define	_SYS_SIGNALFD_H	1
+
+#define __need_sigset_t
+#include <signal.h>
+#include <stdint.h>
+
+/* Get the platform-dependent flags.  */
+#include <bits/signalfd.h>
+
+struct signalfd_siginfo
+{
+  uint32_t ssi_signo;
+  int32_t ssi_errno;
+  int32_t ssi_code;
+  uint32_t ssi_pid;
+  uint32_t ssi_uid;
+  int32_t ssi_fd;
+  uint32_t ssi_tid;
+  uint32_t ssi_band;
+  uint32_t ssi_overrun;
+  uint32_t ssi_trapno;
+  int32_t ssi_status;
+  int32_t ssi_int;
+  uint64_t ssi_ptr;
+  uint64_t ssi_utime;
+  uint64_t ssi_stime;
+  uint64_t ssi_addr;
+  uint8_t __pad[48];
+};
+
+__BEGIN_DECLS
+
+/* Request notification for delivery of signals in MASK to be
+   performed using descriptor FD.*/
+extern int signalfd (int __fd, const sigset_t *__mask, int __flags)
+  __THROW __nonnull ((2));
+
+__END_DECLS
+
+#endif /* sys/signalfd.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sys/timerfd.h b/ap/build/uClibc/libc/sysdeps/linux/common/sys/timerfd.h
new file mode 100644
index 0000000..989382a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sys/timerfd.h
@@ -0,0 +1,52 @@
+/* Copyright (C) 2008, 2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_SYS_TIMERFD_H
+#define	_SYS_TIMERFD_H	1
+
+#include <time.h>
+
+/* Get the platform-dependent flags.  */
+#include <bits/timerfd.h>
+
+
+/* Bits to be set in the FLAGS parameter of `timerfd_settime'.  */
+enum
+  {
+    TFD_TIMER_ABSTIME = 1 << 0
+#define TFD_TIMER_ABSTIME TFD_TIMER_ABSTIME
+  };
+
+
+__BEGIN_DECLS
+
+/* Return file descriptor for new interval timer source.  */
+extern int timerfd_create (clockid_t __clock_id, int __flags) __THROW;
+
+/* Set next expiration time of interval timer source UFD to UTMR.  If
+   FLAGS has the TFD_TIMER_ABSTIME flag set the timeout value is
+   absolute.  Optionally return the old expiration time in OTMR.  */
+extern int timerfd_settime (int __ufd, int __flags,
+			    const struct itimerspec *__utmr,
+			    struct itimerspec *__otmr) __THROW;
+
+/* Return the next expiration time of UFD.  */
+extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW;
+
+__END_DECLS
+
+#endif /* sys/timerfd.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sys/user.h b/ap/build/uClibc/libc/sysdeps/linux/common/sys/user.h
new file mode 100644
index 0000000..03e56c3
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sys/user.h
@@ -0,0 +1 @@
+#error "This file is machine-dependent and not provided for this machine."
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/syscall.c b/ap/build/uClibc/libc/sysdeps/linux/common/syscall.c
new file mode 100644
index 0000000..61f798e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/syscall.c
@@ -0,0 +1,12 @@
+/*
+ * syscall() library function
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+long syscall(long sysnum, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6)
+{
+	return INLINE_SYSCALL_NCS(sysnum, 6, arg1, arg2, arg3, arg4, arg5, arg6);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/syscalls.h b/ap/build/uClibc/libc/sysdeps/linux/common/syscalls.h
new file mode 100644
index 0000000..c4f6a44
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/syscalls.h
@@ -0,0 +1,24 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Common header file for uClibc syscalls
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define _LARGEFILE64_SOURCE
+#include <features.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <endian.h>
+
+#undef __OPTIMIZE__
+/* We absolutely do _NOT_ want interfaces silently
+ * being renamed under us or very bad things will happen... */
+#ifdef __USE_FILE_OFFSET64
+# undef __USE_FILE_OFFSET64
+#endif
+
+#include <bits/kernel_types.h>
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sysctl.c b/ap/build/uClibc/libc/sysdeps/linux/common/sysctl.c
new file mode 100644
index 0000000..dde00be
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sysctl.c
@@ -0,0 +1,38 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * _sysctl() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#if defined __NR__sysctl && (defined __USE_GNU || defined __USE_BSD)
+
+/* psm: including sys/sysctl.h would depend on kernel headers */
+struct __sysctl_args {
+	int *name;
+	int nlen;
+	void *oldval;
+	size_t *oldlenp;
+	void *newval;
+	size_t newlen;
+	unsigned long __unused[4];
+};
+extern int sysctl (int *__name, int __nlen, void *__oldval,
+				   size_t *__oldlenp, void *__newval, size_t __newlen) __THROW;
+int sysctl(int *name, int nlen, void *oldval, size_t * oldlenp,
+		   void *newval, size_t newlen)
+{
+	/* avoid initializing on the stack as gcc will call memset() */
+	struct __sysctl_args args;
+	args.name = name;
+	args.nlen = nlen;
+	args.oldval = oldval;
+	args.oldlenp = oldlenp;
+	args.newval = newval;
+	args.newlen = newlen;
+	return INLINE_SYSCALL(_sysctl, 1, &args);
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sysdep.h b/ap/build/uClibc/libc/sysdeps/linux/common/sysdep.h
new file mode 100644
index 0000000..156e571
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sysdep.h
@@ -0,0 +1,175 @@
+/* Generic asm macros used on many machines.
+   Copyright (C) 1991,92,93,96,98,2002,2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/syscall.h>
+
+#ifndef C_LABEL
+
+/* Define a macro we can use to construct the asm name for a C symbol.  */
+#ifndef	__UCLIBC_UNDERSCORES__
+#ifdef	__STDC__
+#define C_LABEL(name)		name##:
+#else
+#define C_LABEL(name)		name/**/:
+#endif
+#else
+#ifdef	__STDC__
+#define C_LABEL(name)		_##name##:
+#else
+#define C_LABEL(name)		_/**/name/**/:
+#endif
+#endif
+
+#endif
+
+#ifdef __ASSEMBLER__
+/* Mark the end of function named SYM.  This is used on some platforms
+   to generate correct debugging information.  */
+#ifndef END
+#define END(sym)
+#endif
+
+#ifndef JUMPTARGET
+#define JUMPTARGET(sym)		sym
+#endif
+
+/* Macros to generate eh_frame unwind information.  */
+# ifdef HAVE_ASM_CFI_DIRECTIVES
+#  define cfi_sections(sect...) 	.cfi_sections sect
+#  define cfi_startproc			.cfi_startproc
+#  define cfi_endproc			.cfi_endproc
+#  define cfi_def_cfa(reg, off)		.cfi_def_cfa reg, off
+#  define cfi_def_cfa_register(reg)	.cfi_def_cfa_register reg
+#  define cfi_def_cfa_offset(off)	.cfi_def_cfa_offset off
+#  define cfi_adjust_cfa_offset(off)	.cfi_adjust_cfa_offset off
+#  define cfi_offset(reg, off)		.cfi_offset reg, off
+#  define cfi_rel_offset(reg, off)	.cfi_rel_offset reg, off
+#  define cfi_register(r1, r2)		.cfi_register r1, r2
+#  define cfi_return_column(reg)	.cfi_return_column reg
+#  define cfi_restore(reg)		.cfi_restore reg
+#  define cfi_same_value(reg)		.cfi_same_value reg
+#  define cfi_undefined(reg)		.cfi_undefined reg
+#  define cfi_remember_state		.cfi_remember_state
+#  define cfi_restore_state		.cfi_restore_state
+#  define cfi_window_save		.cfi_window_save
+#  define cfi_personality(enc, exp)	.cfi_personality enc, exp
+#  define cfi_lsda(enc, exp)		.cfi_lsda enc, exp
+
+# else
+#  define cfi_sections(sect...)
+#  define cfi_startproc
+#  define cfi_endproc
+#  define cfi_def_cfa(reg, off)
+#  define cfi_def_cfa_register(reg)
+#  define cfi_def_cfa_offset(off)
+#  define cfi_adjust_cfa_offset(off)
+#  define cfi_offset(reg, off)
+#  define cfi_rel_offset(reg, off)
+#  define cfi_register(r1, r2)
+#  define cfi_return_column(reg)
+#  define cfi_restore(reg)
+#  define cfi_same_value(reg)
+#  define cfi_undefined(reg)
+#  define cfi_remember_state
+#  define cfi_restore_state
+#  define cfi_window_save
+#  define cfi_personality(enc, exp)
+#  define cfi_lsda(enc, exp)
+# endif
+
+#else /* ! ASSEMBLER */
+# ifdef HAVE_ASM_CFI_DIRECTIVES
+#  define CFI_STRINGIFY(Name) CFI_STRINGIFY2 (Name)
+#  define CFI_STRINGIFY2(Name) #Name
+#  define CFI_SECTIONS(sect...) \
+   ".cfi_sections " CFI_STRINGIFY(sect)
+#  define CFI_STARTPROC	".cfi_startproc"
+#  define CFI_ENDPROC	".cfi_endproc"
+#  define CFI_DEF_CFA(reg, off)	\
+   ".cfi_def_cfa " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
+#  define CFI_DEF_CFA_REGISTER(reg) \
+   ".cfi_def_cfa_register " CFI_STRINGIFY(reg)
+#  define CFI_DEF_CFA_OFFSET(off) \
+   ".cfi_def_cfa_offset " CFI_STRINGIFY(off)
+#  define CFI_ADJUST_CFA_OFFSET(off) \
+   ".cfi_adjust_cfa_offset " CFI_STRINGIFY(off)
+#  define CFI_OFFSET(reg, off) \
+   ".cfi_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
+#  define CFI_REL_OFFSET(reg, off) \
+   ".cfi_rel_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
+#  define CFI_REGISTER(r1, r2) \
+   ".cfi_register " CFI_STRINGIFY(r1) "," CFI_STRINGIFY(r2)
+#  define CFI_RETURN_COLUMN(reg) \
+   ".cfi_return_column " CFI_STRINGIFY(reg)
+#  define CFI_RESTORE(reg) \
+   ".cfi_restore " CFI_STRINGIFY(reg)
+#  define CFI_UNDEFINED(reg) \
+   ".cfi_undefined " CFI_STRINGIFY(reg)
+#  define CFI_REMEMBER_STATE \
+   ".cfi_remember_state"
+#  define CFI_RESTORE_STATE \
+   ".cfi_restore_state"
+#  define CFI_WINDOW_SAVE \
+   ".cfi_window_save"
+#  define CFI_PERSONALITY(enc, exp) \
+   ".cfi_personality " CFI_STRINGIFY(enc) "," CFI_STRINGIFY(exp)
+#  define CFI_LSDA(enc, exp) \
+   ".cfi_lsda " CFI_STRINGIFY(enc) "," CFI_STRINGIFY(exp)
+# else
+#  define CFI_SECTIONS(sect...)
+#  define CFI_STARTPROC
+#  define CFI_ENDPROC
+#  define CFI_DEF_CFA(reg, off)
+#  define CFI_DEF_CFA_REGISTER(reg)
+#  define CFI_DEF_CFA_OFFSET(off)
+#  define CFI_ADJUST_CFA_OFFSET(off)
+#  define CFI_OFFSET(reg, off)
+#  define CFI_REL_OFFSET(reg, off)
+#  define CFI_REGISTER(r1, r2)
+#  define CFI_RETURN_COLUMN(reg)
+#  define CFI_RESTORE(reg)
+#  define CFI_UNDEFINED(reg)
+#  define CFI_REMEMBER_STATE
+#  define CFI_RESTORE_STATE
+#  define CFI_WINDOW_SAVE
+#  define CFI_PERSONALITY(enc, exp)
+#  define CFI_LSDA(enc, exp)
+# endif
+
+#endif /* __ASSEMBLER__ */
+
+/* Values used for encoding parameter of cfi_personality and cfi_lsda.  */
+#define DW_EH_PE_absptr		0x00
+#define DW_EH_PE_omit		0xff
+#define DW_EH_PE_uleb128	0x01
+#define DW_EH_PE_udata2		0x02
+#define DW_EH_PE_udata4		0x03
+#define DW_EH_PE_udata8		0x04
+#define DW_EH_PE_sleb128	0x09
+#define DW_EH_PE_sdata2		0x0a
+#define DW_EH_PE_sdata4		0x0b
+#define DW_EH_PE_sdata8		0x0c
+#define DW_EH_PE_signed		0x08
+#define DW_EH_PE_pcrel		0x10
+#define DW_EH_PE_textrel	0x20
+#define DW_EH_PE_datarel	0x30
+#define DW_EH_PE_funcrel	0x40
+#define DW_EH_PE_aligned	0x50
+#define DW_EH_PE_indirect	0x80
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sysfs.c b/ap/build/uClibc/libc/sysdeps/linux/common/sysfs.c
new file mode 100644
index 0000000..02f37d7
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sysfs.c
@@ -0,0 +1,17 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sysfs() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+/* libc isn't really supposed to export this */
+#if 0
+#include <sys/syscall.h>
+
+#if defined __USE_SVID
+_syscall3(int, sysfs, int, option, unsigned int, index, char, addr)
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/sysinfo.c b/ap/build/uClibc/libc/sysdeps/linux/common/sysinfo.c
new file mode 100644
index 0000000..fc37aaf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/sysinfo.c
@@ -0,0 +1,12 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * sysinfo() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/sysinfo.h>
+_syscall1(int, sysinfo, struct sysinfo *, info)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/tee.c b/ap/build/uClibc/libc/sysdeps/linux/common/tee.c
new file mode 100644
index 0000000..5047767
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/tee.c
@@ -0,0 +1,16 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * tee() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <fcntl.h>
+
+#ifdef __NR_tee
+_syscall4(ssize_t, tee, int, __fdin, int, __fdout, size_t, __len,
+	unsigned int, __flags)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/time.c b/ap/build/uClibc/libc/sysdeps/linux/common/time.c
new file mode 100644
index 0000000..e13b44f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/time.c
@@ -0,0 +1,34 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * time() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <time.h>
+#include <sys/time.h>
+
+
+#ifdef __NR_time
+_syscall_noerr1(time_t, time, time_t *, t)
+#else
+time_t time(time_t * t)
+{
+	time_t result;
+	struct timeval tv;
+
+	/* In Linux, gettimeofday fails only on bad parameter.
+	 * We know that here parameter isn't bad.
+	 */
+	gettimeofday(&tv, NULL);
+	result = (time_t) tv.tv_sec;
+	if (t != NULL) {
+		*t = result;
+	}
+	return result;
+}
+#endif
+libc_hidden_def(time)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/timerfd.c b/ap/build/uClibc/libc/sysdeps/linux/common/timerfd.c
new file mode 100644
index 0000000..2332044
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/timerfd.c
@@ -0,0 +1,32 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * timerfd_create() / timerfd_settime() / timerfd_gettime() for uClibc
+ *
+ * Copyright (C) 2009 Stephan Raue <stephan@openelec.tv>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/timerfd.h>
+
+/*
+ * timerfd_create()
+ */
+#ifdef __NR_timerfd_create
+_syscall2(int, timerfd_create, int, clockid, int, flags)
+#endif
+
+/*
+ * timerfd_settime()
+ */
+#ifdef __NR_timerfd_settime
+_syscall4(int,timerfd_settime, int, ufd, int, flags, const struct itimerspec *, utmr, struct itimerspec *, otmr)
+#endif
+
+/*
+ * timerfd_gettime()
+ */
+#ifdef __NR_timerfd_gettime
+_syscall2(int, timerfd_gettime, int, ufd, struct itimerspec *, otmr)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/times.c b/ap/build/uClibc/libc/sysdeps/linux/common/times.c
new file mode 100644
index 0000000..37ae040
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/times.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * times() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/times.h>
+
+
+_syscall_noerr1(clock_t, times, struct tms *, buf)
+libc_hidden_def(times)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/truncate.c b/ap/build/uClibc/libc/sysdeps/linux/common/truncate.c
new file mode 100644
index 0000000..2331bdd
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/truncate.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * truncate() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+
+_syscall2(int, truncate, const char *, path, __off_t, length)
+libc_hidden_def(truncate)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/truncate64.c b/ap/build/uClibc/libc/sysdeps/linux/common/truncate64.c
new file mode 100644
index 0000000..1f6c459
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/truncate64.c
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* truncate64 syscall.  Copes with 64 bit and 32 bit machines
+ * and on 32 bit machines this sends things into the kernel as
+ * two 32-bit arguments (high and low 32 bits of length) that
+ * are ordered based on endianess.  It turns out endian.h has
+ * just the macro we need to order things, __LONG_LONG_PAIR.
+ */
+
+#include <features.h>
+#include <unistd.h>
+#include <errno.h>
+#include <endian.h>
+#include <stdint.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+#if defined __UCLIBC_HAS_LFS__
+
+#if defined __NR_truncate64
+
+#if __WORDSIZE == 64
+
+/* For a 64 bit machine, life is simple... */
+_syscall2(int, truncate64, const char *, path, __off64_t, length)
+
+#elif __WORDSIZE == 32
+
+/* The exported truncate64 function.  */
+int truncate64(const char * path, __off64_t length)
+{
+	uint32_t low = length & 0xffffffff;
+	uint32_t high = length >> 32;
+#if defined(__UCLIBC_TRUNCATE64_HAS_4_ARGS__)
+	return INLINE_SYSCALL(truncate64, 4, path, 0,
+			__LONG_LONG_PAIR(high, low));
+#else
+	return INLINE_SYSCALL(truncate64, 3, path,
+			__LONG_LONG_PAIR(high, low));
+#endif
+}
+
+#else /* __WORDSIZE */
+#error Your machine is not 64 bit nor 32 bit, I am dazed and confused.
+#endif /* __WORDSIZE */
+
+#else  /* __NR_truncate64 */
+
+
+int truncate64(const char * path, __off64_t length)
+{
+	__off_t x = (__off_t) length;
+
+	if (x == length) {
+		return truncate(path, x);
+	}
+
+	__set_errno((x < 0) ? EINVAL : EFBIG);
+
+	return -1;
+}
+
+#endif /* __NR_truncate64 */
+
+#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/ulimit.c b/ap/build/uClibc/libc/sysdeps/linux/common/ulimit.c
new file mode 100644
index 0000000..8be4a37
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/ulimit.c
@@ -0,0 +1,48 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+#include <stdarg.h>
+#include <unistd.h>
+#include <ulimit.h>
+#include <sys/resource.h>
+
+
+long int ulimit(int cmd, ...)
+{
+	va_list va;
+	struct rlimit limit;
+	long int result = -1;
+	va_start (va, cmd);
+	switch (cmd) {
+		/* Get limit on file size.  */
+		case UL_GETFSIZE:
+			if (getrlimit(RLIMIT_FSIZE, &limit) == 0)
+				result =  limit.rlim_cur / 512; /* bytes to 512 byte blocksize */
+			break;
+		/* Set limit on file size.  */
+		case UL_SETFSIZE:
+			result = va_arg (va, long int);
+			if ((rlim_t) result > RLIM_INFINITY / 512) {
+				limit.rlim_cur = RLIM_INFINITY;
+				limit.rlim_max = RLIM_INFINITY;
+			} else {
+				limit.rlim_cur = result * 512;
+				limit.rlim_max = result * 512;
+			}
+			result = setrlimit(RLIMIT_FSIZE, &limit);
+			break;
+		case __UL_GETOPENMAX:
+			result = sysconf(_SC_OPEN_MAX);
+			break;
+		default:
+			__set_errno(EINVAL);
+	}
+	va_end (va);
+	return result;
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/umask.c b/ap/build/uClibc/libc/sysdeps/linux/common/umask.c
new file mode 100644
index 0000000..b838e17
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/umask.c
@@ -0,0 +1,19 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * umask() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/stat.h>
+
+#define __NR___syscall_umask __NR_umask
+static __inline__ _syscall1(__kernel_mode_t, __syscall_umask, __kernel_mode_t, mode)
+
+mode_t umask(mode_t mode)
+{
+	return __syscall_umask(mode);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/umount.c b/ap/build/uClibc/libc/sysdeps/linux/common/umount.c
new file mode 100644
index 0000000..a084d29
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/umount.c
@@ -0,0 +1,32 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * umount() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+#if defined __USE_GNU
+#include <sys/mount.h>
+
+/* arch provides umount() syscall */
+#ifdef __NR_umount
+
+_syscall1(int, umount, const char *, specialfile)
+
+/* arch provides umount2() syscall */
+#elif defined __NR_umount2
+
+# define __NR___syscall_umount2 __NR_umount2
+static __inline__ _syscall2(int, __syscall_umount2, const char *, special_file, int, flags)
+
+int umount(const char *special_file)
+{
+	return (__syscall_umount2(special_file, 0));
+}
+
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/umount2.c b/ap/build/uClibc/libc/sysdeps/linux/common/umount2.c
new file mode 100644
index 0000000..2cc4a23
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/umount2.c
@@ -0,0 +1,17 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * umount2() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+#if defined __USE_GNU
+#include <sys/mount.h>
+#ifdef __NR_umount2	/* Old kernels don't have umount2 */
+_syscall2(int, umount2, const char *, special_file, int, flags)
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/uname.c b/ap/build/uClibc/libc/sysdeps/linux/common/uname.c
new file mode 100644
index 0000000..0feec93
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/uname.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * uname() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/utsname.h>
+
+
+_syscall1(int, uname, struct utsname *, buf)
+libc_hidden_def(uname)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/unlink.c b/ap/build/uClibc/libc/sysdeps/linux/common/unlink.c
new file mode 100644
index 0000000..513cdd5
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/unlink.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * unlink() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+
+_syscall1(int, unlink, const char *, pathname)
+libc_hidden_def(unlink)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/unlinkat.c b/ap/build/uClibc/libc/sysdeps/linux/common/unlinkat.c
new file mode 100644
index 0000000..0eaf2b6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/unlinkat.c
@@ -0,0 +1,16 @@
+/*
+ * unlinkat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+#ifdef __NR_unlinkat
+_syscall3(int, unlinkat, int, fd, const char *, file, int, flag)
+#else
+/* should add emulation with unlink() and /proc/self/fd/ ... */
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/unshare.c b/ap/build/uClibc/libc/sysdeps/linux/common/unshare.c
new file mode 100644
index 0000000..624ca12
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/unshare.c
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * unshare() for uClibc
+ *
+ * Copyright (C) 2011 Henning Heinold <heinold@inf.fu-berlin.de>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sched.h>
+
+#if defined __NR_unshare
+_syscall1(int, unshare, int, flags)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/unwind.h b/ap/build/uClibc/libc/sysdeps/linux/common/unwind.h
new file mode 100644
index 0000000..81fc4db
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/unwind.h
@@ -0,0 +1,220 @@
+/* Exception handling and frame unwind runtime interface routines.
+   Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* This is derived from the C++ ABI for IA-64.  Where we diverge
+   for cross-architecture compatibility are noted with "@@@".  */
+
+#ifndef _UNWIND_H
+#define _UNWIND_H	1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Level 1: Base ABI  */
+
+/* @@@ The IA-64 ABI uses uint64 throughout.  Most places this is
+   inefficient for 32-bit and smaller machines.  */
+typedef unsigned _Unwind_Word __attribute__((__mode__(__word__)));
+typedef signed _Unwind_Sword __attribute__((__mode__(__word__)));
+#if defined(__ia64__) && defined(__hpux__)
+typedef unsigned _Unwind_Ptr __attribute__((__mode__(__word__)));
+#else
+typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__)));
+#endif
+typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__)));
+
+/* @@@ The IA-64 ABI uses a 64-bit word to identify the producer and
+   consumer of an exception.  We'll go along with this for now even on
+   32-bit machines.  We'll need to provide some other option for
+   16-bit machines and for machines with > 8 bits per byte.  */
+typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__)));
+
+/* The unwind interface uses reason codes in several contexts to
+   identify the reasons for failures or other actions.  */
+typedef enum
+{
+  _URC_NO_REASON = 0,
+  _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
+  _URC_FATAL_PHASE2_ERROR = 2,
+  _URC_FATAL_PHASE1_ERROR = 3,
+  _URC_NORMAL_STOP = 4,
+  _URC_END_OF_STACK = 5,
+  _URC_HANDLER_FOUND = 6,
+  _URC_INSTALL_CONTEXT = 7,
+  _URC_CONTINUE_UNWIND = 8
+} _Unwind_Reason_Code;
+
+
+/* The unwind interface uses a pointer to an exception header object
+   as its representation of an exception being thrown. In general, the
+   full representation of an exception object is language- and
+   implementation-specific, but it will be prefixed by a header
+   understood by the unwind interface.  */
+
+struct _Unwind_Exception;
+
+typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code,
+					      struct _Unwind_Exception *);
+
+struct _Unwind_Exception
+{
+  _Unwind_Exception_Class exception_class;
+  _Unwind_Exception_Cleanup_Fn exception_cleanup;
+  _Unwind_Word private_1;
+  _Unwind_Word private_2;
+
+  /* @@@ The IA-64 ABI says that this structure must be double-word aligned.
+     Taking that literally does not make much sense generically.  Instead we
+     provide the maximum alignment required by any type for the machine.  */
+} __attribute__((__aligned__));
+
+
+/* The ACTIONS argument to the personality routine is a bitwise OR of one
+   or more of the following constants.  */
+typedef int _Unwind_Action;
+
+#define _UA_SEARCH_PHASE	1
+#define _UA_CLEANUP_PHASE	2
+#define _UA_HANDLER_FRAME	4
+#define _UA_FORCE_UNWIND	8
+#define _UA_END_OF_STACK	16
+
+/* This is an opaque type used to refer to a system-specific data
+   structure used by the system unwinder. This context is created and
+   destroyed by the system, and passed to the personality routine
+   during unwinding.  */
+struct _Unwind_Context;
+
+/* Raise an exception, passing along the given exception object.  */
+extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *);
+
+/* Raise an exception for forced unwinding.  */
+
+typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
+     (int, _Unwind_Action, _Unwind_Exception_Class,
+      struct _Unwind_Exception *, struct _Unwind_Context *, void *);
+
+extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *,
+						 _Unwind_Stop_Fn,
+						 void *);
+
+/* Helper to invoke the exception_cleanup routine.  */
+extern void _Unwind_DeleteException (struct _Unwind_Exception *);
+
+/* Resume propagation of an existing exception.  This is used after
+   e.g. executing cleanup code, and not to implement rethrowing.  */
+extern void _Unwind_Resume (struct _Unwind_Exception *);
+
+/* @@@ Use unwind data to perform a stack backtrace.  The trace callback
+   is called for every stack frame in the call chain, but no cleanup
+   actions are performed.  */
+typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn)
+     (struct _Unwind_Context *, void *);
+
+extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *);
+
+/* These functions are used for communicating information about the unwind
+   context (i.e. the unwind descriptors and the user register state) between
+   the unwind library and the personality routine and landing pad.  Only
+   selected registers maybe manipulated.  */
+
+extern _Unwind_Word _Unwind_GetGR (struct _Unwind_Context *, int);
+extern void _Unwind_SetGR (struct _Unwind_Context *, int, _Unwind_Word);
+
+extern _Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *);
+extern void _Unwind_SetIP (struct _Unwind_Context *, _Unwind_Ptr);
+
+/* @@@ Retrieve the CFA of the given context.  */
+extern _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *);
+
+extern void *_Unwind_GetLanguageSpecificData (struct _Unwind_Context *);
+
+extern _Unwind_Ptr _Unwind_GetRegionStart (struct _Unwind_Context *);
+
+
+/* The personality routine is the function in the C++ (or other language)
+   runtime library which serves as an interface between the system unwind
+   library and language-specific exception handling semantics.  It is
+   specific to the code fragment described by an unwind info block, and
+   it is always referenced via the pointer in the unwind info block, and
+   hence it has no ABI-specified name.
+
+   Note that this implies that two different C++ implementations can
+   use different names, and have different contents in the language
+   specific data area.  Moreover, that the language specific data
+   area contains no version info because name of the function invoked
+   provides more effective versioning by detecting at link time the
+   lack of code to handle the different data format.  */
+
+typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn)
+     (int, _Unwind_Action, _Unwind_Exception_Class,
+      struct _Unwind_Exception *, struct _Unwind_Context *);
+
+/* @@@ The following alternate entry points are for setjmp/longjmp
+   based unwinding.  */
+
+struct SjLj_Function_Context;
+extern void _Unwind_SjLj_Register (struct SjLj_Function_Context *);
+extern void _Unwind_SjLj_Unregister (struct SjLj_Function_Context *);
+
+extern _Unwind_Reason_Code _Unwind_SjLj_RaiseException
+     (struct _Unwind_Exception *);
+extern _Unwind_Reason_Code _Unwind_SjLj_ForcedUnwind
+     (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
+extern void _Unwind_SjLj_Resume (struct _Unwind_Exception *);
+
+/* @@@ The following provide access to the base addresses for text
+   and data-relative addressing in the LDSA.  In order to stay link
+   compatible with the standard ABI for IA-64, we inline these.  */
+
+#ifdef __ia64__
+#include <stdlib.h>
+
+static inline _Unwind_Ptr
+_Unwind_GetDataRelBase (struct _Unwind_Context *_C)
+{
+  /* The GP is stored in R1.  */
+  return _Unwind_GetGR (_C, 1);
+}
+
+static inline _Unwind_Ptr
+_Unwind_GetTextRelBase (struct _Unwind_Context *_C)
+{
+  abort ();
+  return 0;
+}
+
+/* @@@ Retrieve the Backing Store Pointer of the given context.  */
+extern _Unwind_Word _Unwind_GetBSP (struct _Unwind_Context *);
+#else
+extern _Unwind_Ptr _Unwind_GetDataRelBase (struct _Unwind_Context *);
+extern _Unwind_Ptr _Unwind_GetTextRelBase (struct _Unwind_Context *);
+#endif
+
+/* @@@ Given an address, return the entry point of the function that
+   contains it.  */
+extern void * _Unwind_FindEnclosingFunction (void *pc);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* unwind.h */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/uselib.c b/ap/build/uClibc/libc/sysdeps/linux/common/uselib.c
new file mode 100644
index 0000000..b2b806f
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/uselib.c
@@ -0,0 +1,18 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * uselib() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+#if 0
+linux specific and we do not use it in uClibc.
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#ifdef __NR_uselib
+int uselib (const char *library);
+_syscall1(int, uselib, const char *, library)
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/ustat.c b/ap/build/uClibc/libc/sysdeps/linux/common/ustat.c
new file mode 100644
index 0000000..e97fa76
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/ustat.c
@@ -0,0 +1,26 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * ustat() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/ustat.h>
+#include <sys/sysmacros.h>
+
+#define __NR___syscall_ustat __NR_ustat
+/* Kernel's fs/super.c defines this:
+ * long sys_ustat(unsigned dev, struct ustat __user * ubuf),
+ * thus we use unsigned, not __kernel_dev_t.
+ */
+static __inline__ _syscall2(int, __syscall_ustat,
+		unsigned, kdev_t,
+		struct ustat *, ubuf)
+
+int ustat(dev_t dev, struct ustat *ubuf)
+{
+	return __syscall_ustat(dev, ubuf);
+}
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/utime.c b/ap/build/uClibc/libc/sysdeps/linux/common/utime.c
new file mode 100644
index 0000000..c9fd1bf
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/utime.c
@@ -0,0 +1,35 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * utime() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <utime.h>
+
+
+#ifdef __NR_utime
+_syscall2(int, utime, const char *, file, const struct utimbuf *, times)
+#else
+#include <stdlib.h>
+#include <sys/time.h>
+
+
+int utime(const char *file, const struct utimbuf *times)
+{
+	struct timeval timevals[2];
+
+	if (times != NULL) {
+		timevals[0].tv_usec = 0L;
+		timevals[1].tv_usec = 0L;
+		timevals[0].tv_sec = (long int) times->actime;
+		timevals[1].tv_sec = (long int) times->modtime;
+	}
+	return utimes(file, times ? timevals : NULL);
+}
+#endif
+link_warning(utime, "the use of OBSOLESCENT `utime' is discouraged, use `utimes'")
+libc_hidden_def(utime)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/utimensat.c b/ap/build/uClibc/libc/sysdeps/linux/common/utimensat.c
new file mode 100644
index 0000000..2cfb824
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/utimensat.c
@@ -0,0 +1,18 @@
+/*
+ * utimensat() for uClibc
+ *
+ * Copyright (C) 2009 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/stat.h>
+
+#ifdef __NR_utimensat
+_syscall4(int, utimensat, int, fd, const char *, path, const struct timespec *, times, int, flags)
+libc_hidden_def(utimensat)
+#else
+/* should add emulation with utimens() and /proc/self/fd/ ... */
+#endif
+
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/utimes.c b/ap/build/uClibc/libc/sysdeps/linux/common/utimes.c
new file mode 100644
index 0000000..99d9202
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/utimes.c
@@ -0,0 +1,35 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * utimes() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <utime.h>
+#include <sys/time.h>
+
+
+#ifdef __NR_utimes
+_syscall2(int, utimes, const char *, file, const struct timeval *, tvp)
+#else
+#include <stdlib.h>
+
+
+int utimes(const char *file, const struct timeval tvp[2])
+{
+	struct utimbuf buf, *times;
+
+	if (tvp) {
+		times = &buf;
+		times->actime = tvp[0].tv_sec;
+		times->modtime = tvp[1].tv_sec;
+	} else {
+		times = NULL;
+	}
+	return utime(file, times);
+}
+#endif
+libc_hidden_def(utimes)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/vfork.c b/ap/build/uClibc/libc/sysdeps/linux/common/vfork.c
new file mode 100644
index 0000000..e7c9208
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/vfork.c
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+extern __typeof(vfork) __vfork attribute_hidden;
+
+#ifdef __NR_vfork
+
+# define __NR___vfork __NR_vfork
+_syscall0(pid_t, __vfork)
+
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
+
+#elif defined __ARCH_USE_MMU__ && defined __NR_fork
+
+/* Trivial implementation for arches that lack vfork */
+
+pid_t __vfork(void)
+{
+    return fork();
+}
+
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
+
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/vhangup.c b/ap/build/uClibc/libc/sysdeps/linux/common/vhangup.c
new file mode 100644
index 0000000..77910e6
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/vhangup.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * vhangup() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
+_syscall0(int, vhangup)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/vmsplice.c b/ap/build/uClibc/libc/sysdeps/linux/common/vmsplice.c
new file mode 100644
index 0000000..dd0640e
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/vmsplice.c
@@ -0,0 +1,16 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * vmsplice() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <fcntl.h>
+
+#ifdef __NR_vmsplice
+_syscall4(ssize_t, vmsplice, int, __fdout, const struct iovec *, __iov,
+	size_t, __count, unsigned int, __flags)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/wait.c b/ap/build/uClibc/libc/sysdeps/linux/common/wait.c
new file mode 100644
index 0000000..9b529eb
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/wait.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2006 Steven J. Hill <sjhill@realitydiluted.com>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+#include <stdlib.h>
+#include <syscall.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/resource.h>
+
+extern __typeof(wait) __libc_wait;
+/* Wait for a child to die.  When one does, put its status in *STAT_LOC
+ * and return its process ID.  For errors, return (pid_t) -1.  */
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <errno.h>
+#include <sysdep-cancel.h>
+
+pid_t attribute_hidden
+__libc_wait (__WAIT_STATUS_DEFN stat_loc)
+{
+  if (SINGLE_THREAD_P)
+    return INLINE_SYSCALL (wait4, 4, WAIT_ANY, stat_loc, 0,
+			   (struct rusage *) NULL);
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  pid_t result = INLINE_SYSCALL (wait4, 4, WAIT_ANY, stat_loc, 0,
+				 (struct rusage *) NULL);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
+}
+#else
+/* Wait for a child to die.  When one does, put its status in *STAT_LOC
+ * and return its process ID.  For errors, return (pid_t) -1.  */
+__pid_t __libc_wait (__WAIT_STATUS_DEFN stat_loc)
+{
+      return wait4 (WAIT_ANY, stat_loc, 0, (struct rusage *) NULL);
+}
+#endif
+weak_alias(__libc_wait,wait)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/wait3.c b/ap/build/uClibc/libc/sysdeps/linux/common/wait3.c
new file mode 100644
index 0000000..0d480ec
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/wait3.c
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/resource.h>
+
+#if defined __USE_BSD
+
+
+/* Wait for a child to exit.  When one does, put its status in *STAT_LOC and
+ * return its process ID.  For errors return (pid_t) -1.  If USAGE is not nil,
+ * store information about the child's resource usage (as a `struct rusage')
+ * there.  If the WUNTRACED bit is set in OPTIONS, return status for stopped
+ * children; otherwise don't.  */
+pid_t wait3 (__WAIT_STATUS stat_loc, int options, struct rusage * usage)
+{
+      return wait4 (WAIT_ANY, stat_loc, options, usage);
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/wait4.c b/ap/build/uClibc/libc/sysdeps/linux/common/wait4.c
new file mode 100644
index 0000000..dceab41
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/wait4.c
@@ -0,0 +1,25 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * wait4() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#include <sys/wait.h>
+#include <sys/resource.h>
+
+
+#define __NR___syscall_wait4 __NR_wait4
+static __inline__ _syscall4(int, __syscall_wait4, __kernel_pid_t, pid,
+		int *, status, int, opts, struct rusage *, rusage)
+
+pid_t wait4(pid_t pid, int *status, int opts, struct rusage *rusage)
+{
+	return (__syscall_wait4(pid, status, opts, rusage));
+}
+libc_hidden_def(wait4)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/waitid.c b/ap/build/uClibc/libc/sysdeps/linux/common/waitid.c
new file mode 100644
index 0000000..c8115f9
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/waitid.c
@@ -0,0 +1,81 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Copyright (C) 2007 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <features.h>
+
+#if defined __USE_SVID || defined __USE_XOPEN
+# include <string.h>
+# include <sys/types.h>
+# include <sys/wait.h>
+# include <sys/syscall.h>
+
+# ifdef __NR_waitid
+
+#  ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#  include <sysdep-cancel.h>
+#  else
+#  define SINGLE_THREAD_P 1
+#  endif
+
+/* The waitid() POSIX interface takes 4 arguments, but the kernel function
+ * actually takes 5.  The fifth is a pointer to struct rusage.  Make sure
+ * we pass NULL rather than letting whatever was in the register bleed up.
+ */
+#define __NR_waitid5 __NR_waitid
+static __always_inline
+_syscall5(int, waitid5, idtype_t, idtype, id_t, id, siginfo_t*, infop,
+                 int, options, struct rusage*, ru)
+# endif
+
+int waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options)
+{
+# ifdef __NR_waitid
+ if (SINGLE_THREAD_P)
+		return waitid5(idtype, id, infop, options, NULL);
+
+#  ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype = LIBC_CANCEL_ASYNC ();
+	int result = waitid5(idtype, id, infop, options, NULL);
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+#  endif
+
+# elif defined __NR_waitpid
+	switch (idtype) {
+		case P_PID:
+			if (id <= 0)
+				goto invalid;
+			break;
+		case P_PGID:
+			if (id < 0 || id == 1)
+				goto invalid;
+			id = -id;
+			break;
+		case P_ALL:
+			id = -1;
+			break;
+		default:
+		invalid:
+			__set_errno(EINVAL);
+			return -1;
+	}
+
+	memset(infop, 0, sizeof *infop);
+	infop->si_pid = waitpid(id, &infop->si_status, options
+#  ifdef WEXITED
+					   &~ WEXITED
+#  endif
+					  );
+	if (infop->si_pid < 0)
+		return infop->si_pid;
+	return 0;
+# else
+ __set_errno(ENOSYS);
+ return -1;
+# endif
+}
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/waitpid.c b/ap/build/uClibc/libc/sysdeps/linux/common/waitpid.c
new file mode 100644
index 0000000..d043719
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/waitpid.c
@@ -0,0 +1,37 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Copyright (C) 2006 Steven J. Hill <sjhill@realitydiluted.com>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/resource.h>
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include "sysdep-cancel.h"
+#else
+#define SINGLE_THREAD_P 1
+#endif
+
+libc_hidden_proto(wait4)
+
+extern __typeof(waitpid) __libc_waitpid;
+__pid_t __libc_waitpid(__pid_t pid, int *wait_stat, int options)
+{
+	if (SINGLE_THREAD_P)
+		return wait4(pid, wait_stat, options, NULL);
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+	int oldtype = LIBC_CANCEL_ASYNC ();
+	int result = wait4(pid, wait_stat, options, NULL);
+	LIBC_CANCEL_RESET (oldtype);
+	return result;
+#endif
+}
+libc_hidden_proto(waitpid)
+weak_alias(__libc_waitpid,waitpid)
+libc_hidden_weak(waitpid)
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/write.c b/ap/build/uClibc/libc/sysdeps/linux/common/write.c
new file mode 100644
index 0000000..5a6f722
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/write.c
@@ -0,0 +1,25 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * write() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+_syscall3(ssize_t, write, int, fd, const __ptr_t, buf, size_t, count)
+#ifndef __LINUXTHREADS_OLD__
+libc_hidden_def(write)
+#else
+libc_hidden_weak(write)
+strong_alias(write,__libc_write)
+#endif
+
+#if 0
+/* Stupid libgcc.a from gcc 2.95.x uses __write in pure.o
+ * which is a blatant GNU libc-ism... */
+strong_alias(write,__write)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/writev.c b/ap/build/uClibc/libc/sysdeps/linux/common/writev.c
new file mode 100644
index 0000000..bd0e407
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/writev.c
@@ -0,0 +1,50 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * writev() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/uio.h>
+
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <errno.h>
+#include <sysdep-cancel.h>
+
+/* We should deal with kernel which have a smaller UIO_FASTIOV as well
+   as a very big count.  */
+static ssize_t __writev (int fd, const struct iovec *vector, int count)
+{
+  ssize_t bytes_written;
+
+  bytes_written = INLINE_SYSCALL (writev, 3, fd, vector, count);
+
+  if (bytes_written >= 0 || errno != EINVAL || count <= UIO_FASTIOV)
+    return bytes_written;
+
+  /* glibc tries again, but we do not. */
+  /* return __atomic_writev_replacement (fd, vector, count); */
+
+  return -1;
+}
+
+ssize_t writev (int fd, const struct iovec *vector, int count)
+{
+  if (SINGLE_THREAD_P)
+    return __writev (fd, vector, count);
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  ssize_t result = __writev (fd, vector, count);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
+}
+#else
+_syscall3(ssize_t, writev, int, filedes, const struct iovec *, vector,
+		  int, count)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/xattr.c b/ap/build/uClibc/libc/sysdeps/linux/common/xattr.c
new file mode 100644
index 0000000..dea471a
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/xattr.c
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2004 <solar@gentoo.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+/* This file provides the following Extended Attribute system calls to uClibc.
+ *
+ *	setxattr(), lsetxattr(), fsetxattr(),
+ *	getxattr(), lgetxattr(), fgetxattr(),
+ *	listxattr(), llistxattr(), flistxattr(),
+ *	removexattr(), lremovexattr(), fremovexattr()
+ *
+ * Dec 2004 - <solar@gentoo.org>
+ */
+
+/* Taken from the manpage.
+ * On success, a positive number is returned indicating the size of the
+ * extended attribute name list. On failure, -1 is returned and errno
+ * is set appropriately. If extended attributes are not supported by the
+ * filesystem, or are disabled, errno is set to ENOSYS.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <sys/xattr.h>
+
+/* sets */
+#ifdef __NR_setxattr
+_syscall5(int, setxattr, const char *, path, const char *, name,
+	const void *, value, size_t, size, int, flags)
+#endif
+
+#ifdef __NR_lsetxattr
+_syscall5(int, lsetxattr, const char *, path, const char *, name,
+	const void *, value, size_t, size, int, flags)
+#endif
+
+#ifdef __NR_fsetxattr
+_syscall5(int, fsetxattr, int, filedes, const char *, name, const void *,
+	value, size_t, size, int, flags)
+#endif
+
+/* gets */
+#ifdef __NR_getxattr
+_syscall4(ssize_t, getxattr, const char *, path, const char *, name,
+	void *, value, size_t, size)
+#endif
+
+#ifdef __NR_lgetxattr
+_syscall4(ssize_t, lgetxattr, const char *, path, const char *, name,
+	void *, value, size_t, size)
+#endif
+
+#ifdef __NR_fgetxattr
+_syscall4(ssize_t, fgetxattr, int, filedes, const char *, name, void *,
+	value, size_t, size)
+#endif
+
+/* list */
+#ifdef __NR_listxattr
+_syscall3(ssize_t, listxattr, const char *, path, char *, list, size_t,
+	size)
+#endif
+
+#ifdef __NR_llistxattr
+_syscall3(ssize_t, llistxattr, const char *, path, char *, list, size_t,
+	size)
+#endif
+
+#ifdef __NR_flistxattr
+_syscall3(ssize_t, flistxattr, int, filedes, char *, list, size_t, size)
+#endif
+
+/* remove */
+#ifdef __NR_removexattr
+_syscall2(int, removexattr, const char *, path, const char *, name)
+#endif
+
+#ifdef __NR_lremovexattr
+_syscall2(int, lremovexattr, const char *, path, const char *, name)
+#endif
+
+#ifdef __NR_fremovexattr
+_syscall2(int, fremovexattr, int, filedes, const char *, name)
+#endif
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/xstatconv.c b/ap/build/uClibc/libc/sysdeps/linux/common/xstatconv.c
new file mode 100644
index 0000000..deef392
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/xstatconv.c
@@ -0,0 +1,90 @@
+/* Convert between the kernel's `struct stat' format, and libc's.
+   Copyright (C) 1991,1995,1996,1997,2000,2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.
+
+   Modified for uClibc by Erik Andersen <andersen@codepoet.org>
+   */
+
+#include <sys/syscall.h>
+#include <sys/stat.h>
+#include <string.h>
+#include "xstatconv.h"
+
+void __xstat_conv(struct kernel_stat *kbuf, struct stat *buf)
+{
+	/* Convert to current kernel version of `struct stat'. */
+	memset(buf, 0x00, sizeof(*buf));
+	buf->st_dev = kbuf->st_dev;
+	buf->st_ino = kbuf->st_ino;
+	buf->st_mode = kbuf->st_mode;
+	buf->st_nlink = kbuf->st_nlink;
+	buf->st_uid = kbuf->st_uid;
+	buf->st_gid = kbuf->st_gid;
+	buf->st_rdev = kbuf->st_rdev;
+	buf->st_size = kbuf->st_size;
+	buf->st_blksize = kbuf->st_blksize;
+	buf->st_blocks = kbuf->st_blocks;
+	buf->st_atim = kbuf->st_atim;
+	buf->st_mtim = kbuf->st_mtim;
+	buf->st_ctim = kbuf->st_ctim;
+}
+
+void __xstat32_conv(struct kernel_stat64 *kbuf, struct stat *buf)
+{
+	/* Convert to current kernel version of `struct stat64'. */
+	memset(buf, 0x00, sizeof(*buf));
+	buf->st_dev = kbuf->st_dev;
+	buf->st_ino = kbuf->st_ino;
+	buf->st_mode = kbuf->st_mode;
+	buf->st_nlink = kbuf->st_nlink;
+	buf->st_uid = kbuf->st_uid;
+	buf->st_gid = kbuf->st_gid;
+	buf->st_rdev = kbuf->st_rdev;
+	buf->st_size = kbuf->st_size;
+	buf->st_blksize = kbuf->st_blksize;
+	buf->st_blocks = kbuf->st_blocks;
+	buf->st_atim = kbuf->st_atim;
+	buf->st_mtim = kbuf->st_mtim;
+	buf->st_ctim = kbuf->st_ctim;
+}
+
+#ifdef __UCLIBC_HAS_LFS__
+
+void __xstat64_conv(struct kernel_stat64 *kbuf, struct stat64 *buf)
+{
+	/* Convert to current kernel version of `struct stat64'. */
+	memset(buf, 0x00, sizeof(*buf));
+	buf->st_dev = kbuf->st_dev;
+	buf->st_ino = kbuf->st_ino;
+# ifdef _HAVE_STAT64___ST_INO
+	buf->__st_ino = kbuf->__st_ino;
+# endif
+	buf->st_mode = kbuf->st_mode;
+	buf->st_nlink = kbuf->st_nlink;
+	buf->st_uid = kbuf->st_uid;
+	buf->st_gid = kbuf->st_gid;
+	buf->st_rdev = kbuf->st_rdev;
+	buf->st_size = kbuf->st_size;
+	buf->st_blksize = kbuf->st_blksize;
+	buf->st_blocks = kbuf->st_blocks;
+	buf->st_atim = kbuf->st_atim;
+	buf->st_mtim = kbuf->st_mtim;
+	buf->st_ctim = kbuf->st_ctim;
+}
+
+#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/ap/build/uClibc/libc/sysdeps/linux/common/xstatconv.h b/ap/build/uClibc/libc/sysdeps/linux/common/xstatconv.h
new file mode 100644
index 0000000..7568da8
--- /dev/null
+++ b/ap/build/uClibc/libc/sysdeps/linux/common/xstatconv.h
@@ -0,0 +1,33 @@
+/* Convert between the kernel's `struct stat' format, and libc's.
+   Copyright (C) 1991,1995,1996,1997,2000,2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.
+
+   Modified for uClibc by Erik Andersen <andersen@codepoet.org>
+   */
+
+/* Pull in whatever this particular arch's kernel thinks the kernel version of
+ * struct stat should look like.  It turns out that each arch has a different
+ * opinion on the subject, and different kernel revs use different names... */
+#include <bits/kernel_stat.h>
+
+extern void __xstat_conv(struct kernel_stat *kbuf, struct stat *buf) attribute_hidden;
+extern void __xstat32_conv(struct kernel_stat64 *kbuf, struct stat *buf) attribute_hidden;
+#if defined __UCLIBC_HAS_LFS__
+extern void __xstat64_conv(struct kernel_stat64 *kbuf, struct stat64 *buf) attribute_hidden;
+#endif
+