* [gentoo-commits] proj/releng:master commit in: tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/, ...
@ 2013-05-10 11:00 Anthony G. Basile
0 siblings, 0 replies; 7+ messages in thread
From: Anthony G. Basile @ 2013-05-10 11:00 UTC (permalink / raw
To: gentoo-commits
commit: 9c010de2a858069df747a23f465459d488c9b4d4
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Fri May 10 11:00:19 2013 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Fri May 10 11:00:19 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/releng.git;a=commit;h=9c010de2
tools-uclibc: use uclibc's epatch_user to backport important patches
---
.../patches/sys-libs/uclibc/00_fix-eventfd.patch | 59 ++++
.../sys-libs/uclibc/01_add-posix_fallocate.patch | 321 ++++++++++++++++++++
.../patches/sys-libs/uclibc/00_fix-eventfd.patch | 59 ++++
.../sys-libs/uclibc/01_add-posix_fallocate.patch | 321 ++++++++++++++++++++
.../patches/sys-libs/uclibc/00_fix-eventfd.patch | 59 ++++
.../sys-libs/uclibc/01_add-posix_fallocate.patch | 321 ++++++++++++++++++++
.../patches/sys-libs/uclibc/00_fix-eventfd.patch | 59 ++++
.../sys-libs/uclibc/01_add-posix_fallocate.patch | 321 ++++++++++++++++++++
8 files changed, 1520 insertions(+), 0 deletions(-)
diff --git a/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/00_fix-eventfd.patch b/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/00_fix-eventfd.patch
new file mode 100644
index 0000000..cfc64de
--- /dev/null
+++ b/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/00_fix-eventfd.patch
@@ -0,0 +1,59 @@
+From e118373cbb58ba5ffa5fb6670957678d5b87cdb9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 10 Jun 2012 16:36:23 +0000
+Subject: eventfd: Implement eventfd2 and fix eventfd
+
+eventfd: evntfd assumes to take two arguments instead it
+should be one evntfd expects two therefore implement both syscalls with
+correct parameters
+
+Thanks Eugene Rudoy for reporting it and also providing the patch
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+diff --git a/libc/sysdeps/linux/common/eventfd.c b/libc/sysdeps/linux/common/eventfd.c
+index cc3f3f0..96597ab 100644
+--- a/libc/sysdeps/linux/common/eventfd.c
++++ b/libc/sysdeps/linux/common/eventfd.c
+@@ -7,12 +7,24 @@
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
++#include <errno.h>
+ #include <sys/syscall.h>
+ #include <sys/eventfd.h>
+
+ /*
+ * eventfd()
+ */
+-#ifdef __NR_eventfd
+-_syscall2(int, eventfd, int, count, int, flags)
++#if defined __NR_eventfd || defined __NR_eventfd2
++int eventfd (int count, int flags)
++{
++#if defined __NR_eventfd2
++ return INLINE_SYSCALL (eventfd2, 2, count, flags);
++#elif defined __NR_eventfd
++ if (flags != 0) {
++ __set_errno (EINVAL);
++ return -1;
++ }
++ return INLINE_SYSCALL (eventfd, 1, count);
++#endif
++}
+ #endif
+diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c
+index 3567b07..1fc2393 100644
+--- a/libc/sysdeps/linux/common/stubs.c
++++ b/libc/sysdeps/linux/common/stubs.c
+@@ -110,7 +110,7 @@ make_stub(epoll_pwait)
+ make_stub(epoll_wait)
+ #endif
+
+-#if !defined __NR_eventfd && defined __UCLIBC_LINUX_SPECIFIC__
++#if !defined __NR_eventfd && !defined __NR_eventfd2 && defined __UCLIBC_LINUX_SPECIFIC__
+ make_stub(eventfd)
+ #endif
+
+--
+cgit v0.9.1
diff --git a/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/01_add-posix_fallocate.patch b/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/01_add-posix_fallocate.patch
new file mode 100644
index 0000000..dc7bbd7
--- /dev/null
+++ b/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/01_add-posix_fallocate.patch
@@ -0,0 +1,321 @@
+From 5643900913f64c00f1c2958914586708efa5a473 Mon Sep 17 00:00:00 2001
+From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+Date: Tue, 17 Apr 2012 07:30:15 +0000
+Subject: libc: add posix_fallocate()
+
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+diff --git a/include/fcntl.h b/include/fcntl.h
+index ed009dd..c749ad5 100644
+--- a/include/fcntl.h
++++ b/include/fcntl.h
+@@ -217,9 +217,7 @@ extern int posix_fadvise64 (int __fd, __off64_t __offset, __off64_t __len,
+
+ #endif
+
+-#if 0 /* && defined __UCLIBC_HAS_ADVANCED_REALTIME__ */
+-
+-/* FIXME -- uClibc should probably implement these... */
++#if defined __UCLIBC_HAS_ADVANCED_REALTIME__
+
+ /* Reserve storage for the data of the file associated with FD.
+
+diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
+index 566722d..29566dd 100644
+--- a/libc/sysdeps/linux/common/Makefile.in
++++ b/libc/sysdeps/linux/common/Makefile.in
+@@ -82,7 +82,8 @@ CSRC-$(UCLIBC_HAS_REALTIME) += clock_getres.c clock_gettime.c clock_settime.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 posix_madvise.c
++CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c posix_madvise.c \
++ posix_fallocate.c posix_fallocate64.c
+ CSRC-$(UCLIBC_SUSV4_LEGACY) += utime.c
+ CSRC-$(UCLIBC_HAS_EPOLL) += epoll.c
+ CSRC-$(UCLIBC_HAS_XATTR) += xattr.c
+diff --git a/libc/sysdeps/linux/common/bits/kernel-features.h b/libc/sysdeps/linux/common/bits/kernel-features.h
+index 4d1e0cb..6184c2b 100644
+--- a/libc/sysdeps/linux/common/bits/kernel-features.h
++++ b/libc/sysdeps/linux/common/bits/kernel-features.h
+@@ -495,6 +495,14 @@
+ # define __ASSUME_PRIVATE_FUTEX 1
+ #endif
+
++/* Support for fallocate was added in 2.6.23,
++ on s390 only after 2.6.23-rc1, on alpha only after 2.6.33-rc1. */
++#if __LINUX_KERNEL_VERSION >= 0x020617 \
++ && (!defined __s390__ || __LINUX_KERNEL_VERSION >= 0x020618) \
++ && (!defined __alpha__ || __LINUX_KERNEL_VERSION >= 0x020621)
++# define __ASSUME_FALLOCATE 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
+diff --git a/libc/sysdeps/linux/common/posix_fallocate.c b/libc/sysdeps/linux/common/posix_fallocate.c
+new file mode 100644
+index 0000000..9aaa6ce
+--- /dev/null
++++ b/libc/sysdeps/linux/common/posix_fallocate.c
+@@ -0,0 +1,43 @@
++/* vi: set sw=4 ts=4: */
++/*
++ * posix_fallocate() for uClibc
++ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html
++ *
++ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
++ *
++ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
++ */
++
++#include <sys/syscall.h>
++#include <fcntl.h>
++#include <bits/kernel-features.h>
++#include <stdint.h>
++
++#if defined __NR_fallocate
++int posix_fallocate(int fd, __off_t offset, __off_t len)
++{
++ int ret;
++
++# if __WORDSIZE == 32
++ uint32_t off_low = offset;
++ uint32_t len_low = len;
++ /* may assert that these >>31 are 0 */
++ uint32_t zero = 0;
++ INTERNAL_SYSCALL_DECL(err);
++ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
++ __LONG_LONG_PAIR (zero, off_low),
++ __LONG_LONG_PAIR (zero, len_low)));
++# elif __WORDSIZE == 64
++ INTERNAL_SYSCALL_DECL(err);
++ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 4, fd, 0, offset, len));
++# else
++# error your machine is neither 32 bit or 64 bit ... it must be magical
++#endif
++ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
++ return INTERNAL_SYSCALL_ERRNO (ret, err);
++ return 0;
++}
++# if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64
++strong_alias(posix_fallocate,posix_fallocate64)
++# endif
++#endif
+diff --git a/libc/sysdeps/linux/common/posix_fallocate64.c b/libc/sysdeps/linux/common/posix_fallocate64.c
+new file mode 100644
+index 0000000..818d868
+--- /dev/null
++++ b/libc/sysdeps/linux/common/posix_fallocate64.c
+@@ -0,0 +1,39 @@
++/* vi: set sw=4 ts=4: */
++/*
++ * posix_fallocate() for uClibc
++ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html
++ *
++ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
++ *
++ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
++ */
++
++#include <sys/syscall.h>
++#include <fcntl.h>
++#include <bits/kernel-features.h>
++#include <stdint.h>
++
++#if defined __NR_fallocate
++
++# if __WORDSIZE == 64
++/* Can use normal posix_fallocate() */
++# elif __WORDSIZE == 32
++int posix_fallocate64(int fd, __off64_t offset, __off64_t len)
++{
++ int ret;
++ uint32_t off_low = offset & 0xffffffff;
++ uint32_t off_high = offset >> 32;
++ uint32_t len_low = len & 0xffffffff;
++ uint32_t len_high = len >> 32;
++ INTERNAL_SYSCALL_DECL(err);
++ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
++ __LONG_LONG_PAIR (off_high, off_low),
++ __LONG_LONG_PAIR (len_high, len_low)));
++ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
++ return INTERNAL_SYSCALL_ERRNO (ret, err);
++ return 0;
++}
++# else
++# error your machine is neither 32 bit or 64 bit ... it must be magical
++# endif
++#endif
+diff --git a/test/.gitignore b/test/.gitignore
+index c068f89..ec04628 100644
+--- a/test/.gitignore
++++ b/test/.gitignore
+@@ -319,6 +319,8 @@ unistd/getcwd
+ unistd/getopt
+ unistd/getopt_long
+ unistd/tstgetopt
++unistd/tst-posix_fallocate
++unistd/tst-posix_fallocate64
+ unistd/tst-preadwrite
+ unistd/tst-preadwrite64
+ unistd/vfork
+diff --git a/test/unistd/Makefile.in b/test/unistd/Makefile.in
+index c542f98..24b9a37 100644
+--- a/test/unistd/Makefile.in
++++ b/test/unistd/Makefile.in
+@@ -2,7 +2,10 @@
+ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+ ifeq ($(UCLIBC_HAS_LFS),)
+-TESTS_DISABLED := tst-preadwrite64
++TESTS_DISABLED := tst-preadwrite64 tst-posix_fallocate64
++endif
++ifeq ($(UCLIBC_HAS_ADVANCED_REALTIME),)
++TESTS_DISABLED := tst-posix_fallocate
+ endif
+ OPTS_getopt := -abcXXX -9
+ OPTS_getopt_long := --add XXX --delete YYY --verbose
+diff --git a/test/unistd/tst-posix_fallocate.c b/test/unistd/tst-posix_fallocate.c
+new file mode 100644
+index 0000000..d41c604
+--- /dev/null
++++ b/test/unistd/tst-posix_fallocate.c
+@@ -0,0 +1,127 @@
++#include <fcntl.h>
++#include <sys/stat.h>
++
++#ifndef TST_POSIX_FALLOCATE64
++# define stat64 stat
++# define fstat64 fstat
++# else
++# ifndef O_LARGEFILE
++# error no O_LARGEFILE but you want to test with LFS enabled
++# endif
++#endif
++
++static void do_prepare (void);
++#define PREPARE(argc, argv) do_prepare ()
++static int do_test (void);
++#define TEST_FUNCTION do_test ()
++#include <test-skeleton.c>
++
++static int fd;
++static void
++do_prepare (void)
++{
++ fd = create_temp_file ("tst-posix_fallocate.", NULL);
++ if (fd == -1)
++ {
++ printf ("cannot create temporary file: %m\n");
++ exit (1);
++ }
++}
++
++
++static int
++do_test (void)
++{
++ struct stat64 st;
++
++ if (fstat64 (fd, &st) != 0)
++ {
++ puts ("1st fstat failed");
++ return 1;
++ }
++
++ if (st.st_size != 0)
++ {
++ puts ("file not created with size 0");
++ return 1;
++ }
++
++ if (posix_fallocate (fd, 512, 768) != 0)
++ {
++ puts ("1st posix_fallocate call failed");
++ return 1;
++ }
++
++ if (fstat64 (fd, &st) != 0)
++ {
++ puts ("2nd fstat failed");
++ return 1;
++ }
++
++ if (st.st_size != 512 + 768)
++ {
++ printf ("file size after 1st posix_fallocate call is %llu, expected %u\n",
++ (unsigned long long int) st.st_size, 512u + 768u);
++ return 1;
++ }
++
++ if (posix_fallocate (fd, 0, 1024) != 0)
++ {
++ puts ("2nd posix_fallocate call failed");
++ return 1;
++ }
++
++ if (fstat64 (fd, &st) != 0)
++ {
++ puts ("3rd fstat failed");
++ return 1;
++ }
++
++ if (st.st_size != 512 + 768)
++ {
++ puts ("file size changed in 2nd posix_fallocate");
++ return 1;
++ }
++
++ if (posix_fallocate (fd, 2048, 64) != 0)
++ {
++ puts ("3rd posix_fallocate call failed");
++ return 1;
++ }
++
++ if (fstat64 (fd, &st) != 0)
++ {
++ puts ("4th fstat failed");
++ return 1;
++ }
++
++ if (st.st_size != 2048 + 64)
++ {
++ printf ("file size after 3rd posix_fallocate call is %llu, expected %u\n",
++ (unsigned long long int) st.st_size, 2048u + 64u);
++ return 1;
++ }
++#ifdef TST_POSIX_FALLOCATE64
++ if (posix_fallocate64 (fd, 4097ULL, 4294967295ULL + 2ULL) != 0)
++ {
++ puts ("4th posix_fallocate call failed");
++ return 1;
++ }
++
++ if (fstat64 (fd, &st) != 0)
++ {
++ puts ("5th fstat failed");
++ return 1;
++ }
++
++ if (st.st_size != 4097ULL + 4294967295ULL + 2ULL)
++ {
++ printf ("file size after 4th posix_fallocate call is %llu, expected %llu\n",
++ (unsigned long long int) st.st_size, 4097ULL + 4294967295ULL + 2ULL);
++ return 1;
++ }
++#endif
++ close (fd);
++
++ return 0;
++}
+diff --git a/test/unistd/tst-posix_fallocate64.c b/test/unistd/tst-posix_fallocate64.c
+new file mode 100644
+index 0000000..b1ee0ff
+--- /dev/null
++++ b/test/unistd/tst-posix_fallocate64.c
+@@ -0,0 +1,2 @@
++#define TST_POSIX_FALLOCATE64
++#include "tst-posix_fallocate.c"
+--
+cgit v0.9.1
diff --git a/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/00_fix-eventfd.patch b/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/00_fix-eventfd.patch
new file mode 100644
index 0000000..cfc64de
--- /dev/null
+++ b/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/00_fix-eventfd.patch
@@ -0,0 +1,59 @@
+From e118373cbb58ba5ffa5fb6670957678d5b87cdb9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 10 Jun 2012 16:36:23 +0000
+Subject: eventfd: Implement eventfd2 and fix eventfd
+
+eventfd: evntfd assumes to take two arguments instead it
+should be one evntfd expects two therefore implement both syscalls with
+correct parameters
+
+Thanks Eugene Rudoy for reporting it and also providing the patch
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+diff --git a/libc/sysdeps/linux/common/eventfd.c b/libc/sysdeps/linux/common/eventfd.c
+index cc3f3f0..96597ab 100644
+--- a/libc/sysdeps/linux/common/eventfd.c
++++ b/libc/sysdeps/linux/common/eventfd.c
+@@ -7,12 +7,24 @@
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
++#include <errno.h>
+ #include <sys/syscall.h>
+ #include <sys/eventfd.h>
+
+ /*
+ * eventfd()
+ */
+-#ifdef __NR_eventfd
+-_syscall2(int, eventfd, int, count, int, flags)
++#if defined __NR_eventfd || defined __NR_eventfd2
++int eventfd (int count, int flags)
++{
++#if defined __NR_eventfd2
++ return INLINE_SYSCALL (eventfd2, 2, count, flags);
++#elif defined __NR_eventfd
++ if (flags != 0) {
++ __set_errno (EINVAL);
++ return -1;
++ }
++ return INLINE_SYSCALL (eventfd, 1, count);
++#endif
++}
+ #endif
+diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c
+index 3567b07..1fc2393 100644
+--- a/libc/sysdeps/linux/common/stubs.c
++++ b/libc/sysdeps/linux/common/stubs.c
+@@ -110,7 +110,7 @@ make_stub(epoll_pwait)
+ make_stub(epoll_wait)
+ #endif
+
+-#if !defined __NR_eventfd && defined __UCLIBC_LINUX_SPECIFIC__
++#if !defined __NR_eventfd && !defined __NR_eventfd2 && defined __UCLIBC_LINUX_SPECIFIC__
+ make_stub(eventfd)
+ #endif
+
+--
+cgit v0.9.1
diff --git a/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/01_add-posix_fallocate.patch b/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/01_add-posix_fallocate.patch
new file mode 100644
index 0000000..dc7bbd7
--- /dev/null
+++ b/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/01_add-posix_fallocate.patch
@@ -0,0 +1,321 @@
+From 5643900913f64c00f1c2958914586708efa5a473 Mon Sep 17 00:00:00 2001
+From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+Date: Tue, 17 Apr 2012 07:30:15 +0000
+Subject: libc: add posix_fallocate()
+
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+diff --git a/include/fcntl.h b/include/fcntl.h
+index ed009dd..c749ad5 100644
+--- a/include/fcntl.h
++++ b/include/fcntl.h
+@@ -217,9 +217,7 @@ extern int posix_fadvise64 (int __fd, __off64_t __offset, __off64_t __len,
+
+ #endif
+
+-#if 0 /* && defined __UCLIBC_HAS_ADVANCED_REALTIME__ */
+-
+-/* FIXME -- uClibc should probably implement these... */
++#if defined __UCLIBC_HAS_ADVANCED_REALTIME__
+
+ /* Reserve storage for the data of the file associated with FD.
+
+diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
+index 566722d..29566dd 100644
+--- a/libc/sysdeps/linux/common/Makefile.in
++++ b/libc/sysdeps/linux/common/Makefile.in
+@@ -82,7 +82,8 @@ CSRC-$(UCLIBC_HAS_REALTIME) += clock_getres.c clock_gettime.c clock_settime.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 posix_madvise.c
++CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c posix_madvise.c \
++ posix_fallocate.c posix_fallocate64.c
+ CSRC-$(UCLIBC_SUSV4_LEGACY) += utime.c
+ CSRC-$(UCLIBC_HAS_EPOLL) += epoll.c
+ CSRC-$(UCLIBC_HAS_XATTR) += xattr.c
+diff --git a/libc/sysdeps/linux/common/bits/kernel-features.h b/libc/sysdeps/linux/common/bits/kernel-features.h
+index 4d1e0cb..6184c2b 100644
+--- a/libc/sysdeps/linux/common/bits/kernel-features.h
++++ b/libc/sysdeps/linux/common/bits/kernel-features.h
+@@ -495,6 +495,14 @@
+ # define __ASSUME_PRIVATE_FUTEX 1
+ #endif
+
++/* Support for fallocate was added in 2.6.23,
++ on s390 only after 2.6.23-rc1, on alpha only after 2.6.33-rc1. */
++#if __LINUX_KERNEL_VERSION >= 0x020617 \
++ && (!defined __s390__ || __LINUX_KERNEL_VERSION >= 0x020618) \
++ && (!defined __alpha__ || __LINUX_KERNEL_VERSION >= 0x020621)
++# define __ASSUME_FALLOCATE 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
+diff --git a/libc/sysdeps/linux/common/posix_fallocate.c b/libc/sysdeps/linux/common/posix_fallocate.c
+new file mode 100644
+index 0000000..9aaa6ce
+--- /dev/null
++++ b/libc/sysdeps/linux/common/posix_fallocate.c
+@@ -0,0 +1,43 @@
++/* vi: set sw=4 ts=4: */
++/*
++ * posix_fallocate() for uClibc
++ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html
++ *
++ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
++ *
++ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
++ */
++
++#include <sys/syscall.h>
++#include <fcntl.h>
++#include <bits/kernel-features.h>
++#include <stdint.h>
++
++#if defined __NR_fallocate
++int posix_fallocate(int fd, __off_t offset, __off_t len)
++{
++ int ret;
++
++# if __WORDSIZE == 32
++ uint32_t off_low = offset;
++ uint32_t len_low = len;
++ /* may assert that these >>31 are 0 */
++ uint32_t zero = 0;
++ INTERNAL_SYSCALL_DECL(err);
++ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
++ __LONG_LONG_PAIR (zero, off_low),
++ __LONG_LONG_PAIR (zero, len_low)));
++# elif __WORDSIZE == 64
++ INTERNAL_SYSCALL_DECL(err);
++ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 4, fd, 0, offset, len));
++# else
++# error your machine is neither 32 bit or 64 bit ... it must be magical
++#endif
++ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
++ return INTERNAL_SYSCALL_ERRNO (ret, err);
++ return 0;
++}
++# if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64
++strong_alias(posix_fallocate,posix_fallocate64)
++# endif
++#endif
+diff --git a/libc/sysdeps/linux/common/posix_fallocate64.c b/libc/sysdeps/linux/common/posix_fallocate64.c
+new file mode 100644
+index 0000000..818d868
+--- /dev/null
++++ b/libc/sysdeps/linux/common/posix_fallocate64.c
+@@ -0,0 +1,39 @@
++/* vi: set sw=4 ts=4: */
++/*
++ * posix_fallocate() for uClibc
++ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html
++ *
++ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
++ *
++ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
++ */
++
++#include <sys/syscall.h>
++#include <fcntl.h>
++#include <bits/kernel-features.h>
++#include <stdint.h>
++
++#if defined __NR_fallocate
++
++# if __WORDSIZE == 64
++/* Can use normal posix_fallocate() */
++# elif __WORDSIZE == 32
++int posix_fallocate64(int fd, __off64_t offset, __off64_t len)
++{
++ int ret;
++ uint32_t off_low = offset & 0xffffffff;
++ uint32_t off_high = offset >> 32;
++ uint32_t len_low = len & 0xffffffff;
++ uint32_t len_high = len >> 32;
++ INTERNAL_SYSCALL_DECL(err);
++ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
++ __LONG_LONG_PAIR (off_high, off_low),
++ __LONG_LONG_PAIR (len_high, len_low)));
++ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
++ return INTERNAL_SYSCALL_ERRNO (ret, err);
++ return 0;
++}
++# else
++# error your machine is neither 32 bit or 64 bit ... it must be magical
++# endif
++#endif
+diff --git a/test/.gitignore b/test/.gitignore
+index c068f89..ec04628 100644
+--- a/test/.gitignore
++++ b/test/.gitignore
+@@ -319,6 +319,8 @@ unistd/getcwd
+ unistd/getopt
+ unistd/getopt_long
+ unistd/tstgetopt
++unistd/tst-posix_fallocate
++unistd/tst-posix_fallocate64
+ unistd/tst-preadwrite
+ unistd/tst-preadwrite64
+ unistd/vfork
+diff --git a/test/unistd/Makefile.in b/test/unistd/Makefile.in
+index c542f98..24b9a37 100644
+--- a/test/unistd/Makefile.in
++++ b/test/unistd/Makefile.in
+@@ -2,7 +2,10 @@
+ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+ ifeq ($(UCLIBC_HAS_LFS),)
+-TESTS_DISABLED := tst-preadwrite64
++TESTS_DISABLED := tst-preadwrite64 tst-posix_fallocate64
++endif
++ifeq ($(UCLIBC_HAS_ADVANCED_REALTIME),)
++TESTS_DISABLED := tst-posix_fallocate
+ endif
+ OPTS_getopt := -abcXXX -9
+ OPTS_getopt_long := --add XXX --delete YYY --verbose
+diff --git a/test/unistd/tst-posix_fallocate.c b/test/unistd/tst-posix_fallocate.c
+new file mode 100644
+index 0000000..d41c604
+--- /dev/null
++++ b/test/unistd/tst-posix_fallocate.c
+@@ -0,0 +1,127 @@
++#include <fcntl.h>
++#include <sys/stat.h>
++
++#ifndef TST_POSIX_FALLOCATE64
++# define stat64 stat
++# define fstat64 fstat
++# else
++# ifndef O_LARGEFILE
++# error no O_LARGEFILE but you want to test with LFS enabled
++# endif
++#endif
++
++static void do_prepare (void);
++#define PREPARE(argc, argv) do_prepare ()
++static int do_test (void);
++#define TEST_FUNCTION do_test ()
++#include <test-skeleton.c>
++
++static int fd;
++static void
++do_prepare (void)
++{
++ fd = create_temp_file ("tst-posix_fallocate.", NULL);
++ if (fd == -1)
++ {
++ printf ("cannot create temporary file: %m\n");
++ exit (1);
++ }
++}
++
++
++static int
++do_test (void)
++{
++ struct stat64 st;
++
++ if (fstat64 (fd, &st) != 0)
++ {
++ puts ("1st fstat failed");
++ return 1;
++ }
++
++ if (st.st_size != 0)
++ {
++ puts ("file not created with size 0");
++ return 1;
++ }
++
++ if (posix_fallocate (fd, 512, 768) != 0)
++ {
++ puts ("1st posix_fallocate call failed");
++ return 1;
++ }
++
++ if (fstat64 (fd, &st) != 0)
++ {
++ puts ("2nd fstat failed");
++ return 1;
++ }
++
++ if (st.st_size != 512 + 768)
++ {
++ printf ("file size after 1st posix_fallocate call is %llu, expected %u\n",
++ (unsigned long long int) st.st_size, 512u + 768u);
++ return 1;
++ }
++
++ if (posix_fallocate (fd, 0, 1024) != 0)
++ {
++ puts ("2nd posix_fallocate call failed");
++ return 1;
++ }
++
++ if (fstat64 (fd, &st) != 0)
++ {
++ puts ("3rd fstat failed");
++ return 1;
++ }
++
++ if (st.st_size != 512 + 768)
++ {
++ puts ("file size changed in 2nd posix_fallocate");
++ return 1;
++ }
++
++ if (posix_fallocate (fd, 2048, 64) != 0)
++ {
++ puts ("3rd posix_fallocate call failed");
++ return 1;
++ }
++
++ if (fstat64 (fd, &st) != 0)
++ {
++ puts ("4th fstat failed");
++ return 1;
++ }
++
++ if (st.st_size != 2048 + 64)
++ {
++ printf ("file size after 3rd posix_fallocate call is %llu, expected %u\n",
++ (unsigned long long int) st.st_size, 2048u + 64u);
++ return 1;
++ }
++#ifdef TST_POSIX_FALLOCATE64
++ if (posix_fallocate64 (fd, 4097ULL, 4294967295ULL + 2ULL) != 0)
++ {
++ puts ("4th posix_fallocate call failed");
++ return 1;
++ }
++
++ if (fstat64 (fd, &st) != 0)
++ {
++ puts ("5th fstat failed");
++ return 1;
++ }
++
++ if (st.st_size != 4097ULL + 4294967295ULL + 2ULL)
++ {
++ printf ("file size after 4th posix_fallocate call is %llu, expected %llu\n",
++ (unsigned long long int) st.st_size, 4097ULL + 4294967295ULL + 2ULL);
++ return 1;
++ }
++#endif
++ close (fd);
++
++ return 0;
++}
+diff --git a/test/unistd/tst-posix_fallocate64.c b/test/unistd/tst-posix_fallocate64.c
+new file mode 100644
+index 0000000..b1ee0ff
+--- /dev/null
++++ b/test/unistd/tst-posix_fallocate64.c
+@@ -0,0 +1,2 @@
++#define TST_POSIX_FALLOCATE64
++#include "tst-posix_fallocate.c"
+--
+cgit v0.9.1
diff --git a/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/00_fix-eventfd.patch b/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/00_fix-eventfd.patch
new file mode 100644
index 0000000..cfc64de
--- /dev/null
+++ b/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/00_fix-eventfd.patch
@@ -0,0 +1,59 @@
+From e118373cbb58ba5ffa5fb6670957678d5b87cdb9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 10 Jun 2012 16:36:23 +0000
+Subject: eventfd: Implement eventfd2 and fix eventfd
+
+eventfd: evntfd assumes to take two arguments instead it
+should be one evntfd expects two therefore implement both syscalls with
+correct parameters
+
+Thanks Eugene Rudoy for reporting it and also providing the patch
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+diff --git a/libc/sysdeps/linux/common/eventfd.c b/libc/sysdeps/linux/common/eventfd.c
+index cc3f3f0..96597ab 100644
+--- a/libc/sysdeps/linux/common/eventfd.c
++++ b/libc/sysdeps/linux/common/eventfd.c
+@@ -7,12 +7,24 @@
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
++#include <errno.h>
+ #include <sys/syscall.h>
+ #include <sys/eventfd.h>
+
+ /*
+ * eventfd()
+ */
+-#ifdef __NR_eventfd
+-_syscall2(int, eventfd, int, count, int, flags)
++#if defined __NR_eventfd || defined __NR_eventfd2
++int eventfd (int count, int flags)
++{
++#if defined __NR_eventfd2
++ return INLINE_SYSCALL (eventfd2, 2, count, flags);
++#elif defined __NR_eventfd
++ if (flags != 0) {
++ __set_errno (EINVAL);
++ return -1;
++ }
++ return INLINE_SYSCALL (eventfd, 1, count);
++#endif
++}
+ #endif
+diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c
+index 3567b07..1fc2393 100644
+--- a/libc/sysdeps/linux/common/stubs.c
++++ b/libc/sysdeps/linux/common/stubs.c
+@@ -110,7 +110,7 @@ make_stub(epoll_pwait)
+ make_stub(epoll_wait)
+ #endif
+
+-#if !defined __NR_eventfd && defined __UCLIBC_LINUX_SPECIFIC__
++#if !defined __NR_eventfd && !defined __NR_eventfd2 && defined __UCLIBC_LINUX_SPECIFIC__
+ make_stub(eventfd)
+ #endif
+
+--
+cgit v0.9.1
diff --git a/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/01_add-posix_fallocate.patch b/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/01_add-posix_fallocate.patch
new file mode 100644
index 0000000..dc7bbd7
--- /dev/null
+++ b/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/01_add-posix_fallocate.patch
@@ -0,0 +1,321 @@
+From 5643900913f64c00f1c2958914586708efa5a473 Mon Sep 17 00:00:00 2001
+From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+Date: Tue, 17 Apr 2012 07:30:15 +0000
+Subject: libc: add posix_fallocate()
+
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+diff --git a/include/fcntl.h b/include/fcntl.h
+index ed009dd..c749ad5 100644
+--- a/include/fcntl.h
++++ b/include/fcntl.h
+@@ -217,9 +217,7 @@ extern int posix_fadvise64 (int __fd, __off64_t __offset, __off64_t __len,
+
+ #endif
+
+-#if 0 /* && defined __UCLIBC_HAS_ADVANCED_REALTIME__ */
+-
+-/* FIXME -- uClibc should probably implement these... */
++#if defined __UCLIBC_HAS_ADVANCED_REALTIME__
+
+ /* Reserve storage for the data of the file associated with FD.
+
+diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
+index 566722d..29566dd 100644
+--- a/libc/sysdeps/linux/common/Makefile.in
++++ b/libc/sysdeps/linux/common/Makefile.in
+@@ -82,7 +82,8 @@ CSRC-$(UCLIBC_HAS_REALTIME) += clock_getres.c clock_gettime.c clock_settime.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 posix_madvise.c
++CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c posix_madvise.c \
++ posix_fallocate.c posix_fallocate64.c
+ CSRC-$(UCLIBC_SUSV4_LEGACY) += utime.c
+ CSRC-$(UCLIBC_HAS_EPOLL) += epoll.c
+ CSRC-$(UCLIBC_HAS_XATTR) += xattr.c
+diff --git a/libc/sysdeps/linux/common/bits/kernel-features.h b/libc/sysdeps/linux/common/bits/kernel-features.h
+index 4d1e0cb..6184c2b 100644
+--- a/libc/sysdeps/linux/common/bits/kernel-features.h
++++ b/libc/sysdeps/linux/common/bits/kernel-features.h
+@@ -495,6 +495,14 @@
+ # define __ASSUME_PRIVATE_FUTEX 1
+ #endif
+
++/* Support for fallocate was added in 2.6.23,
++ on s390 only after 2.6.23-rc1, on alpha only after 2.6.33-rc1. */
++#if __LINUX_KERNEL_VERSION >= 0x020617 \
++ && (!defined __s390__ || __LINUX_KERNEL_VERSION >= 0x020618) \
++ && (!defined __alpha__ || __LINUX_KERNEL_VERSION >= 0x020621)
++# define __ASSUME_FALLOCATE 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
+diff --git a/libc/sysdeps/linux/common/posix_fallocate.c b/libc/sysdeps/linux/common/posix_fallocate.c
+new file mode 100644
+index 0000000..9aaa6ce
+--- /dev/null
++++ b/libc/sysdeps/linux/common/posix_fallocate.c
+@@ -0,0 +1,43 @@
++/* vi: set sw=4 ts=4: */
++/*
++ * posix_fallocate() for uClibc
++ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html
++ *
++ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
++ *
++ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
++ */
++
++#include <sys/syscall.h>
++#include <fcntl.h>
++#include <bits/kernel-features.h>
++#include <stdint.h>
++
++#if defined __NR_fallocate
++int posix_fallocate(int fd, __off_t offset, __off_t len)
++{
++ int ret;
++
++# if __WORDSIZE == 32
++ uint32_t off_low = offset;
++ uint32_t len_low = len;
++ /* may assert that these >>31 are 0 */
++ uint32_t zero = 0;
++ INTERNAL_SYSCALL_DECL(err);
++ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
++ __LONG_LONG_PAIR (zero, off_low),
++ __LONG_LONG_PAIR (zero, len_low)));
++# elif __WORDSIZE == 64
++ INTERNAL_SYSCALL_DECL(err);
++ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 4, fd, 0, offset, len));
++# else
++# error your machine is neither 32 bit or 64 bit ... it must be magical
++#endif
++ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
++ return INTERNAL_SYSCALL_ERRNO (ret, err);
++ return 0;
++}
++# if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64
++strong_alias(posix_fallocate,posix_fallocate64)
++# endif
++#endif
+diff --git a/libc/sysdeps/linux/common/posix_fallocate64.c b/libc/sysdeps/linux/common/posix_fallocate64.c
+new file mode 100644
+index 0000000..818d868
+--- /dev/null
++++ b/libc/sysdeps/linux/common/posix_fallocate64.c
+@@ -0,0 +1,39 @@
++/* vi: set sw=4 ts=4: */
++/*
++ * posix_fallocate() for uClibc
++ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html
++ *
++ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
++ *
++ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
++ */
++
++#include <sys/syscall.h>
++#include <fcntl.h>
++#include <bits/kernel-features.h>
++#include <stdint.h>
++
++#if defined __NR_fallocate
++
++# if __WORDSIZE == 64
++/* Can use normal posix_fallocate() */
++# elif __WORDSIZE == 32
++int posix_fallocate64(int fd, __off64_t offset, __off64_t len)
++{
++ int ret;
++ uint32_t off_low = offset & 0xffffffff;
++ uint32_t off_high = offset >> 32;
++ uint32_t len_low = len & 0xffffffff;
++ uint32_t len_high = len >> 32;
++ INTERNAL_SYSCALL_DECL(err);
++ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
++ __LONG_LONG_PAIR (off_high, off_low),
++ __LONG_LONG_PAIR (len_high, len_low)));
++ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
++ return INTERNAL_SYSCALL_ERRNO (ret, err);
++ return 0;
++}
++# else
++# error your machine is neither 32 bit or 64 bit ... it must be magical
++# endif
++#endif
+diff --git a/test/.gitignore b/test/.gitignore
+index c068f89..ec04628 100644
+--- a/test/.gitignore
++++ b/test/.gitignore
+@@ -319,6 +319,8 @@ unistd/getcwd
+ unistd/getopt
+ unistd/getopt_long
+ unistd/tstgetopt
++unistd/tst-posix_fallocate
++unistd/tst-posix_fallocate64
+ unistd/tst-preadwrite
+ unistd/tst-preadwrite64
+ unistd/vfork
+diff --git a/test/unistd/Makefile.in b/test/unistd/Makefile.in
+index c542f98..24b9a37 100644
+--- a/test/unistd/Makefile.in
++++ b/test/unistd/Makefile.in
+@@ -2,7 +2,10 @@
+ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+ ifeq ($(UCLIBC_HAS_LFS),)
+-TESTS_DISABLED := tst-preadwrite64
++TESTS_DISABLED := tst-preadwrite64 tst-posix_fallocate64
++endif
++ifeq ($(UCLIBC_HAS_ADVANCED_REALTIME),)
++TESTS_DISABLED := tst-posix_fallocate
+ endif
+ OPTS_getopt := -abcXXX -9
+ OPTS_getopt_long := --add XXX --delete YYY --verbose
+diff --git a/test/unistd/tst-posix_fallocate.c b/test/unistd/tst-posix_fallocate.c
+new file mode 100644
+index 0000000..d41c604
+--- /dev/null
++++ b/test/unistd/tst-posix_fallocate.c
+@@ -0,0 +1,127 @@
++#include <fcntl.h>
++#include <sys/stat.h>
++
++#ifndef TST_POSIX_FALLOCATE64
++# define stat64 stat
++# define fstat64 fstat
++# else
++# ifndef O_LARGEFILE
++# error no O_LARGEFILE but you want to test with LFS enabled
++# endif
++#endif
++
++static void do_prepare (void);
++#define PREPARE(argc, argv) do_prepare ()
++static int do_test (void);
++#define TEST_FUNCTION do_test ()
++#include <test-skeleton.c>
++
++static int fd;
++static void
++do_prepare (void)
++{
++ fd = create_temp_file ("tst-posix_fallocate.", NULL);
++ if (fd == -1)
++ {
++ printf ("cannot create temporary file: %m\n");
++ exit (1);
++ }
++}
++
++
++static int
++do_test (void)
++{
++ struct stat64 st;
++
++ if (fstat64 (fd, &st) != 0)
++ {
++ puts ("1st fstat failed");
++ return 1;
++ }
++
++ if (st.st_size != 0)
++ {
++ puts ("file not created with size 0");
++ return 1;
++ }
++
++ if (posix_fallocate (fd, 512, 768) != 0)
++ {
++ puts ("1st posix_fallocate call failed");
++ return 1;
++ }
++
++ if (fstat64 (fd, &st) != 0)
++ {
++ puts ("2nd fstat failed");
++ return 1;
++ }
++
++ if (st.st_size != 512 + 768)
++ {
++ printf ("file size after 1st posix_fallocate call is %llu, expected %u\n",
++ (unsigned long long int) st.st_size, 512u + 768u);
++ return 1;
++ }
++
++ if (posix_fallocate (fd, 0, 1024) != 0)
++ {
++ puts ("2nd posix_fallocate call failed");
++ return 1;
++ }
++
++ if (fstat64 (fd, &st) != 0)
++ {
++ puts ("3rd fstat failed");
++ return 1;
++ }
++
++ if (st.st_size != 512 + 768)
++ {
++ puts ("file size changed in 2nd posix_fallocate");
++ return 1;
++ }
++
++ if (posix_fallocate (fd, 2048, 64) != 0)
++ {
++ puts ("3rd posix_fallocate call failed");
++ return 1;
++ }
++
++ if (fstat64 (fd, &st) != 0)
++ {
++ puts ("4th fstat failed");
++ return 1;
++ }
++
++ if (st.st_size != 2048 + 64)
++ {
++ printf ("file size after 3rd posix_fallocate call is %llu, expected %u\n",
++ (unsigned long long int) st.st_size, 2048u + 64u);
++ return 1;
++ }
++#ifdef TST_POSIX_FALLOCATE64
++ if (posix_fallocate64 (fd, 4097ULL, 4294967295ULL + 2ULL) != 0)
++ {
++ puts ("4th posix_fallocate call failed");
++ return 1;
++ }
++
++ if (fstat64 (fd, &st) != 0)
++ {
++ puts ("5th fstat failed");
++ return 1;
++ }
++
++ if (st.st_size != 4097ULL + 4294967295ULL + 2ULL)
++ {
++ printf ("file size after 4th posix_fallocate call is %llu, expected %llu\n",
++ (unsigned long long int) st.st_size, 4097ULL + 4294967295ULL + 2ULL);
++ return 1;
++ }
++#endif
++ close (fd);
++
++ return 0;
++}
+diff --git a/test/unistd/tst-posix_fallocate64.c b/test/unistd/tst-posix_fallocate64.c
+new file mode 100644
+index 0000000..b1ee0ff
+--- /dev/null
++++ b/test/unistd/tst-posix_fallocate64.c
+@@ -0,0 +1,2 @@
++#define TST_POSIX_FALLOCATE64
++#include "tst-posix_fallocate.c"
+--
+cgit v0.9.1
diff --git a/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/00_fix-eventfd.patch b/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/00_fix-eventfd.patch
new file mode 100644
index 0000000..cfc64de
--- /dev/null
+++ b/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/00_fix-eventfd.patch
@@ -0,0 +1,59 @@
+From e118373cbb58ba5ffa5fb6670957678d5b87cdb9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 10 Jun 2012 16:36:23 +0000
+Subject: eventfd: Implement eventfd2 and fix eventfd
+
+eventfd: evntfd assumes to take two arguments instead it
+should be one evntfd expects two therefore implement both syscalls with
+correct parameters
+
+Thanks Eugene Rudoy for reporting it and also providing the patch
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+diff --git a/libc/sysdeps/linux/common/eventfd.c b/libc/sysdeps/linux/common/eventfd.c
+index cc3f3f0..96597ab 100644
+--- a/libc/sysdeps/linux/common/eventfd.c
++++ b/libc/sysdeps/linux/common/eventfd.c
+@@ -7,12 +7,24 @@
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
++#include <errno.h>
+ #include <sys/syscall.h>
+ #include <sys/eventfd.h>
+
+ /*
+ * eventfd()
+ */
+-#ifdef __NR_eventfd
+-_syscall2(int, eventfd, int, count, int, flags)
++#if defined __NR_eventfd || defined __NR_eventfd2
++int eventfd (int count, int flags)
++{
++#if defined __NR_eventfd2
++ return INLINE_SYSCALL (eventfd2, 2, count, flags);
++#elif defined __NR_eventfd
++ if (flags != 0) {
++ __set_errno (EINVAL);
++ return -1;
++ }
++ return INLINE_SYSCALL (eventfd, 1, count);
++#endif
++}
+ #endif
+diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c
+index 3567b07..1fc2393 100644
+--- a/libc/sysdeps/linux/common/stubs.c
++++ b/libc/sysdeps/linux/common/stubs.c
+@@ -110,7 +110,7 @@ make_stub(epoll_pwait)
+ make_stub(epoll_wait)
+ #endif
+
+-#if !defined __NR_eventfd && defined __UCLIBC_LINUX_SPECIFIC__
++#if !defined __NR_eventfd && !defined __NR_eventfd2 && defined __UCLIBC_LINUX_SPECIFIC__
+ make_stub(eventfd)
+ #endif
+
+--
+cgit v0.9.1
diff --git a/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/01_add-posix_fallocate.patch b/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/01_add-posix_fallocate.patch
new file mode 100644
index 0000000..dc7bbd7
--- /dev/null
+++ b/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/01_add-posix_fallocate.patch
@@ -0,0 +1,321 @@
+From 5643900913f64c00f1c2958914586708efa5a473 Mon Sep 17 00:00:00 2001
+From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+Date: Tue, 17 Apr 2012 07:30:15 +0000
+Subject: libc: add posix_fallocate()
+
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+diff --git a/include/fcntl.h b/include/fcntl.h
+index ed009dd..c749ad5 100644
+--- a/include/fcntl.h
++++ b/include/fcntl.h
+@@ -217,9 +217,7 @@ extern int posix_fadvise64 (int __fd, __off64_t __offset, __off64_t __len,
+
+ #endif
+
+-#if 0 /* && defined __UCLIBC_HAS_ADVANCED_REALTIME__ */
+-
+-/* FIXME -- uClibc should probably implement these... */
++#if defined __UCLIBC_HAS_ADVANCED_REALTIME__
+
+ /* Reserve storage for the data of the file associated with FD.
+
+diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
+index 566722d..29566dd 100644
+--- a/libc/sysdeps/linux/common/Makefile.in
++++ b/libc/sysdeps/linux/common/Makefile.in
+@@ -82,7 +82,8 @@ CSRC-$(UCLIBC_HAS_REALTIME) += clock_getres.c clock_gettime.c clock_settime.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 posix_madvise.c
++CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c posix_madvise.c \
++ posix_fallocate.c posix_fallocate64.c
+ CSRC-$(UCLIBC_SUSV4_LEGACY) += utime.c
+ CSRC-$(UCLIBC_HAS_EPOLL) += epoll.c
+ CSRC-$(UCLIBC_HAS_XATTR) += xattr.c
+diff --git a/libc/sysdeps/linux/common/bits/kernel-features.h b/libc/sysdeps/linux/common/bits/kernel-features.h
+index 4d1e0cb..6184c2b 100644
+--- a/libc/sysdeps/linux/common/bits/kernel-features.h
++++ b/libc/sysdeps/linux/common/bits/kernel-features.h
+@@ -495,6 +495,14 @@
+ # define __ASSUME_PRIVATE_FUTEX 1
+ #endif
+
++/* Support for fallocate was added in 2.6.23,
++ on s390 only after 2.6.23-rc1, on alpha only after 2.6.33-rc1. */
++#if __LINUX_KERNEL_VERSION >= 0x020617 \
++ && (!defined __s390__ || __LINUX_KERNEL_VERSION >= 0x020618) \
++ && (!defined __alpha__ || __LINUX_KERNEL_VERSION >= 0x020621)
++# define __ASSUME_FALLOCATE 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
+diff --git a/libc/sysdeps/linux/common/posix_fallocate.c b/libc/sysdeps/linux/common/posix_fallocate.c
+new file mode 100644
+index 0000000..9aaa6ce
+--- /dev/null
++++ b/libc/sysdeps/linux/common/posix_fallocate.c
+@@ -0,0 +1,43 @@
++/* vi: set sw=4 ts=4: */
++/*
++ * posix_fallocate() for uClibc
++ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html
++ *
++ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
++ *
++ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
++ */
++
++#include <sys/syscall.h>
++#include <fcntl.h>
++#include <bits/kernel-features.h>
++#include <stdint.h>
++
++#if defined __NR_fallocate
++int posix_fallocate(int fd, __off_t offset, __off_t len)
++{
++ int ret;
++
++# if __WORDSIZE == 32
++ uint32_t off_low = offset;
++ uint32_t len_low = len;
++ /* may assert that these >>31 are 0 */
++ uint32_t zero = 0;
++ INTERNAL_SYSCALL_DECL(err);
++ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
++ __LONG_LONG_PAIR (zero, off_low),
++ __LONG_LONG_PAIR (zero, len_low)));
++# elif __WORDSIZE == 64
++ INTERNAL_SYSCALL_DECL(err);
++ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 4, fd, 0, offset, len));
++# else
++# error your machine is neither 32 bit or 64 bit ... it must be magical
++#endif
++ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
++ return INTERNAL_SYSCALL_ERRNO (ret, err);
++ return 0;
++}
++# if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64
++strong_alias(posix_fallocate,posix_fallocate64)
++# endif
++#endif
+diff --git a/libc/sysdeps/linux/common/posix_fallocate64.c b/libc/sysdeps/linux/common/posix_fallocate64.c
+new file mode 100644
+index 0000000..818d868
+--- /dev/null
++++ b/libc/sysdeps/linux/common/posix_fallocate64.c
+@@ -0,0 +1,39 @@
++/* vi: set sw=4 ts=4: */
++/*
++ * posix_fallocate() for uClibc
++ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html
++ *
++ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
++ *
++ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
++ */
++
++#include <sys/syscall.h>
++#include <fcntl.h>
++#include <bits/kernel-features.h>
++#include <stdint.h>
++
++#if defined __NR_fallocate
++
++# if __WORDSIZE == 64
++/* Can use normal posix_fallocate() */
++# elif __WORDSIZE == 32
++int posix_fallocate64(int fd, __off64_t offset, __off64_t len)
++{
++ int ret;
++ uint32_t off_low = offset & 0xffffffff;
++ uint32_t off_high = offset >> 32;
++ uint32_t len_low = len & 0xffffffff;
++ uint32_t len_high = len >> 32;
++ INTERNAL_SYSCALL_DECL(err);
++ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
++ __LONG_LONG_PAIR (off_high, off_low),
++ __LONG_LONG_PAIR (len_high, len_low)));
++ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
++ return INTERNAL_SYSCALL_ERRNO (ret, err);
++ return 0;
++}
++# else
++# error your machine is neither 32 bit or 64 bit ... it must be magical
++# endif
++#endif
+diff --git a/test/.gitignore b/test/.gitignore
+index c068f89..ec04628 100644
+--- a/test/.gitignore
++++ b/test/.gitignore
+@@ -319,6 +319,8 @@ unistd/getcwd
+ unistd/getopt
+ unistd/getopt_long
+ unistd/tstgetopt
++unistd/tst-posix_fallocate
++unistd/tst-posix_fallocate64
+ unistd/tst-preadwrite
+ unistd/tst-preadwrite64
+ unistd/vfork
+diff --git a/test/unistd/Makefile.in b/test/unistd/Makefile.in
+index c542f98..24b9a37 100644
+--- a/test/unistd/Makefile.in
++++ b/test/unistd/Makefile.in
+@@ -2,7 +2,10 @@
+ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+ ifeq ($(UCLIBC_HAS_LFS),)
+-TESTS_DISABLED := tst-preadwrite64
++TESTS_DISABLED := tst-preadwrite64 tst-posix_fallocate64
++endif
++ifeq ($(UCLIBC_HAS_ADVANCED_REALTIME),)
++TESTS_DISABLED := tst-posix_fallocate
+ endif
+ OPTS_getopt := -abcXXX -9
+ OPTS_getopt_long := --add XXX --delete YYY --verbose
+diff --git a/test/unistd/tst-posix_fallocate.c b/test/unistd/tst-posix_fallocate.c
+new file mode 100644
+index 0000000..d41c604
+--- /dev/null
++++ b/test/unistd/tst-posix_fallocate.c
+@@ -0,0 +1,127 @@
++#include <fcntl.h>
++#include <sys/stat.h>
++
++#ifndef TST_POSIX_FALLOCATE64
++# define stat64 stat
++# define fstat64 fstat
++# else
++# ifndef O_LARGEFILE
++# error no O_LARGEFILE but you want to test with LFS enabled
++# endif
++#endif
++
++static void do_prepare (void);
++#define PREPARE(argc, argv) do_prepare ()
++static int do_test (void);
++#define TEST_FUNCTION do_test ()
++#include <test-skeleton.c>
++
++static int fd;
++static void
++do_prepare (void)
++{
++ fd = create_temp_file ("tst-posix_fallocate.", NULL);
++ if (fd == -1)
++ {
++ printf ("cannot create temporary file: %m\n");
++ exit (1);
++ }
++}
++
++
++static int
++do_test (void)
++{
++ struct stat64 st;
++
++ if (fstat64 (fd, &st) != 0)
++ {
++ puts ("1st fstat failed");
++ return 1;
++ }
++
++ if (st.st_size != 0)
++ {
++ puts ("file not created with size 0");
++ return 1;
++ }
++
++ if (posix_fallocate (fd, 512, 768) != 0)
++ {
++ puts ("1st posix_fallocate call failed");
++ return 1;
++ }
++
++ if (fstat64 (fd, &st) != 0)
++ {
++ puts ("2nd fstat failed");
++ return 1;
++ }
++
++ if (st.st_size != 512 + 768)
++ {
++ printf ("file size after 1st posix_fallocate call is %llu, expected %u\n",
++ (unsigned long long int) st.st_size, 512u + 768u);
++ return 1;
++ }
++
++ if (posix_fallocate (fd, 0, 1024) != 0)
++ {
++ puts ("2nd posix_fallocate call failed");
++ return 1;
++ }
++
++ if (fstat64 (fd, &st) != 0)
++ {
++ puts ("3rd fstat failed");
++ return 1;
++ }
++
++ if (st.st_size != 512 + 768)
++ {
++ puts ("file size changed in 2nd posix_fallocate");
++ return 1;
++ }
++
++ if (posix_fallocate (fd, 2048, 64) != 0)
++ {
++ puts ("3rd posix_fallocate call failed");
++ return 1;
++ }
++
++ if (fstat64 (fd, &st) != 0)
++ {
++ puts ("4th fstat failed");
++ return 1;
++ }
++
++ if (st.st_size != 2048 + 64)
++ {
++ printf ("file size after 3rd posix_fallocate call is %llu, expected %u\n",
++ (unsigned long long int) st.st_size, 2048u + 64u);
++ return 1;
++ }
++#ifdef TST_POSIX_FALLOCATE64
++ if (posix_fallocate64 (fd, 4097ULL, 4294967295ULL + 2ULL) != 0)
++ {
++ puts ("4th posix_fallocate call failed");
++ return 1;
++ }
++
++ if (fstat64 (fd, &st) != 0)
++ {
++ puts ("5th fstat failed");
++ return 1;
++ }
++
++ if (st.st_size != 4097ULL + 4294967295ULL + 2ULL)
++ {
++ printf ("file size after 4th posix_fallocate call is %llu, expected %llu\n",
++ (unsigned long long int) st.st_size, 4097ULL + 4294967295ULL + 2ULL);
++ return 1;
++ }
++#endif
++ close (fd);
++
++ return 0;
++}
+diff --git a/test/unistd/tst-posix_fallocate64.c b/test/unistd/tst-posix_fallocate64.c
+new file mode 100644
+index 0000000..b1ee0ff
+--- /dev/null
++++ b/test/unistd/tst-posix_fallocate64.c
+@@ -0,0 +1,2 @@
++#define TST_POSIX_FALLOCATE64
++#include "tst-posix_fallocate.c"
+--
+cgit v0.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] proj/releng:master commit in: tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/, ...
@ 2013-06-05 17:45 Anthony G. Basile
0 siblings, 0 replies; 7+ messages in thread
From: Anthony G. Basile @ 2013-06-05 17:45 UTC (permalink / raw
To: gentoo-commits
commit: 3748e4529759c0720443f8c4ff699d3154be994f
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 5 17:45:59 2013 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Wed Jun 5 17:45:59 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/releng.git;a=commit;h=3748e452
tools-uclibc: bump uclibc to 0.9.33.2-r4 for {amd64,i686}-{hardened,vanilla}
---
.../package.accept_keywords/uclibc | 1 +
.../sys-libs/uclibc/01_add-posix_fallocate.patch | 321 ---------------------
.../{uclibc-0.9.33.2-r3 => uclibc-0.9.33.2-r4} | 0
.../package.accept_keywords/uclibc | 1 +
.../sys-libs/uclibc/01_add-posix_fallocate.patch | 321 ---------------------
.../{uclibc-0.9.33.2-r3 => uclibc-0.9.33.2-r4} | 0
.../package.accept_keywords/uclibc | 1 +
.../sys-libs/uclibc/01_add-posix_fallocate.patch | 321 ---------------------
.../{uclibc-0.9.33.2-r3 => uclibc-0.9.33.2-r4} | 0
.../package.accept_keywords/uclibc | 1 +
.../sys-libs/uclibc/01_add-posix_fallocate.patch | 321 ---------------------
.../{uclibc-0.9.33.2-r3 => uclibc-0.9.33.2-r4} | 0
12 files changed, 4 insertions(+), 1284 deletions(-)
diff --git a/tools-uclibc/portage.amd64.hardened/package.accept_keywords/uclibc b/tools-uclibc/portage.amd64.hardened/package.accept_keywords/uclibc
new file mode 100644
index 0000000..2487e96
--- /dev/null
+++ b/tools-uclibc/portage.amd64.hardened/package.accept_keywords/uclibc
@@ -0,0 +1 @@
+=sys-libs/uclibc-0.9.33.2-r4 ~amd64
diff --git a/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/01_add-posix_fallocate.patch b/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/01_add-posix_fallocate.patch
deleted file mode 100644
index dc7bbd7..0000000
--- a/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/01_add-posix_fallocate.patch
+++ /dev/null
@@ -1,321 +0,0 @@
-From 5643900913f64c00f1c2958914586708efa5a473 Mon Sep 17 00:00:00 2001
-From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Tue, 17 Apr 2012 07:30:15 +0000
-Subject: libc: add posix_fallocate()
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
-diff --git a/include/fcntl.h b/include/fcntl.h
-index ed009dd..c749ad5 100644
---- a/include/fcntl.h
-+++ b/include/fcntl.h
-@@ -217,9 +217,7 @@ extern int posix_fadvise64 (int __fd, __off64_t __offset, __off64_t __len,
-
- #endif
-
--#if 0 /* && defined __UCLIBC_HAS_ADVANCED_REALTIME__ */
--
--/* FIXME -- uClibc should probably implement these... */
-+#if defined __UCLIBC_HAS_ADVANCED_REALTIME__
-
- /* Reserve storage for the data of the file associated with FD.
-
-diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
-index 566722d..29566dd 100644
---- a/libc/sysdeps/linux/common/Makefile.in
-+++ b/libc/sysdeps/linux/common/Makefile.in
-@@ -82,7 +82,8 @@ CSRC-$(UCLIBC_HAS_REALTIME) += clock_getres.c clock_gettime.c clock_settime.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 posix_madvise.c
-+CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c posix_madvise.c \
-+ posix_fallocate.c posix_fallocate64.c
- CSRC-$(UCLIBC_SUSV4_LEGACY) += utime.c
- CSRC-$(UCLIBC_HAS_EPOLL) += epoll.c
- CSRC-$(UCLIBC_HAS_XATTR) += xattr.c
-diff --git a/libc/sysdeps/linux/common/bits/kernel-features.h b/libc/sysdeps/linux/common/bits/kernel-features.h
-index 4d1e0cb..6184c2b 100644
---- a/libc/sysdeps/linux/common/bits/kernel-features.h
-+++ b/libc/sysdeps/linux/common/bits/kernel-features.h
-@@ -495,6 +495,14 @@
- # define __ASSUME_PRIVATE_FUTEX 1
- #endif
-
-+/* Support for fallocate was added in 2.6.23,
-+ on s390 only after 2.6.23-rc1, on alpha only after 2.6.33-rc1. */
-+#if __LINUX_KERNEL_VERSION >= 0x020617 \
-+ && (!defined __s390__ || __LINUX_KERNEL_VERSION >= 0x020618) \
-+ && (!defined __alpha__ || __LINUX_KERNEL_VERSION >= 0x020621)
-+# define __ASSUME_FALLOCATE 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
-diff --git a/libc/sysdeps/linux/common/posix_fallocate.c b/libc/sysdeps/linux/common/posix_fallocate.c
-new file mode 100644
-index 0000000..9aaa6ce
---- /dev/null
-+++ b/libc/sysdeps/linux/common/posix_fallocate.c
-@@ -0,0 +1,43 @@
-+/* vi: set sw=4 ts=4: */
-+/*
-+ * posix_fallocate() for uClibc
-+ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html
-+ *
-+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
-+ *
-+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
-+ */
-+
-+#include <sys/syscall.h>
-+#include <fcntl.h>
-+#include <bits/kernel-features.h>
-+#include <stdint.h>
-+
-+#if defined __NR_fallocate
-+int posix_fallocate(int fd, __off_t offset, __off_t len)
-+{
-+ int ret;
-+
-+# if __WORDSIZE == 32
-+ uint32_t off_low = offset;
-+ uint32_t len_low = len;
-+ /* may assert that these >>31 are 0 */
-+ uint32_t zero = 0;
-+ INTERNAL_SYSCALL_DECL(err);
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
-+ __LONG_LONG_PAIR (zero, off_low),
-+ __LONG_LONG_PAIR (zero, len_low)));
-+# elif __WORDSIZE == 64
-+ INTERNAL_SYSCALL_DECL(err);
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 4, fd, 0, offset, len));
-+# else
-+# error your machine is neither 32 bit or 64 bit ... it must be magical
-+#endif
-+ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
-+ return INTERNAL_SYSCALL_ERRNO (ret, err);
-+ return 0;
-+}
-+# if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64
-+strong_alias(posix_fallocate,posix_fallocate64)
-+# endif
-+#endif
-diff --git a/libc/sysdeps/linux/common/posix_fallocate64.c b/libc/sysdeps/linux/common/posix_fallocate64.c
-new file mode 100644
-index 0000000..818d868
---- /dev/null
-+++ b/libc/sysdeps/linux/common/posix_fallocate64.c
-@@ -0,0 +1,39 @@
-+/* vi: set sw=4 ts=4: */
-+/*
-+ * posix_fallocate() for uClibc
-+ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html
-+ *
-+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
-+ *
-+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
-+ */
-+
-+#include <sys/syscall.h>
-+#include <fcntl.h>
-+#include <bits/kernel-features.h>
-+#include <stdint.h>
-+
-+#if defined __NR_fallocate
-+
-+# if __WORDSIZE == 64
-+/* Can use normal posix_fallocate() */
-+# elif __WORDSIZE == 32
-+int posix_fallocate64(int fd, __off64_t offset, __off64_t len)
-+{
-+ int ret;
-+ uint32_t off_low = offset & 0xffffffff;
-+ uint32_t off_high = offset >> 32;
-+ uint32_t len_low = len & 0xffffffff;
-+ uint32_t len_high = len >> 32;
-+ INTERNAL_SYSCALL_DECL(err);
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
-+ __LONG_LONG_PAIR (off_high, off_low),
-+ __LONG_LONG_PAIR (len_high, len_low)));
-+ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
-+ return INTERNAL_SYSCALL_ERRNO (ret, err);
-+ return 0;
-+}
-+# else
-+# error your machine is neither 32 bit or 64 bit ... it must be magical
-+# endif
-+#endif
-diff --git a/test/.gitignore b/test/.gitignore
-index c068f89..ec04628 100644
---- a/test/.gitignore
-+++ b/test/.gitignore
-@@ -319,6 +319,8 @@ unistd/getcwd
- unistd/getopt
- unistd/getopt_long
- unistd/tstgetopt
-+unistd/tst-posix_fallocate
-+unistd/tst-posix_fallocate64
- unistd/tst-preadwrite
- unistd/tst-preadwrite64
- unistd/vfork
-diff --git a/test/unistd/Makefile.in b/test/unistd/Makefile.in
-index c542f98..24b9a37 100644
---- a/test/unistd/Makefile.in
-+++ b/test/unistd/Makefile.in
-@@ -2,7 +2,10 @@
- # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
-
- ifeq ($(UCLIBC_HAS_LFS),)
--TESTS_DISABLED := tst-preadwrite64
-+TESTS_DISABLED := tst-preadwrite64 tst-posix_fallocate64
-+endif
-+ifeq ($(UCLIBC_HAS_ADVANCED_REALTIME),)
-+TESTS_DISABLED := tst-posix_fallocate
- endif
- OPTS_getopt := -abcXXX -9
- OPTS_getopt_long := --add XXX --delete YYY --verbose
-diff --git a/test/unistd/tst-posix_fallocate.c b/test/unistd/tst-posix_fallocate.c
-new file mode 100644
-index 0000000..d41c604
---- /dev/null
-+++ b/test/unistd/tst-posix_fallocate.c
-@@ -0,0 +1,127 @@
-+#include <fcntl.h>
-+#include <sys/stat.h>
-+
-+#ifndef TST_POSIX_FALLOCATE64
-+# define stat64 stat
-+# define fstat64 fstat
-+# else
-+# ifndef O_LARGEFILE
-+# error no O_LARGEFILE but you want to test with LFS enabled
-+# endif
-+#endif
-+
-+static void do_prepare (void);
-+#define PREPARE(argc, argv) do_prepare ()
-+static int do_test (void);
-+#define TEST_FUNCTION do_test ()
-+#include <test-skeleton.c>
-+
-+static int fd;
-+static void
-+do_prepare (void)
-+{
-+ fd = create_temp_file ("tst-posix_fallocate.", NULL);
-+ if (fd == -1)
-+ {
-+ printf ("cannot create temporary file: %m\n");
-+ exit (1);
-+ }
-+}
-+
-+
-+static int
-+do_test (void)
-+{
-+ struct stat64 st;
-+
-+ if (fstat64 (fd, &st) != 0)
-+ {
-+ puts ("1st fstat failed");
-+ return 1;
-+ }
-+
-+ if (st.st_size != 0)
-+ {
-+ puts ("file not created with size 0");
-+ return 1;
-+ }
-+
-+ if (posix_fallocate (fd, 512, 768) != 0)
-+ {
-+ puts ("1st posix_fallocate call failed");
-+ return 1;
-+ }
-+
-+ if (fstat64 (fd, &st) != 0)
-+ {
-+ puts ("2nd fstat failed");
-+ return 1;
-+ }
-+
-+ if (st.st_size != 512 + 768)
-+ {
-+ printf ("file size after 1st posix_fallocate call is %llu, expected %u\n",
-+ (unsigned long long int) st.st_size, 512u + 768u);
-+ return 1;
-+ }
-+
-+ if (posix_fallocate (fd, 0, 1024) != 0)
-+ {
-+ puts ("2nd posix_fallocate call failed");
-+ return 1;
-+ }
-+
-+ if (fstat64 (fd, &st) != 0)
-+ {
-+ puts ("3rd fstat failed");
-+ return 1;
-+ }
-+
-+ if (st.st_size != 512 + 768)
-+ {
-+ puts ("file size changed in 2nd posix_fallocate");
-+ return 1;
-+ }
-+
-+ if (posix_fallocate (fd, 2048, 64) != 0)
-+ {
-+ puts ("3rd posix_fallocate call failed");
-+ return 1;
-+ }
-+
-+ if (fstat64 (fd, &st) != 0)
-+ {
-+ puts ("4th fstat failed");
-+ return 1;
-+ }
-+
-+ if (st.st_size != 2048 + 64)
-+ {
-+ printf ("file size after 3rd posix_fallocate call is %llu, expected %u\n",
-+ (unsigned long long int) st.st_size, 2048u + 64u);
-+ return 1;
-+ }
-+#ifdef TST_POSIX_FALLOCATE64
-+ if (posix_fallocate64 (fd, 4097ULL, 4294967295ULL + 2ULL) != 0)
-+ {
-+ puts ("4th posix_fallocate call failed");
-+ return 1;
-+ }
-+
-+ if (fstat64 (fd, &st) != 0)
-+ {
-+ puts ("5th fstat failed");
-+ return 1;
-+ }
-+
-+ if (st.st_size != 4097ULL + 4294967295ULL + 2ULL)
-+ {
-+ printf ("file size after 4th posix_fallocate call is %llu, expected %llu\n",
-+ (unsigned long long int) st.st_size, 4097ULL + 4294967295ULL + 2ULL);
-+ return 1;
-+ }
-+#endif
-+ close (fd);
-+
-+ return 0;
-+}
-diff --git a/test/unistd/tst-posix_fallocate64.c b/test/unistd/tst-posix_fallocate64.c
-new file mode 100644
-index 0000000..b1ee0ff
---- /dev/null
-+++ b/test/unistd/tst-posix_fallocate64.c
-@@ -0,0 +1,2 @@
-+#define TST_POSIX_FALLOCATE64
-+#include "tst-posix_fallocate.c"
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.amd64.hardened/savedconfig/sys-libs/uclibc-0.9.33.2-r3 b/tools-uclibc/portage.amd64.hardened/savedconfig/sys-libs/uclibc-0.9.33.2-r4
similarity index 100%
rename from tools-uclibc/portage.amd64.hardened/savedconfig/sys-libs/uclibc-0.9.33.2-r3
rename to tools-uclibc/portage.amd64.hardened/savedconfig/sys-libs/uclibc-0.9.33.2-r4
diff --git a/tools-uclibc/portage.amd64.vanilla/package.accept_keywords/uclibc b/tools-uclibc/portage.amd64.vanilla/package.accept_keywords/uclibc
new file mode 100644
index 0000000..2487e96
--- /dev/null
+++ b/tools-uclibc/portage.amd64.vanilla/package.accept_keywords/uclibc
@@ -0,0 +1 @@
+=sys-libs/uclibc-0.9.33.2-r4 ~amd64
diff --git a/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/01_add-posix_fallocate.patch b/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/01_add-posix_fallocate.patch
deleted file mode 100644
index dc7bbd7..0000000
--- a/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/01_add-posix_fallocate.patch
+++ /dev/null
@@ -1,321 +0,0 @@
-From 5643900913f64c00f1c2958914586708efa5a473 Mon Sep 17 00:00:00 2001
-From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Tue, 17 Apr 2012 07:30:15 +0000
-Subject: libc: add posix_fallocate()
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
-diff --git a/include/fcntl.h b/include/fcntl.h
-index ed009dd..c749ad5 100644
---- a/include/fcntl.h
-+++ b/include/fcntl.h
-@@ -217,9 +217,7 @@ extern int posix_fadvise64 (int __fd, __off64_t __offset, __off64_t __len,
-
- #endif
-
--#if 0 /* && defined __UCLIBC_HAS_ADVANCED_REALTIME__ */
--
--/* FIXME -- uClibc should probably implement these... */
-+#if defined __UCLIBC_HAS_ADVANCED_REALTIME__
-
- /* Reserve storage for the data of the file associated with FD.
-
-diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
-index 566722d..29566dd 100644
---- a/libc/sysdeps/linux/common/Makefile.in
-+++ b/libc/sysdeps/linux/common/Makefile.in
-@@ -82,7 +82,8 @@ CSRC-$(UCLIBC_HAS_REALTIME) += clock_getres.c clock_gettime.c clock_settime.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 posix_madvise.c
-+CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c posix_madvise.c \
-+ posix_fallocate.c posix_fallocate64.c
- CSRC-$(UCLIBC_SUSV4_LEGACY) += utime.c
- CSRC-$(UCLIBC_HAS_EPOLL) += epoll.c
- CSRC-$(UCLIBC_HAS_XATTR) += xattr.c
-diff --git a/libc/sysdeps/linux/common/bits/kernel-features.h b/libc/sysdeps/linux/common/bits/kernel-features.h
-index 4d1e0cb..6184c2b 100644
---- a/libc/sysdeps/linux/common/bits/kernel-features.h
-+++ b/libc/sysdeps/linux/common/bits/kernel-features.h
-@@ -495,6 +495,14 @@
- # define __ASSUME_PRIVATE_FUTEX 1
- #endif
-
-+/* Support for fallocate was added in 2.6.23,
-+ on s390 only after 2.6.23-rc1, on alpha only after 2.6.33-rc1. */
-+#if __LINUX_KERNEL_VERSION >= 0x020617 \
-+ && (!defined __s390__ || __LINUX_KERNEL_VERSION >= 0x020618) \
-+ && (!defined __alpha__ || __LINUX_KERNEL_VERSION >= 0x020621)
-+# define __ASSUME_FALLOCATE 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
-diff --git a/libc/sysdeps/linux/common/posix_fallocate.c b/libc/sysdeps/linux/common/posix_fallocate.c
-new file mode 100644
-index 0000000..9aaa6ce
---- /dev/null
-+++ b/libc/sysdeps/linux/common/posix_fallocate.c
-@@ -0,0 +1,43 @@
-+/* vi: set sw=4 ts=4: */
-+/*
-+ * posix_fallocate() for uClibc
-+ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html
-+ *
-+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
-+ *
-+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
-+ */
-+
-+#include <sys/syscall.h>
-+#include <fcntl.h>
-+#include <bits/kernel-features.h>
-+#include <stdint.h>
-+
-+#if defined __NR_fallocate
-+int posix_fallocate(int fd, __off_t offset, __off_t len)
-+{
-+ int ret;
-+
-+# if __WORDSIZE == 32
-+ uint32_t off_low = offset;
-+ uint32_t len_low = len;
-+ /* may assert that these >>31 are 0 */
-+ uint32_t zero = 0;
-+ INTERNAL_SYSCALL_DECL(err);
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
-+ __LONG_LONG_PAIR (zero, off_low),
-+ __LONG_LONG_PAIR (zero, len_low)));
-+# elif __WORDSIZE == 64
-+ INTERNAL_SYSCALL_DECL(err);
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 4, fd, 0, offset, len));
-+# else
-+# error your machine is neither 32 bit or 64 bit ... it must be magical
-+#endif
-+ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
-+ return INTERNAL_SYSCALL_ERRNO (ret, err);
-+ return 0;
-+}
-+# if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64
-+strong_alias(posix_fallocate,posix_fallocate64)
-+# endif
-+#endif
-diff --git a/libc/sysdeps/linux/common/posix_fallocate64.c b/libc/sysdeps/linux/common/posix_fallocate64.c
-new file mode 100644
-index 0000000..818d868
---- /dev/null
-+++ b/libc/sysdeps/linux/common/posix_fallocate64.c
-@@ -0,0 +1,39 @@
-+/* vi: set sw=4 ts=4: */
-+/*
-+ * posix_fallocate() for uClibc
-+ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html
-+ *
-+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
-+ *
-+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
-+ */
-+
-+#include <sys/syscall.h>
-+#include <fcntl.h>
-+#include <bits/kernel-features.h>
-+#include <stdint.h>
-+
-+#if defined __NR_fallocate
-+
-+# if __WORDSIZE == 64
-+/* Can use normal posix_fallocate() */
-+# elif __WORDSIZE == 32
-+int posix_fallocate64(int fd, __off64_t offset, __off64_t len)
-+{
-+ int ret;
-+ uint32_t off_low = offset & 0xffffffff;
-+ uint32_t off_high = offset >> 32;
-+ uint32_t len_low = len & 0xffffffff;
-+ uint32_t len_high = len >> 32;
-+ INTERNAL_SYSCALL_DECL(err);
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
-+ __LONG_LONG_PAIR (off_high, off_low),
-+ __LONG_LONG_PAIR (len_high, len_low)));
-+ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
-+ return INTERNAL_SYSCALL_ERRNO (ret, err);
-+ return 0;
-+}
-+# else
-+# error your machine is neither 32 bit or 64 bit ... it must be magical
-+# endif
-+#endif
-diff --git a/test/.gitignore b/test/.gitignore
-index c068f89..ec04628 100644
---- a/test/.gitignore
-+++ b/test/.gitignore
-@@ -319,6 +319,8 @@ unistd/getcwd
- unistd/getopt
- unistd/getopt_long
- unistd/tstgetopt
-+unistd/tst-posix_fallocate
-+unistd/tst-posix_fallocate64
- unistd/tst-preadwrite
- unistd/tst-preadwrite64
- unistd/vfork
-diff --git a/test/unistd/Makefile.in b/test/unistd/Makefile.in
-index c542f98..24b9a37 100644
---- a/test/unistd/Makefile.in
-+++ b/test/unistd/Makefile.in
-@@ -2,7 +2,10 @@
- # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
-
- ifeq ($(UCLIBC_HAS_LFS),)
--TESTS_DISABLED := tst-preadwrite64
-+TESTS_DISABLED := tst-preadwrite64 tst-posix_fallocate64
-+endif
-+ifeq ($(UCLIBC_HAS_ADVANCED_REALTIME),)
-+TESTS_DISABLED := tst-posix_fallocate
- endif
- OPTS_getopt := -abcXXX -9
- OPTS_getopt_long := --add XXX --delete YYY --verbose
-diff --git a/test/unistd/tst-posix_fallocate.c b/test/unistd/tst-posix_fallocate.c
-new file mode 100644
-index 0000000..d41c604
---- /dev/null
-+++ b/test/unistd/tst-posix_fallocate.c
-@@ -0,0 +1,127 @@
-+#include <fcntl.h>
-+#include <sys/stat.h>
-+
-+#ifndef TST_POSIX_FALLOCATE64
-+# define stat64 stat
-+# define fstat64 fstat
-+# else
-+# ifndef O_LARGEFILE
-+# error no O_LARGEFILE but you want to test with LFS enabled
-+# endif
-+#endif
-+
-+static void do_prepare (void);
-+#define PREPARE(argc, argv) do_prepare ()
-+static int do_test (void);
-+#define TEST_FUNCTION do_test ()
-+#include <test-skeleton.c>
-+
-+static int fd;
-+static void
-+do_prepare (void)
-+{
-+ fd = create_temp_file ("tst-posix_fallocate.", NULL);
-+ if (fd == -1)
-+ {
-+ printf ("cannot create temporary file: %m\n");
-+ exit (1);
-+ }
-+}
-+
-+
-+static int
-+do_test (void)
-+{
-+ struct stat64 st;
-+
-+ if (fstat64 (fd, &st) != 0)
-+ {
-+ puts ("1st fstat failed");
-+ return 1;
-+ }
-+
-+ if (st.st_size != 0)
-+ {
-+ puts ("file not created with size 0");
-+ return 1;
-+ }
-+
-+ if (posix_fallocate (fd, 512, 768) != 0)
-+ {
-+ puts ("1st posix_fallocate call failed");
-+ return 1;
-+ }
-+
-+ if (fstat64 (fd, &st) != 0)
-+ {
-+ puts ("2nd fstat failed");
-+ return 1;
-+ }
-+
-+ if (st.st_size != 512 + 768)
-+ {
-+ printf ("file size after 1st posix_fallocate call is %llu, expected %u\n",
-+ (unsigned long long int) st.st_size, 512u + 768u);
-+ return 1;
-+ }
-+
-+ if (posix_fallocate (fd, 0, 1024) != 0)
-+ {
-+ puts ("2nd posix_fallocate call failed");
-+ return 1;
-+ }
-+
-+ if (fstat64 (fd, &st) != 0)
-+ {
-+ puts ("3rd fstat failed");
-+ return 1;
-+ }
-+
-+ if (st.st_size != 512 + 768)
-+ {
-+ puts ("file size changed in 2nd posix_fallocate");
-+ return 1;
-+ }
-+
-+ if (posix_fallocate (fd, 2048, 64) != 0)
-+ {
-+ puts ("3rd posix_fallocate call failed");
-+ return 1;
-+ }
-+
-+ if (fstat64 (fd, &st) != 0)
-+ {
-+ puts ("4th fstat failed");
-+ return 1;
-+ }
-+
-+ if (st.st_size != 2048 + 64)
-+ {
-+ printf ("file size after 3rd posix_fallocate call is %llu, expected %u\n",
-+ (unsigned long long int) st.st_size, 2048u + 64u);
-+ return 1;
-+ }
-+#ifdef TST_POSIX_FALLOCATE64
-+ if (posix_fallocate64 (fd, 4097ULL, 4294967295ULL + 2ULL) != 0)
-+ {
-+ puts ("4th posix_fallocate call failed");
-+ return 1;
-+ }
-+
-+ if (fstat64 (fd, &st) != 0)
-+ {
-+ puts ("5th fstat failed");
-+ return 1;
-+ }
-+
-+ if (st.st_size != 4097ULL + 4294967295ULL + 2ULL)
-+ {
-+ printf ("file size after 4th posix_fallocate call is %llu, expected %llu\n",
-+ (unsigned long long int) st.st_size, 4097ULL + 4294967295ULL + 2ULL);
-+ return 1;
-+ }
-+#endif
-+ close (fd);
-+
-+ return 0;
-+}
-diff --git a/test/unistd/tst-posix_fallocate64.c b/test/unistd/tst-posix_fallocate64.c
-new file mode 100644
-index 0000000..b1ee0ff
---- /dev/null
-+++ b/test/unistd/tst-posix_fallocate64.c
-@@ -0,0 +1,2 @@
-+#define TST_POSIX_FALLOCATE64
-+#include "tst-posix_fallocate.c"
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.amd64.vanilla/savedconfig/sys-libs/uclibc-0.9.33.2-r3 b/tools-uclibc/portage.amd64.vanilla/savedconfig/sys-libs/uclibc-0.9.33.2-r4
similarity index 100%
rename from tools-uclibc/portage.amd64.vanilla/savedconfig/sys-libs/uclibc-0.9.33.2-r3
rename to tools-uclibc/portage.amd64.vanilla/savedconfig/sys-libs/uclibc-0.9.33.2-r4
diff --git a/tools-uclibc/portage.i686.hardened/package.accept_keywords/uclibc b/tools-uclibc/portage.i686.hardened/package.accept_keywords/uclibc
new file mode 100644
index 0000000..c209898
--- /dev/null
+++ b/tools-uclibc/portage.i686.hardened/package.accept_keywords/uclibc
@@ -0,0 +1 @@
+=sys-libs/uclibc-0.9.33.2-r4 ~x86
diff --git a/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/01_add-posix_fallocate.patch b/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/01_add-posix_fallocate.patch
deleted file mode 100644
index dc7bbd7..0000000
--- a/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/01_add-posix_fallocate.patch
+++ /dev/null
@@ -1,321 +0,0 @@
-From 5643900913f64c00f1c2958914586708efa5a473 Mon Sep 17 00:00:00 2001
-From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Tue, 17 Apr 2012 07:30:15 +0000
-Subject: libc: add posix_fallocate()
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
-diff --git a/include/fcntl.h b/include/fcntl.h
-index ed009dd..c749ad5 100644
---- a/include/fcntl.h
-+++ b/include/fcntl.h
-@@ -217,9 +217,7 @@ extern int posix_fadvise64 (int __fd, __off64_t __offset, __off64_t __len,
-
- #endif
-
--#if 0 /* && defined __UCLIBC_HAS_ADVANCED_REALTIME__ */
--
--/* FIXME -- uClibc should probably implement these... */
-+#if defined __UCLIBC_HAS_ADVANCED_REALTIME__
-
- /* Reserve storage for the data of the file associated with FD.
-
-diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
-index 566722d..29566dd 100644
---- a/libc/sysdeps/linux/common/Makefile.in
-+++ b/libc/sysdeps/linux/common/Makefile.in
-@@ -82,7 +82,8 @@ CSRC-$(UCLIBC_HAS_REALTIME) += clock_getres.c clock_gettime.c clock_settime.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 posix_madvise.c
-+CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c posix_madvise.c \
-+ posix_fallocate.c posix_fallocate64.c
- CSRC-$(UCLIBC_SUSV4_LEGACY) += utime.c
- CSRC-$(UCLIBC_HAS_EPOLL) += epoll.c
- CSRC-$(UCLIBC_HAS_XATTR) += xattr.c
-diff --git a/libc/sysdeps/linux/common/bits/kernel-features.h b/libc/sysdeps/linux/common/bits/kernel-features.h
-index 4d1e0cb..6184c2b 100644
---- a/libc/sysdeps/linux/common/bits/kernel-features.h
-+++ b/libc/sysdeps/linux/common/bits/kernel-features.h
-@@ -495,6 +495,14 @@
- # define __ASSUME_PRIVATE_FUTEX 1
- #endif
-
-+/* Support for fallocate was added in 2.6.23,
-+ on s390 only after 2.6.23-rc1, on alpha only after 2.6.33-rc1. */
-+#if __LINUX_KERNEL_VERSION >= 0x020617 \
-+ && (!defined __s390__ || __LINUX_KERNEL_VERSION >= 0x020618) \
-+ && (!defined __alpha__ || __LINUX_KERNEL_VERSION >= 0x020621)
-+# define __ASSUME_FALLOCATE 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
-diff --git a/libc/sysdeps/linux/common/posix_fallocate.c b/libc/sysdeps/linux/common/posix_fallocate.c
-new file mode 100644
-index 0000000..9aaa6ce
---- /dev/null
-+++ b/libc/sysdeps/linux/common/posix_fallocate.c
-@@ -0,0 +1,43 @@
-+/* vi: set sw=4 ts=4: */
-+/*
-+ * posix_fallocate() for uClibc
-+ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html
-+ *
-+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
-+ *
-+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
-+ */
-+
-+#include <sys/syscall.h>
-+#include <fcntl.h>
-+#include <bits/kernel-features.h>
-+#include <stdint.h>
-+
-+#if defined __NR_fallocate
-+int posix_fallocate(int fd, __off_t offset, __off_t len)
-+{
-+ int ret;
-+
-+# if __WORDSIZE == 32
-+ uint32_t off_low = offset;
-+ uint32_t len_low = len;
-+ /* may assert that these >>31 are 0 */
-+ uint32_t zero = 0;
-+ INTERNAL_SYSCALL_DECL(err);
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
-+ __LONG_LONG_PAIR (zero, off_low),
-+ __LONG_LONG_PAIR (zero, len_low)));
-+# elif __WORDSIZE == 64
-+ INTERNAL_SYSCALL_DECL(err);
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 4, fd, 0, offset, len));
-+# else
-+# error your machine is neither 32 bit or 64 bit ... it must be magical
-+#endif
-+ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
-+ return INTERNAL_SYSCALL_ERRNO (ret, err);
-+ return 0;
-+}
-+# if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64
-+strong_alias(posix_fallocate,posix_fallocate64)
-+# endif
-+#endif
-diff --git a/libc/sysdeps/linux/common/posix_fallocate64.c b/libc/sysdeps/linux/common/posix_fallocate64.c
-new file mode 100644
-index 0000000..818d868
---- /dev/null
-+++ b/libc/sysdeps/linux/common/posix_fallocate64.c
-@@ -0,0 +1,39 @@
-+/* vi: set sw=4 ts=4: */
-+/*
-+ * posix_fallocate() for uClibc
-+ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html
-+ *
-+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
-+ *
-+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
-+ */
-+
-+#include <sys/syscall.h>
-+#include <fcntl.h>
-+#include <bits/kernel-features.h>
-+#include <stdint.h>
-+
-+#if defined __NR_fallocate
-+
-+# if __WORDSIZE == 64
-+/* Can use normal posix_fallocate() */
-+# elif __WORDSIZE == 32
-+int posix_fallocate64(int fd, __off64_t offset, __off64_t len)
-+{
-+ int ret;
-+ uint32_t off_low = offset & 0xffffffff;
-+ uint32_t off_high = offset >> 32;
-+ uint32_t len_low = len & 0xffffffff;
-+ uint32_t len_high = len >> 32;
-+ INTERNAL_SYSCALL_DECL(err);
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
-+ __LONG_LONG_PAIR (off_high, off_low),
-+ __LONG_LONG_PAIR (len_high, len_low)));
-+ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
-+ return INTERNAL_SYSCALL_ERRNO (ret, err);
-+ return 0;
-+}
-+# else
-+# error your machine is neither 32 bit or 64 bit ... it must be magical
-+# endif
-+#endif
-diff --git a/test/.gitignore b/test/.gitignore
-index c068f89..ec04628 100644
---- a/test/.gitignore
-+++ b/test/.gitignore
-@@ -319,6 +319,8 @@ unistd/getcwd
- unistd/getopt
- unistd/getopt_long
- unistd/tstgetopt
-+unistd/tst-posix_fallocate
-+unistd/tst-posix_fallocate64
- unistd/tst-preadwrite
- unistd/tst-preadwrite64
- unistd/vfork
-diff --git a/test/unistd/Makefile.in b/test/unistd/Makefile.in
-index c542f98..24b9a37 100644
---- a/test/unistd/Makefile.in
-+++ b/test/unistd/Makefile.in
-@@ -2,7 +2,10 @@
- # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
-
- ifeq ($(UCLIBC_HAS_LFS),)
--TESTS_DISABLED := tst-preadwrite64
-+TESTS_DISABLED := tst-preadwrite64 tst-posix_fallocate64
-+endif
-+ifeq ($(UCLIBC_HAS_ADVANCED_REALTIME),)
-+TESTS_DISABLED := tst-posix_fallocate
- endif
- OPTS_getopt := -abcXXX -9
- OPTS_getopt_long := --add XXX --delete YYY --verbose
-diff --git a/test/unistd/tst-posix_fallocate.c b/test/unistd/tst-posix_fallocate.c
-new file mode 100644
-index 0000000..d41c604
---- /dev/null
-+++ b/test/unistd/tst-posix_fallocate.c
-@@ -0,0 +1,127 @@
-+#include <fcntl.h>
-+#include <sys/stat.h>
-+
-+#ifndef TST_POSIX_FALLOCATE64
-+# define stat64 stat
-+# define fstat64 fstat
-+# else
-+# ifndef O_LARGEFILE
-+# error no O_LARGEFILE but you want to test with LFS enabled
-+# endif
-+#endif
-+
-+static void do_prepare (void);
-+#define PREPARE(argc, argv) do_prepare ()
-+static int do_test (void);
-+#define TEST_FUNCTION do_test ()
-+#include <test-skeleton.c>
-+
-+static int fd;
-+static void
-+do_prepare (void)
-+{
-+ fd = create_temp_file ("tst-posix_fallocate.", NULL);
-+ if (fd == -1)
-+ {
-+ printf ("cannot create temporary file: %m\n");
-+ exit (1);
-+ }
-+}
-+
-+
-+static int
-+do_test (void)
-+{
-+ struct stat64 st;
-+
-+ if (fstat64 (fd, &st) != 0)
-+ {
-+ puts ("1st fstat failed");
-+ return 1;
-+ }
-+
-+ if (st.st_size != 0)
-+ {
-+ puts ("file not created with size 0");
-+ return 1;
-+ }
-+
-+ if (posix_fallocate (fd, 512, 768) != 0)
-+ {
-+ puts ("1st posix_fallocate call failed");
-+ return 1;
-+ }
-+
-+ if (fstat64 (fd, &st) != 0)
-+ {
-+ puts ("2nd fstat failed");
-+ return 1;
-+ }
-+
-+ if (st.st_size != 512 + 768)
-+ {
-+ printf ("file size after 1st posix_fallocate call is %llu, expected %u\n",
-+ (unsigned long long int) st.st_size, 512u + 768u);
-+ return 1;
-+ }
-+
-+ if (posix_fallocate (fd, 0, 1024) != 0)
-+ {
-+ puts ("2nd posix_fallocate call failed");
-+ return 1;
-+ }
-+
-+ if (fstat64 (fd, &st) != 0)
-+ {
-+ puts ("3rd fstat failed");
-+ return 1;
-+ }
-+
-+ if (st.st_size != 512 + 768)
-+ {
-+ puts ("file size changed in 2nd posix_fallocate");
-+ return 1;
-+ }
-+
-+ if (posix_fallocate (fd, 2048, 64) != 0)
-+ {
-+ puts ("3rd posix_fallocate call failed");
-+ return 1;
-+ }
-+
-+ if (fstat64 (fd, &st) != 0)
-+ {
-+ puts ("4th fstat failed");
-+ return 1;
-+ }
-+
-+ if (st.st_size != 2048 + 64)
-+ {
-+ printf ("file size after 3rd posix_fallocate call is %llu, expected %u\n",
-+ (unsigned long long int) st.st_size, 2048u + 64u);
-+ return 1;
-+ }
-+#ifdef TST_POSIX_FALLOCATE64
-+ if (posix_fallocate64 (fd, 4097ULL, 4294967295ULL + 2ULL) != 0)
-+ {
-+ puts ("4th posix_fallocate call failed");
-+ return 1;
-+ }
-+
-+ if (fstat64 (fd, &st) != 0)
-+ {
-+ puts ("5th fstat failed");
-+ return 1;
-+ }
-+
-+ if (st.st_size != 4097ULL + 4294967295ULL + 2ULL)
-+ {
-+ printf ("file size after 4th posix_fallocate call is %llu, expected %llu\n",
-+ (unsigned long long int) st.st_size, 4097ULL + 4294967295ULL + 2ULL);
-+ return 1;
-+ }
-+#endif
-+ close (fd);
-+
-+ return 0;
-+}
-diff --git a/test/unistd/tst-posix_fallocate64.c b/test/unistd/tst-posix_fallocate64.c
-new file mode 100644
-index 0000000..b1ee0ff
---- /dev/null
-+++ b/test/unistd/tst-posix_fallocate64.c
-@@ -0,0 +1,2 @@
-+#define TST_POSIX_FALLOCATE64
-+#include "tst-posix_fallocate.c"
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.i686.hardened/savedconfig/sys-libs/uclibc-0.9.33.2-r3 b/tools-uclibc/portage.i686.hardened/savedconfig/sys-libs/uclibc-0.9.33.2-r4
similarity index 100%
rename from tools-uclibc/portage.i686.hardened/savedconfig/sys-libs/uclibc-0.9.33.2-r3
rename to tools-uclibc/portage.i686.hardened/savedconfig/sys-libs/uclibc-0.9.33.2-r4
diff --git a/tools-uclibc/portage.i686.vanilla/package.accept_keywords/uclibc b/tools-uclibc/portage.i686.vanilla/package.accept_keywords/uclibc
new file mode 100644
index 0000000..c209898
--- /dev/null
+++ b/tools-uclibc/portage.i686.vanilla/package.accept_keywords/uclibc
@@ -0,0 +1 @@
+=sys-libs/uclibc-0.9.33.2-r4 ~x86
diff --git a/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/01_add-posix_fallocate.patch b/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/01_add-posix_fallocate.patch
deleted file mode 100644
index dc7bbd7..0000000
--- a/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/01_add-posix_fallocate.patch
+++ /dev/null
@@ -1,321 +0,0 @@
-From 5643900913f64c00f1c2958914586708efa5a473 Mon Sep 17 00:00:00 2001
-From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Tue, 17 Apr 2012 07:30:15 +0000
-Subject: libc: add posix_fallocate()
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
-diff --git a/include/fcntl.h b/include/fcntl.h
-index ed009dd..c749ad5 100644
---- a/include/fcntl.h
-+++ b/include/fcntl.h
-@@ -217,9 +217,7 @@ extern int posix_fadvise64 (int __fd, __off64_t __offset, __off64_t __len,
-
- #endif
-
--#if 0 /* && defined __UCLIBC_HAS_ADVANCED_REALTIME__ */
--
--/* FIXME -- uClibc should probably implement these... */
-+#if defined __UCLIBC_HAS_ADVANCED_REALTIME__
-
- /* Reserve storage for the data of the file associated with FD.
-
-diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
-index 566722d..29566dd 100644
---- a/libc/sysdeps/linux/common/Makefile.in
-+++ b/libc/sysdeps/linux/common/Makefile.in
-@@ -82,7 +82,8 @@ CSRC-$(UCLIBC_HAS_REALTIME) += clock_getres.c clock_gettime.c clock_settime.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 posix_madvise.c
-+CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c posix_madvise.c \
-+ posix_fallocate.c posix_fallocate64.c
- CSRC-$(UCLIBC_SUSV4_LEGACY) += utime.c
- CSRC-$(UCLIBC_HAS_EPOLL) += epoll.c
- CSRC-$(UCLIBC_HAS_XATTR) += xattr.c
-diff --git a/libc/sysdeps/linux/common/bits/kernel-features.h b/libc/sysdeps/linux/common/bits/kernel-features.h
-index 4d1e0cb..6184c2b 100644
---- a/libc/sysdeps/linux/common/bits/kernel-features.h
-+++ b/libc/sysdeps/linux/common/bits/kernel-features.h
-@@ -495,6 +495,14 @@
- # define __ASSUME_PRIVATE_FUTEX 1
- #endif
-
-+/* Support for fallocate was added in 2.6.23,
-+ on s390 only after 2.6.23-rc1, on alpha only after 2.6.33-rc1. */
-+#if __LINUX_KERNEL_VERSION >= 0x020617 \
-+ && (!defined __s390__ || __LINUX_KERNEL_VERSION >= 0x020618) \
-+ && (!defined __alpha__ || __LINUX_KERNEL_VERSION >= 0x020621)
-+# define __ASSUME_FALLOCATE 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
-diff --git a/libc/sysdeps/linux/common/posix_fallocate.c b/libc/sysdeps/linux/common/posix_fallocate.c
-new file mode 100644
-index 0000000..9aaa6ce
---- /dev/null
-+++ b/libc/sysdeps/linux/common/posix_fallocate.c
-@@ -0,0 +1,43 @@
-+/* vi: set sw=4 ts=4: */
-+/*
-+ * posix_fallocate() for uClibc
-+ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html
-+ *
-+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
-+ *
-+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
-+ */
-+
-+#include <sys/syscall.h>
-+#include <fcntl.h>
-+#include <bits/kernel-features.h>
-+#include <stdint.h>
-+
-+#if defined __NR_fallocate
-+int posix_fallocate(int fd, __off_t offset, __off_t len)
-+{
-+ int ret;
-+
-+# if __WORDSIZE == 32
-+ uint32_t off_low = offset;
-+ uint32_t len_low = len;
-+ /* may assert that these >>31 are 0 */
-+ uint32_t zero = 0;
-+ INTERNAL_SYSCALL_DECL(err);
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
-+ __LONG_LONG_PAIR (zero, off_low),
-+ __LONG_LONG_PAIR (zero, len_low)));
-+# elif __WORDSIZE == 64
-+ INTERNAL_SYSCALL_DECL(err);
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 4, fd, 0, offset, len));
-+# else
-+# error your machine is neither 32 bit or 64 bit ... it must be magical
-+#endif
-+ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
-+ return INTERNAL_SYSCALL_ERRNO (ret, err);
-+ return 0;
-+}
-+# if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64
-+strong_alias(posix_fallocate,posix_fallocate64)
-+# endif
-+#endif
-diff --git a/libc/sysdeps/linux/common/posix_fallocate64.c b/libc/sysdeps/linux/common/posix_fallocate64.c
-new file mode 100644
-index 0000000..818d868
---- /dev/null
-+++ b/libc/sysdeps/linux/common/posix_fallocate64.c
-@@ -0,0 +1,39 @@
-+/* vi: set sw=4 ts=4: */
-+/*
-+ * posix_fallocate() for uClibc
-+ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html
-+ *
-+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
-+ *
-+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
-+ */
-+
-+#include <sys/syscall.h>
-+#include <fcntl.h>
-+#include <bits/kernel-features.h>
-+#include <stdint.h>
-+
-+#if defined __NR_fallocate
-+
-+# if __WORDSIZE == 64
-+/* Can use normal posix_fallocate() */
-+# elif __WORDSIZE == 32
-+int posix_fallocate64(int fd, __off64_t offset, __off64_t len)
-+{
-+ int ret;
-+ uint32_t off_low = offset & 0xffffffff;
-+ uint32_t off_high = offset >> 32;
-+ uint32_t len_low = len & 0xffffffff;
-+ uint32_t len_high = len >> 32;
-+ INTERNAL_SYSCALL_DECL(err);
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
-+ __LONG_LONG_PAIR (off_high, off_low),
-+ __LONG_LONG_PAIR (len_high, len_low)));
-+ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
-+ return INTERNAL_SYSCALL_ERRNO (ret, err);
-+ return 0;
-+}
-+# else
-+# error your machine is neither 32 bit or 64 bit ... it must be magical
-+# endif
-+#endif
-diff --git a/test/.gitignore b/test/.gitignore
-index c068f89..ec04628 100644
---- a/test/.gitignore
-+++ b/test/.gitignore
-@@ -319,6 +319,8 @@ unistd/getcwd
- unistd/getopt
- unistd/getopt_long
- unistd/tstgetopt
-+unistd/tst-posix_fallocate
-+unistd/tst-posix_fallocate64
- unistd/tst-preadwrite
- unistd/tst-preadwrite64
- unistd/vfork
-diff --git a/test/unistd/Makefile.in b/test/unistd/Makefile.in
-index c542f98..24b9a37 100644
---- a/test/unistd/Makefile.in
-+++ b/test/unistd/Makefile.in
-@@ -2,7 +2,10 @@
- # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
-
- ifeq ($(UCLIBC_HAS_LFS),)
--TESTS_DISABLED := tst-preadwrite64
-+TESTS_DISABLED := tst-preadwrite64 tst-posix_fallocate64
-+endif
-+ifeq ($(UCLIBC_HAS_ADVANCED_REALTIME),)
-+TESTS_DISABLED := tst-posix_fallocate
- endif
- OPTS_getopt := -abcXXX -9
- OPTS_getopt_long := --add XXX --delete YYY --verbose
-diff --git a/test/unistd/tst-posix_fallocate.c b/test/unistd/tst-posix_fallocate.c
-new file mode 100644
-index 0000000..d41c604
---- /dev/null
-+++ b/test/unistd/tst-posix_fallocate.c
-@@ -0,0 +1,127 @@
-+#include <fcntl.h>
-+#include <sys/stat.h>
-+
-+#ifndef TST_POSIX_FALLOCATE64
-+# define stat64 stat
-+# define fstat64 fstat
-+# else
-+# ifndef O_LARGEFILE
-+# error no O_LARGEFILE but you want to test with LFS enabled
-+# endif
-+#endif
-+
-+static void do_prepare (void);
-+#define PREPARE(argc, argv) do_prepare ()
-+static int do_test (void);
-+#define TEST_FUNCTION do_test ()
-+#include <test-skeleton.c>
-+
-+static int fd;
-+static void
-+do_prepare (void)
-+{
-+ fd = create_temp_file ("tst-posix_fallocate.", NULL);
-+ if (fd == -1)
-+ {
-+ printf ("cannot create temporary file: %m\n");
-+ exit (1);
-+ }
-+}
-+
-+
-+static int
-+do_test (void)
-+{
-+ struct stat64 st;
-+
-+ if (fstat64 (fd, &st) != 0)
-+ {
-+ puts ("1st fstat failed");
-+ return 1;
-+ }
-+
-+ if (st.st_size != 0)
-+ {
-+ puts ("file not created with size 0");
-+ return 1;
-+ }
-+
-+ if (posix_fallocate (fd, 512, 768) != 0)
-+ {
-+ puts ("1st posix_fallocate call failed");
-+ return 1;
-+ }
-+
-+ if (fstat64 (fd, &st) != 0)
-+ {
-+ puts ("2nd fstat failed");
-+ return 1;
-+ }
-+
-+ if (st.st_size != 512 + 768)
-+ {
-+ printf ("file size after 1st posix_fallocate call is %llu, expected %u\n",
-+ (unsigned long long int) st.st_size, 512u + 768u);
-+ return 1;
-+ }
-+
-+ if (posix_fallocate (fd, 0, 1024) != 0)
-+ {
-+ puts ("2nd posix_fallocate call failed");
-+ return 1;
-+ }
-+
-+ if (fstat64 (fd, &st) != 0)
-+ {
-+ puts ("3rd fstat failed");
-+ return 1;
-+ }
-+
-+ if (st.st_size != 512 + 768)
-+ {
-+ puts ("file size changed in 2nd posix_fallocate");
-+ return 1;
-+ }
-+
-+ if (posix_fallocate (fd, 2048, 64) != 0)
-+ {
-+ puts ("3rd posix_fallocate call failed");
-+ return 1;
-+ }
-+
-+ if (fstat64 (fd, &st) != 0)
-+ {
-+ puts ("4th fstat failed");
-+ return 1;
-+ }
-+
-+ if (st.st_size != 2048 + 64)
-+ {
-+ printf ("file size after 3rd posix_fallocate call is %llu, expected %u\n",
-+ (unsigned long long int) st.st_size, 2048u + 64u);
-+ return 1;
-+ }
-+#ifdef TST_POSIX_FALLOCATE64
-+ if (posix_fallocate64 (fd, 4097ULL, 4294967295ULL + 2ULL) != 0)
-+ {
-+ puts ("4th posix_fallocate call failed");
-+ return 1;
-+ }
-+
-+ if (fstat64 (fd, &st) != 0)
-+ {
-+ puts ("5th fstat failed");
-+ return 1;
-+ }
-+
-+ if (st.st_size != 4097ULL + 4294967295ULL + 2ULL)
-+ {
-+ printf ("file size after 4th posix_fallocate call is %llu, expected %llu\n",
-+ (unsigned long long int) st.st_size, 4097ULL + 4294967295ULL + 2ULL);
-+ return 1;
-+ }
-+#endif
-+ close (fd);
-+
-+ return 0;
-+}
-diff --git a/test/unistd/tst-posix_fallocate64.c b/test/unistd/tst-posix_fallocate64.c
-new file mode 100644
-index 0000000..b1ee0ff
---- /dev/null
-+++ b/test/unistd/tst-posix_fallocate64.c
-@@ -0,0 +1,2 @@
-+#define TST_POSIX_FALLOCATE64
-+#include "tst-posix_fallocate.c"
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.i686.vanilla/savedconfig/sys-libs/uclibc-0.9.33.2-r3 b/tools-uclibc/portage.i686.vanilla/savedconfig/sys-libs/uclibc-0.9.33.2-r4
similarity index 100%
rename from tools-uclibc/portage.i686.vanilla/savedconfig/sys-libs/uclibc-0.9.33.2-r3
rename to tools-uclibc/portage.i686.vanilla/savedconfig/sys-libs/uclibc-0.9.33.2-r4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] proj/releng:master commit in: tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/, ...
@ 2013-12-20 18:58 Anthony G. Basile
0 siblings, 0 replies; 7+ messages in thread
From: Anthony G. Basile @ 2013-12-20 18:58 UTC (permalink / raw
To: gentoo-commits
commit: 8070e15b3ffd13abcfc3b05e12a1f06b5798433f
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 20 18:58:52 2013 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Fri Dec 20 18:58:52 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/releng.git;a=commit;h=8070e15b
tools-uclibc: backport add-isfdtype and pread_pwrite-backport to uclibc
---
.../sys-libs/uclibc/02-libc-add-isfdtype.patch | 65 +++++++
.../sys-libs/uclibc/03-pread_pwrite-backport.patch | 215 +++++++++++++++++++++
.../sys-libs/uclibc/02-libc-add-isfdtype.patch | 65 +++++++
.../sys-libs/uclibc/03-pread_pwrite-backport.patch | 215 +++++++++++++++++++++
.../sys-libs/uclibc/02-libc-add-isfdtype.patch | 65 +++++++
.../sys-libs/uclibc/03-pread_pwrite-backport.patch | 215 +++++++++++++++++++++
.../sys-libs/uclibc/02-libc-add-isfdtype.patch | 65 +++++++
.../sys-libs/uclibc/03-pread_pwrite-backport.patch | 215 +++++++++++++++++++++
.../sys-libs/uclibc/02-libc-add-isfdtype.patch | 65 +++++++
.../sys-libs/uclibc/03-pread_pwrite-backport.patch | 215 +++++++++++++++++++++
.../sys-libs/uclibc/02-libc-add-isfdtype.patch | 65 +++++++
.../sys-libs/uclibc/03-pread_pwrite-backport.patch | 215 +++++++++++++++++++++
.../sys-libs/uclibc/02-libc-add-isfdtype.patch | 65 +++++++
.../sys-libs/uclibc/03-pread_pwrite-backport.patch | 215 +++++++++++++++++++++
.../sys-libs/uclibc/02-libc-add-isfdtype.patch | 65 +++++++
.../sys-libs/uclibc/03-pread_pwrite-backport.patch | 215 +++++++++++++++++++++
.../sys-libs/uclibc/02-libc-add-isfdtype.patch | 65 +++++++
.../sys-libs/uclibc/03-pread_pwrite-backport.patch | 215 +++++++++++++++++++++
.../sys-libs/uclibc/02-libc-add-isfdtype.patch | 65 +++++++
.../sys-libs/uclibc/03-pread_pwrite-backport.patch | 215 +++++++++++++++++++++
20 files changed, 2800 insertions(+)
diff --git a/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch b/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
new file mode 100644
index 0000000..007ec33
--- /dev/null
+++ b/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
@@ -0,0 +1,65 @@
+From f22cca4722fa66e424562e69f4afa2bca0af871d Mon Sep 17 00:00:00 2001
+From: "Anthony G. Basile" <blueness@gentoo.org>
+Date: Sun, 28 Jul 2013 09:08:34 -0400
+Subject: [PATCH] libc: add isfdtype()
+
+isfdtype(int fd, int fdtype) check whether a file descriptor fd is
+of type fdtype, where the types are defined in stat(2). It is
+supported in glibc and BSD, and used by utilities such as acpid.
+
+Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+ libc/misc/file/isfdtype.c | 40 ++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 40 insertions(+)
+ create mode 100644 libc/misc/file/isfdtype.c
+
+diff --git a/libc/misc/file/isfdtype.c b/libc/misc/file/isfdtype.c
+new file mode 100644
+index 0000000..4d9199b
+--- /dev/null
++++ libc/misc/file/isfdtype.c
+@@ -0,0 +1,40 @@
++/* Determine whether descriptor has given property.
++ Copyright (C) 1996-2013 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/>. */
++
++#include <errno.h>
++#include <sys/stat.h>
++#include <sys/socket.h>
++#include <sys/types.h>
++#ifdef __UCLIBC_HAS_LFS__
++# include <_lfs_64.h>
++#else
++# define stat64 stat
++# define fstat64 fstat
++#endif
++
++int
++isfdtype (int fildes, int fdtype)
++{
++ struct stat64 st;
++ int save_error = errno;
++ int result = fstat64 (fildes, &st);
++ __set_errno (save_error);
++ if (result)
++ return result;
++ return (st.st_mode & S_IFMT) == (mode_t) fdtype;
++}
+--
+1.8.3.2.733.gf8abaeb
+
diff --git a/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch b/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
new file mode 100644
index 0000000..7ea9486
--- /dev/null
+++ b/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
@@ -0,0 +1,215 @@
+From 342a3d861fde5651ee53486addbacddcec6a0a58 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <natanael.copa@gmail.com>
+Date: Sat, 04 Aug 2012 17:32:45 +0000
+Subject: pread/pwrite: backport fix
+
+pread/pwrite syscalls has been renamed to pread64/pwrite in 2.6 kernel.
+
+There was a fallback function using lseek for kernels who did not have
+this syscall (pre 2.1.60). This is broken in many ways.
+
+uclibc have been using the broken fallback due to they forgot to rename
+pread syscall.
+
+This got detected with git-1.7.11 which introduced threaded index-pack
+which broke in similar ways a windows (msys).
+
+This issue in uclibc have been reported upstream and fixed in git master
+so this patch does not need to be upstreamed. It might be an idea to
+backport it properly for 0.9.33 branch though.
+
+Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
+index 88e6957..baf8691 100644
+--- a/libc/sysdeps/linux/common/pread_write.c
++++ b/libc/sysdeps/linux/common/pread_write.c
+@@ -17,6 +17,7 @@
+ #include <unistd.h>
+ #include <stdint.h>
+ #include <endian.h>
++#include <sysdep-cancel.h>
+
+ extern __typeof(pread) __libc_pread;
+ extern __typeof(pwrite) __libc_pwrite;
+@@ -27,15 +28,17 @@ extern __typeof(pwrite64) __libc_pwrite64;
+
+ #include <bits/kernel_types.h>
+
+-#ifdef __NR_pread
+-
+-# define __NR___syscall_pread __NR_pread
++# define __NR___syscall_pread __NR_pread64
+ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
++
+ }
+ weak_alias(__libc_pread,pread)
+
+@@ -44,22 +47,24 @@ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
+ }
+ weak_alias(__libc_pread64,pread64)
+ # endif /* __UCLIBC_HAS_LFS__ */
+
+-#endif /* __NR_pread */
+-
+-#ifdef __NR_pwrite
+-
+-# define __NR___syscall_pwrite __NR_pwrite
++# define __NR___syscall_pwrite __NR_pwrite64
+ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
+ }
+ weak_alias(__libc_pwrite,pwrite)
+
+@@ -68,120 +73,10 @@ 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);
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low));
++ LIBC_CANCEL_RESET (oldtype);
+ 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 */
+--
+cgit v0.9.1
diff --git a/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch b/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
new file mode 100644
index 0000000..007ec33
--- /dev/null
+++ b/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
@@ -0,0 +1,65 @@
+From f22cca4722fa66e424562e69f4afa2bca0af871d Mon Sep 17 00:00:00 2001
+From: "Anthony G. Basile" <blueness@gentoo.org>
+Date: Sun, 28 Jul 2013 09:08:34 -0400
+Subject: [PATCH] libc: add isfdtype()
+
+isfdtype(int fd, int fdtype) check whether a file descriptor fd is
+of type fdtype, where the types are defined in stat(2). It is
+supported in glibc and BSD, and used by utilities such as acpid.
+
+Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+ libc/misc/file/isfdtype.c | 40 ++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 40 insertions(+)
+ create mode 100644 libc/misc/file/isfdtype.c
+
+diff --git a/libc/misc/file/isfdtype.c b/libc/misc/file/isfdtype.c
+new file mode 100644
+index 0000000..4d9199b
+--- /dev/null
++++ libc/misc/file/isfdtype.c
+@@ -0,0 +1,40 @@
++/* Determine whether descriptor has given property.
++ Copyright (C) 1996-2013 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/>. */
++
++#include <errno.h>
++#include <sys/stat.h>
++#include <sys/socket.h>
++#include <sys/types.h>
++#ifdef __UCLIBC_HAS_LFS__
++# include <_lfs_64.h>
++#else
++# define stat64 stat
++# define fstat64 fstat
++#endif
++
++int
++isfdtype (int fildes, int fdtype)
++{
++ struct stat64 st;
++ int save_error = errno;
++ int result = fstat64 (fildes, &st);
++ __set_errno (save_error);
++ if (result)
++ return result;
++ return (st.st_mode & S_IFMT) == (mode_t) fdtype;
++}
+--
+1.8.3.2.733.gf8abaeb
+
diff --git a/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch b/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
new file mode 100644
index 0000000..7ea9486
--- /dev/null
+++ b/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
@@ -0,0 +1,215 @@
+From 342a3d861fde5651ee53486addbacddcec6a0a58 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <natanael.copa@gmail.com>
+Date: Sat, 04 Aug 2012 17:32:45 +0000
+Subject: pread/pwrite: backport fix
+
+pread/pwrite syscalls has been renamed to pread64/pwrite in 2.6 kernel.
+
+There was a fallback function using lseek for kernels who did not have
+this syscall (pre 2.1.60). This is broken in many ways.
+
+uclibc have been using the broken fallback due to they forgot to rename
+pread syscall.
+
+This got detected with git-1.7.11 which introduced threaded index-pack
+which broke in similar ways a windows (msys).
+
+This issue in uclibc have been reported upstream and fixed in git master
+so this patch does not need to be upstreamed. It might be an idea to
+backport it properly for 0.9.33 branch though.
+
+Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
+index 88e6957..baf8691 100644
+--- a/libc/sysdeps/linux/common/pread_write.c
++++ b/libc/sysdeps/linux/common/pread_write.c
+@@ -17,6 +17,7 @@
+ #include <unistd.h>
+ #include <stdint.h>
+ #include <endian.h>
++#include <sysdep-cancel.h>
+
+ extern __typeof(pread) __libc_pread;
+ extern __typeof(pwrite) __libc_pwrite;
+@@ -27,15 +28,17 @@ extern __typeof(pwrite64) __libc_pwrite64;
+
+ #include <bits/kernel_types.h>
+
+-#ifdef __NR_pread
+-
+-# define __NR___syscall_pread __NR_pread
++# define __NR___syscall_pread __NR_pread64
+ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
++
+ }
+ weak_alias(__libc_pread,pread)
+
+@@ -44,22 +47,24 @@ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
+ }
+ weak_alias(__libc_pread64,pread64)
+ # endif /* __UCLIBC_HAS_LFS__ */
+
+-#endif /* __NR_pread */
+-
+-#ifdef __NR_pwrite
+-
+-# define __NR___syscall_pwrite __NR_pwrite
++# define __NR___syscall_pwrite __NR_pwrite64
+ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
+ }
+ weak_alias(__libc_pwrite,pwrite)
+
+@@ -68,120 +73,10 @@ 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);
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low));
++ LIBC_CANCEL_RESET (oldtype);
+ 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 */
+--
+cgit v0.9.1
diff --git a/tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch b/tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
new file mode 100644
index 0000000..007ec33
--- /dev/null
+++ b/tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
@@ -0,0 +1,65 @@
+From f22cca4722fa66e424562e69f4afa2bca0af871d Mon Sep 17 00:00:00 2001
+From: "Anthony G. Basile" <blueness@gentoo.org>
+Date: Sun, 28 Jul 2013 09:08:34 -0400
+Subject: [PATCH] libc: add isfdtype()
+
+isfdtype(int fd, int fdtype) check whether a file descriptor fd is
+of type fdtype, where the types are defined in stat(2). It is
+supported in glibc and BSD, and used by utilities such as acpid.
+
+Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+ libc/misc/file/isfdtype.c | 40 ++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 40 insertions(+)
+ create mode 100644 libc/misc/file/isfdtype.c
+
+diff --git a/libc/misc/file/isfdtype.c b/libc/misc/file/isfdtype.c
+new file mode 100644
+index 0000000..4d9199b
+--- /dev/null
++++ libc/misc/file/isfdtype.c
+@@ -0,0 +1,40 @@
++/* Determine whether descriptor has given property.
++ Copyright (C) 1996-2013 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/>. */
++
++#include <errno.h>
++#include <sys/stat.h>
++#include <sys/socket.h>
++#include <sys/types.h>
++#ifdef __UCLIBC_HAS_LFS__
++# include <_lfs_64.h>
++#else
++# define stat64 stat
++# define fstat64 fstat
++#endif
++
++int
++isfdtype (int fildes, int fdtype)
++{
++ struct stat64 st;
++ int save_error = errno;
++ int result = fstat64 (fildes, &st);
++ __set_errno (save_error);
++ if (result)
++ return result;
++ return (st.st_mode & S_IFMT) == (mode_t) fdtype;
++}
+--
+1.8.3.2.733.gf8abaeb
+
diff --git a/tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch b/tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
new file mode 100644
index 0000000..7ea9486
--- /dev/null
+++ b/tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
@@ -0,0 +1,215 @@
+From 342a3d861fde5651ee53486addbacddcec6a0a58 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <natanael.copa@gmail.com>
+Date: Sat, 04 Aug 2012 17:32:45 +0000
+Subject: pread/pwrite: backport fix
+
+pread/pwrite syscalls has been renamed to pread64/pwrite in 2.6 kernel.
+
+There was a fallback function using lseek for kernels who did not have
+this syscall (pre 2.1.60). This is broken in many ways.
+
+uclibc have been using the broken fallback due to they forgot to rename
+pread syscall.
+
+This got detected with git-1.7.11 which introduced threaded index-pack
+which broke in similar ways a windows (msys).
+
+This issue in uclibc have been reported upstream and fixed in git master
+so this patch does not need to be upstreamed. It might be an idea to
+backport it properly for 0.9.33 branch though.
+
+Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
+index 88e6957..baf8691 100644
+--- a/libc/sysdeps/linux/common/pread_write.c
++++ b/libc/sysdeps/linux/common/pread_write.c
+@@ -17,6 +17,7 @@
+ #include <unistd.h>
+ #include <stdint.h>
+ #include <endian.h>
++#include <sysdep-cancel.h>
+
+ extern __typeof(pread) __libc_pread;
+ extern __typeof(pwrite) __libc_pwrite;
+@@ -27,15 +28,17 @@ extern __typeof(pwrite64) __libc_pwrite64;
+
+ #include <bits/kernel_types.h>
+
+-#ifdef __NR_pread
+-
+-# define __NR___syscall_pread __NR_pread
++# define __NR___syscall_pread __NR_pread64
+ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
++
+ }
+ weak_alias(__libc_pread,pread)
+
+@@ -44,22 +47,24 @@ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
+ }
+ weak_alias(__libc_pread64,pread64)
+ # endif /* __UCLIBC_HAS_LFS__ */
+
+-#endif /* __NR_pread */
+-
+-#ifdef __NR_pwrite
+-
+-# define __NR___syscall_pwrite __NR_pwrite
++# define __NR___syscall_pwrite __NR_pwrite64
+ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
+ }
+ weak_alias(__libc_pwrite,pwrite)
+
+@@ -68,120 +73,10 @@ 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);
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low));
++ LIBC_CANCEL_RESET (oldtype);
+ 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 */
+--
+cgit v0.9.1
diff --git a/tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch b/tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
new file mode 100644
index 0000000..007ec33
--- /dev/null
+++ b/tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
@@ -0,0 +1,65 @@
+From f22cca4722fa66e424562e69f4afa2bca0af871d Mon Sep 17 00:00:00 2001
+From: "Anthony G. Basile" <blueness@gentoo.org>
+Date: Sun, 28 Jul 2013 09:08:34 -0400
+Subject: [PATCH] libc: add isfdtype()
+
+isfdtype(int fd, int fdtype) check whether a file descriptor fd is
+of type fdtype, where the types are defined in stat(2). It is
+supported in glibc and BSD, and used by utilities such as acpid.
+
+Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+ libc/misc/file/isfdtype.c | 40 ++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 40 insertions(+)
+ create mode 100644 libc/misc/file/isfdtype.c
+
+diff --git a/libc/misc/file/isfdtype.c b/libc/misc/file/isfdtype.c
+new file mode 100644
+index 0000000..4d9199b
+--- /dev/null
++++ libc/misc/file/isfdtype.c
+@@ -0,0 +1,40 @@
++/* Determine whether descriptor has given property.
++ Copyright (C) 1996-2013 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/>. */
++
++#include <errno.h>
++#include <sys/stat.h>
++#include <sys/socket.h>
++#include <sys/types.h>
++#ifdef __UCLIBC_HAS_LFS__
++# include <_lfs_64.h>
++#else
++# define stat64 stat
++# define fstat64 fstat
++#endif
++
++int
++isfdtype (int fildes, int fdtype)
++{
++ struct stat64 st;
++ int save_error = errno;
++ int result = fstat64 (fildes, &st);
++ __set_errno (save_error);
++ if (result)
++ return result;
++ return (st.st_mode & S_IFMT) == (mode_t) fdtype;
++}
+--
+1.8.3.2.733.gf8abaeb
+
diff --git a/tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch b/tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
new file mode 100644
index 0000000..7ea9486
--- /dev/null
+++ b/tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
@@ -0,0 +1,215 @@
+From 342a3d861fde5651ee53486addbacddcec6a0a58 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <natanael.copa@gmail.com>
+Date: Sat, 04 Aug 2012 17:32:45 +0000
+Subject: pread/pwrite: backport fix
+
+pread/pwrite syscalls has been renamed to pread64/pwrite in 2.6 kernel.
+
+There was a fallback function using lseek for kernels who did not have
+this syscall (pre 2.1.60). This is broken in many ways.
+
+uclibc have been using the broken fallback due to they forgot to rename
+pread syscall.
+
+This got detected with git-1.7.11 which introduced threaded index-pack
+which broke in similar ways a windows (msys).
+
+This issue in uclibc have been reported upstream and fixed in git master
+so this patch does not need to be upstreamed. It might be an idea to
+backport it properly for 0.9.33 branch though.
+
+Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
+index 88e6957..baf8691 100644
+--- a/libc/sysdeps/linux/common/pread_write.c
++++ b/libc/sysdeps/linux/common/pread_write.c
+@@ -17,6 +17,7 @@
+ #include <unistd.h>
+ #include <stdint.h>
+ #include <endian.h>
++#include <sysdep-cancel.h>
+
+ extern __typeof(pread) __libc_pread;
+ extern __typeof(pwrite) __libc_pwrite;
+@@ -27,15 +28,17 @@ extern __typeof(pwrite64) __libc_pwrite64;
+
+ #include <bits/kernel_types.h>
+
+-#ifdef __NR_pread
+-
+-# define __NR___syscall_pread __NR_pread
++# define __NR___syscall_pread __NR_pread64
+ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
++
+ }
+ weak_alias(__libc_pread,pread)
+
+@@ -44,22 +47,24 @@ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
+ }
+ weak_alias(__libc_pread64,pread64)
+ # endif /* __UCLIBC_HAS_LFS__ */
+
+-#endif /* __NR_pread */
+-
+-#ifdef __NR_pwrite
+-
+-# define __NR___syscall_pwrite __NR_pwrite
++# define __NR___syscall_pwrite __NR_pwrite64
+ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
+ }
+ weak_alias(__libc_pwrite,pwrite)
+
+@@ -68,120 +73,10 @@ 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);
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low));
++ LIBC_CANCEL_RESET (oldtype);
+ 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 */
+--
+cgit v0.9.1
diff --git a/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch b/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
new file mode 100644
index 0000000..007ec33
--- /dev/null
+++ b/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
@@ -0,0 +1,65 @@
+From f22cca4722fa66e424562e69f4afa2bca0af871d Mon Sep 17 00:00:00 2001
+From: "Anthony G. Basile" <blueness@gentoo.org>
+Date: Sun, 28 Jul 2013 09:08:34 -0400
+Subject: [PATCH] libc: add isfdtype()
+
+isfdtype(int fd, int fdtype) check whether a file descriptor fd is
+of type fdtype, where the types are defined in stat(2). It is
+supported in glibc and BSD, and used by utilities such as acpid.
+
+Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+ libc/misc/file/isfdtype.c | 40 ++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 40 insertions(+)
+ create mode 100644 libc/misc/file/isfdtype.c
+
+diff --git a/libc/misc/file/isfdtype.c b/libc/misc/file/isfdtype.c
+new file mode 100644
+index 0000000..4d9199b
+--- /dev/null
++++ libc/misc/file/isfdtype.c
+@@ -0,0 +1,40 @@
++/* Determine whether descriptor has given property.
++ Copyright (C) 1996-2013 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/>. */
++
++#include <errno.h>
++#include <sys/stat.h>
++#include <sys/socket.h>
++#include <sys/types.h>
++#ifdef __UCLIBC_HAS_LFS__
++# include <_lfs_64.h>
++#else
++# define stat64 stat
++# define fstat64 fstat
++#endif
++
++int
++isfdtype (int fildes, int fdtype)
++{
++ struct stat64 st;
++ int save_error = errno;
++ int result = fstat64 (fildes, &st);
++ __set_errno (save_error);
++ if (result)
++ return result;
++ return (st.st_mode & S_IFMT) == (mode_t) fdtype;
++}
+--
+1.8.3.2.733.gf8abaeb
+
diff --git a/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch b/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
new file mode 100644
index 0000000..7ea9486
--- /dev/null
+++ b/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
@@ -0,0 +1,215 @@
+From 342a3d861fde5651ee53486addbacddcec6a0a58 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <natanael.copa@gmail.com>
+Date: Sat, 04 Aug 2012 17:32:45 +0000
+Subject: pread/pwrite: backport fix
+
+pread/pwrite syscalls has been renamed to pread64/pwrite in 2.6 kernel.
+
+There was a fallback function using lseek for kernels who did not have
+this syscall (pre 2.1.60). This is broken in many ways.
+
+uclibc have been using the broken fallback due to they forgot to rename
+pread syscall.
+
+This got detected with git-1.7.11 which introduced threaded index-pack
+which broke in similar ways a windows (msys).
+
+This issue in uclibc have been reported upstream and fixed in git master
+so this patch does not need to be upstreamed. It might be an idea to
+backport it properly for 0.9.33 branch though.
+
+Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
+index 88e6957..baf8691 100644
+--- a/libc/sysdeps/linux/common/pread_write.c
++++ b/libc/sysdeps/linux/common/pread_write.c
+@@ -17,6 +17,7 @@
+ #include <unistd.h>
+ #include <stdint.h>
+ #include <endian.h>
++#include <sysdep-cancel.h>
+
+ extern __typeof(pread) __libc_pread;
+ extern __typeof(pwrite) __libc_pwrite;
+@@ -27,15 +28,17 @@ extern __typeof(pwrite64) __libc_pwrite64;
+
+ #include <bits/kernel_types.h>
+
+-#ifdef __NR_pread
+-
+-# define __NR___syscall_pread __NR_pread
++# define __NR___syscall_pread __NR_pread64
+ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
++
+ }
+ weak_alias(__libc_pread,pread)
+
+@@ -44,22 +47,24 @@ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
+ }
+ weak_alias(__libc_pread64,pread64)
+ # endif /* __UCLIBC_HAS_LFS__ */
+
+-#endif /* __NR_pread */
+-
+-#ifdef __NR_pwrite
+-
+-# define __NR___syscall_pwrite __NR_pwrite
++# define __NR___syscall_pwrite __NR_pwrite64
+ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
+ }
+ weak_alias(__libc_pwrite,pwrite)
+
+@@ -68,120 +73,10 @@ 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);
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low));
++ LIBC_CANCEL_RESET (oldtype);
+ 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 */
+--
+cgit v0.9.1
diff --git a/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch b/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
new file mode 100644
index 0000000..007ec33
--- /dev/null
+++ b/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
@@ -0,0 +1,65 @@
+From f22cca4722fa66e424562e69f4afa2bca0af871d Mon Sep 17 00:00:00 2001
+From: "Anthony G. Basile" <blueness@gentoo.org>
+Date: Sun, 28 Jul 2013 09:08:34 -0400
+Subject: [PATCH] libc: add isfdtype()
+
+isfdtype(int fd, int fdtype) check whether a file descriptor fd is
+of type fdtype, where the types are defined in stat(2). It is
+supported in glibc and BSD, and used by utilities such as acpid.
+
+Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+ libc/misc/file/isfdtype.c | 40 ++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 40 insertions(+)
+ create mode 100644 libc/misc/file/isfdtype.c
+
+diff --git a/libc/misc/file/isfdtype.c b/libc/misc/file/isfdtype.c
+new file mode 100644
+index 0000000..4d9199b
+--- /dev/null
++++ libc/misc/file/isfdtype.c
+@@ -0,0 +1,40 @@
++/* Determine whether descriptor has given property.
++ Copyright (C) 1996-2013 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/>. */
++
++#include <errno.h>
++#include <sys/stat.h>
++#include <sys/socket.h>
++#include <sys/types.h>
++#ifdef __UCLIBC_HAS_LFS__
++# include <_lfs_64.h>
++#else
++# define stat64 stat
++# define fstat64 fstat
++#endif
++
++int
++isfdtype (int fildes, int fdtype)
++{
++ struct stat64 st;
++ int save_error = errno;
++ int result = fstat64 (fildes, &st);
++ __set_errno (save_error);
++ if (result)
++ return result;
++ return (st.st_mode & S_IFMT) == (mode_t) fdtype;
++}
+--
+1.8.3.2.733.gf8abaeb
+
diff --git a/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch b/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
new file mode 100644
index 0000000..7ea9486
--- /dev/null
+++ b/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
@@ -0,0 +1,215 @@
+From 342a3d861fde5651ee53486addbacddcec6a0a58 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <natanael.copa@gmail.com>
+Date: Sat, 04 Aug 2012 17:32:45 +0000
+Subject: pread/pwrite: backport fix
+
+pread/pwrite syscalls has been renamed to pread64/pwrite in 2.6 kernel.
+
+There was a fallback function using lseek for kernels who did not have
+this syscall (pre 2.1.60). This is broken in many ways.
+
+uclibc have been using the broken fallback due to they forgot to rename
+pread syscall.
+
+This got detected with git-1.7.11 which introduced threaded index-pack
+which broke in similar ways a windows (msys).
+
+This issue in uclibc have been reported upstream and fixed in git master
+so this patch does not need to be upstreamed. It might be an idea to
+backport it properly for 0.9.33 branch though.
+
+Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
+index 88e6957..baf8691 100644
+--- a/libc/sysdeps/linux/common/pread_write.c
++++ b/libc/sysdeps/linux/common/pread_write.c
+@@ -17,6 +17,7 @@
+ #include <unistd.h>
+ #include <stdint.h>
+ #include <endian.h>
++#include <sysdep-cancel.h>
+
+ extern __typeof(pread) __libc_pread;
+ extern __typeof(pwrite) __libc_pwrite;
+@@ -27,15 +28,17 @@ extern __typeof(pwrite64) __libc_pwrite64;
+
+ #include <bits/kernel_types.h>
+
+-#ifdef __NR_pread
+-
+-# define __NR___syscall_pread __NR_pread
++# define __NR___syscall_pread __NR_pread64
+ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
++
+ }
+ weak_alias(__libc_pread,pread)
+
+@@ -44,22 +47,24 @@ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
+ }
+ weak_alias(__libc_pread64,pread64)
+ # endif /* __UCLIBC_HAS_LFS__ */
+
+-#endif /* __NR_pread */
+-
+-#ifdef __NR_pwrite
+-
+-# define __NR___syscall_pwrite __NR_pwrite
++# define __NR___syscall_pwrite __NR_pwrite64
+ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
+ }
+ weak_alias(__libc_pwrite,pwrite)
+
+@@ -68,120 +73,10 @@ 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);
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low));
++ LIBC_CANCEL_RESET (oldtype);
+ 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 */
+--
+cgit v0.9.1
diff --git a/tools-uclibc/portage.mips32r2.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch b/tools-uclibc/portage.mips32r2.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
new file mode 100644
index 0000000..007ec33
--- /dev/null
+++ b/tools-uclibc/portage.mips32r2.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
@@ -0,0 +1,65 @@
+From f22cca4722fa66e424562e69f4afa2bca0af871d Mon Sep 17 00:00:00 2001
+From: "Anthony G. Basile" <blueness@gentoo.org>
+Date: Sun, 28 Jul 2013 09:08:34 -0400
+Subject: [PATCH] libc: add isfdtype()
+
+isfdtype(int fd, int fdtype) check whether a file descriptor fd is
+of type fdtype, where the types are defined in stat(2). It is
+supported in glibc and BSD, and used by utilities such as acpid.
+
+Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+ libc/misc/file/isfdtype.c | 40 ++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 40 insertions(+)
+ create mode 100644 libc/misc/file/isfdtype.c
+
+diff --git a/libc/misc/file/isfdtype.c b/libc/misc/file/isfdtype.c
+new file mode 100644
+index 0000000..4d9199b
+--- /dev/null
++++ libc/misc/file/isfdtype.c
+@@ -0,0 +1,40 @@
++/* Determine whether descriptor has given property.
++ Copyright (C) 1996-2013 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/>. */
++
++#include <errno.h>
++#include <sys/stat.h>
++#include <sys/socket.h>
++#include <sys/types.h>
++#ifdef __UCLIBC_HAS_LFS__
++# include <_lfs_64.h>
++#else
++# define stat64 stat
++# define fstat64 fstat
++#endif
++
++int
++isfdtype (int fildes, int fdtype)
++{
++ struct stat64 st;
++ int save_error = errno;
++ int result = fstat64 (fildes, &st);
++ __set_errno (save_error);
++ if (result)
++ return result;
++ return (st.st_mode & S_IFMT) == (mode_t) fdtype;
++}
+--
+1.8.3.2.733.gf8abaeb
+
diff --git a/tools-uclibc/portage.mips32r2.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch b/tools-uclibc/portage.mips32r2.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
new file mode 100644
index 0000000..7ea9486
--- /dev/null
+++ b/tools-uclibc/portage.mips32r2.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
@@ -0,0 +1,215 @@
+From 342a3d861fde5651ee53486addbacddcec6a0a58 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <natanael.copa@gmail.com>
+Date: Sat, 04 Aug 2012 17:32:45 +0000
+Subject: pread/pwrite: backport fix
+
+pread/pwrite syscalls has been renamed to pread64/pwrite in 2.6 kernel.
+
+There was a fallback function using lseek for kernels who did not have
+this syscall (pre 2.1.60). This is broken in many ways.
+
+uclibc have been using the broken fallback due to they forgot to rename
+pread syscall.
+
+This got detected with git-1.7.11 which introduced threaded index-pack
+which broke in similar ways a windows (msys).
+
+This issue in uclibc have been reported upstream and fixed in git master
+so this patch does not need to be upstreamed. It might be an idea to
+backport it properly for 0.9.33 branch though.
+
+Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
+index 88e6957..baf8691 100644
+--- a/libc/sysdeps/linux/common/pread_write.c
++++ b/libc/sysdeps/linux/common/pread_write.c
+@@ -17,6 +17,7 @@
+ #include <unistd.h>
+ #include <stdint.h>
+ #include <endian.h>
++#include <sysdep-cancel.h>
+
+ extern __typeof(pread) __libc_pread;
+ extern __typeof(pwrite) __libc_pwrite;
+@@ -27,15 +28,17 @@ extern __typeof(pwrite64) __libc_pwrite64;
+
+ #include <bits/kernel_types.h>
+
+-#ifdef __NR_pread
+-
+-# define __NR___syscall_pread __NR_pread
++# define __NR___syscall_pread __NR_pread64
+ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
++
+ }
+ weak_alias(__libc_pread,pread)
+
+@@ -44,22 +47,24 @@ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
+ }
+ weak_alias(__libc_pread64,pread64)
+ # endif /* __UCLIBC_HAS_LFS__ */
+
+-#endif /* __NR_pread */
+-
+-#ifdef __NR_pwrite
+-
+-# define __NR___syscall_pwrite __NR_pwrite
++# define __NR___syscall_pwrite __NR_pwrite64
+ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
+ }
+ weak_alias(__libc_pwrite,pwrite)
+
+@@ -68,120 +73,10 @@ 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);
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low));
++ LIBC_CANCEL_RESET (oldtype);
+ 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 */
+--
+cgit v0.9.1
diff --git a/tools-uclibc/portage.mips32r2.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch b/tools-uclibc/portage.mips32r2.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
new file mode 100644
index 0000000..007ec33
--- /dev/null
+++ b/tools-uclibc/portage.mips32r2.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
@@ -0,0 +1,65 @@
+From f22cca4722fa66e424562e69f4afa2bca0af871d Mon Sep 17 00:00:00 2001
+From: "Anthony G. Basile" <blueness@gentoo.org>
+Date: Sun, 28 Jul 2013 09:08:34 -0400
+Subject: [PATCH] libc: add isfdtype()
+
+isfdtype(int fd, int fdtype) check whether a file descriptor fd is
+of type fdtype, where the types are defined in stat(2). It is
+supported in glibc and BSD, and used by utilities such as acpid.
+
+Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+ libc/misc/file/isfdtype.c | 40 ++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 40 insertions(+)
+ create mode 100644 libc/misc/file/isfdtype.c
+
+diff --git a/libc/misc/file/isfdtype.c b/libc/misc/file/isfdtype.c
+new file mode 100644
+index 0000000..4d9199b
+--- /dev/null
++++ libc/misc/file/isfdtype.c
+@@ -0,0 +1,40 @@
++/* Determine whether descriptor has given property.
++ Copyright (C) 1996-2013 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/>. */
++
++#include <errno.h>
++#include <sys/stat.h>
++#include <sys/socket.h>
++#include <sys/types.h>
++#ifdef __UCLIBC_HAS_LFS__
++# include <_lfs_64.h>
++#else
++# define stat64 stat
++# define fstat64 fstat
++#endif
++
++int
++isfdtype (int fildes, int fdtype)
++{
++ struct stat64 st;
++ int save_error = errno;
++ int result = fstat64 (fildes, &st);
++ __set_errno (save_error);
++ if (result)
++ return result;
++ return (st.st_mode & S_IFMT) == (mode_t) fdtype;
++}
+--
+1.8.3.2.733.gf8abaeb
+
diff --git a/tools-uclibc/portage.mips32r2.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch b/tools-uclibc/portage.mips32r2.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
new file mode 100644
index 0000000..7ea9486
--- /dev/null
+++ b/tools-uclibc/portage.mips32r2.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
@@ -0,0 +1,215 @@
+From 342a3d861fde5651ee53486addbacddcec6a0a58 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <natanael.copa@gmail.com>
+Date: Sat, 04 Aug 2012 17:32:45 +0000
+Subject: pread/pwrite: backport fix
+
+pread/pwrite syscalls has been renamed to pread64/pwrite in 2.6 kernel.
+
+There was a fallback function using lseek for kernels who did not have
+this syscall (pre 2.1.60). This is broken in many ways.
+
+uclibc have been using the broken fallback due to they forgot to rename
+pread syscall.
+
+This got detected with git-1.7.11 which introduced threaded index-pack
+which broke in similar ways a windows (msys).
+
+This issue in uclibc have been reported upstream and fixed in git master
+so this patch does not need to be upstreamed. It might be an idea to
+backport it properly for 0.9.33 branch though.
+
+Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
+index 88e6957..baf8691 100644
+--- a/libc/sysdeps/linux/common/pread_write.c
++++ b/libc/sysdeps/linux/common/pread_write.c
+@@ -17,6 +17,7 @@
+ #include <unistd.h>
+ #include <stdint.h>
+ #include <endian.h>
++#include <sysdep-cancel.h>
+
+ extern __typeof(pread) __libc_pread;
+ extern __typeof(pwrite) __libc_pwrite;
+@@ -27,15 +28,17 @@ extern __typeof(pwrite64) __libc_pwrite64;
+
+ #include <bits/kernel_types.h>
+
+-#ifdef __NR_pread
+-
+-# define __NR___syscall_pread __NR_pread
++# define __NR___syscall_pread __NR_pread64
+ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
++
+ }
+ weak_alias(__libc_pread,pread)
+
+@@ -44,22 +47,24 @@ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
+ }
+ weak_alias(__libc_pread64,pread64)
+ # endif /* __UCLIBC_HAS_LFS__ */
+
+-#endif /* __NR_pread */
+-
+-#ifdef __NR_pwrite
+-
+-# define __NR___syscall_pwrite __NR_pwrite
++# define __NR___syscall_pwrite __NR_pwrite64
+ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
+ }
+ weak_alias(__libc_pwrite,pwrite)
+
+@@ -68,120 +73,10 @@ 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);
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low));
++ LIBC_CANCEL_RESET (oldtype);
+ 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 */
+--
+cgit v0.9.1
diff --git a/tools-uclibc/portage.mipsel3.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch b/tools-uclibc/portage.mipsel3.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
new file mode 100644
index 0000000..007ec33
--- /dev/null
+++ b/tools-uclibc/portage.mipsel3.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
@@ -0,0 +1,65 @@
+From f22cca4722fa66e424562e69f4afa2bca0af871d Mon Sep 17 00:00:00 2001
+From: "Anthony G. Basile" <blueness@gentoo.org>
+Date: Sun, 28 Jul 2013 09:08:34 -0400
+Subject: [PATCH] libc: add isfdtype()
+
+isfdtype(int fd, int fdtype) check whether a file descriptor fd is
+of type fdtype, where the types are defined in stat(2). It is
+supported in glibc and BSD, and used by utilities such as acpid.
+
+Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+ libc/misc/file/isfdtype.c | 40 ++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 40 insertions(+)
+ create mode 100644 libc/misc/file/isfdtype.c
+
+diff --git a/libc/misc/file/isfdtype.c b/libc/misc/file/isfdtype.c
+new file mode 100644
+index 0000000..4d9199b
+--- /dev/null
++++ libc/misc/file/isfdtype.c
+@@ -0,0 +1,40 @@
++/* Determine whether descriptor has given property.
++ Copyright (C) 1996-2013 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/>. */
++
++#include <errno.h>
++#include <sys/stat.h>
++#include <sys/socket.h>
++#include <sys/types.h>
++#ifdef __UCLIBC_HAS_LFS__
++# include <_lfs_64.h>
++#else
++# define stat64 stat
++# define fstat64 fstat
++#endif
++
++int
++isfdtype (int fildes, int fdtype)
++{
++ struct stat64 st;
++ int save_error = errno;
++ int result = fstat64 (fildes, &st);
++ __set_errno (save_error);
++ if (result)
++ return result;
++ return (st.st_mode & S_IFMT) == (mode_t) fdtype;
++}
+--
+1.8.3.2.733.gf8abaeb
+
diff --git a/tools-uclibc/portage.mipsel3.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch b/tools-uclibc/portage.mipsel3.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
new file mode 100644
index 0000000..7ea9486
--- /dev/null
+++ b/tools-uclibc/portage.mipsel3.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
@@ -0,0 +1,215 @@
+From 342a3d861fde5651ee53486addbacddcec6a0a58 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <natanael.copa@gmail.com>
+Date: Sat, 04 Aug 2012 17:32:45 +0000
+Subject: pread/pwrite: backport fix
+
+pread/pwrite syscalls has been renamed to pread64/pwrite in 2.6 kernel.
+
+There was a fallback function using lseek for kernels who did not have
+this syscall (pre 2.1.60). This is broken in many ways.
+
+uclibc have been using the broken fallback due to they forgot to rename
+pread syscall.
+
+This got detected with git-1.7.11 which introduced threaded index-pack
+which broke in similar ways a windows (msys).
+
+This issue in uclibc have been reported upstream and fixed in git master
+so this patch does not need to be upstreamed. It might be an idea to
+backport it properly for 0.9.33 branch though.
+
+Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
+index 88e6957..baf8691 100644
+--- a/libc/sysdeps/linux/common/pread_write.c
++++ b/libc/sysdeps/linux/common/pread_write.c
+@@ -17,6 +17,7 @@
+ #include <unistd.h>
+ #include <stdint.h>
+ #include <endian.h>
++#include <sysdep-cancel.h>
+
+ extern __typeof(pread) __libc_pread;
+ extern __typeof(pwrite) __libc_pwrite;
+@@ -27,15 +28,17 @@ extern __typeof(pwrite64) __libc_pwrite64;
+
+ #include <bits/kernel_types.h>
+
+-#ifdef __NR_pread
+-
+-# define __NR___syscall_pread __NR_pread
++# define __NR___syscall_pread __NR_pread64
+ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
++
+ }
+ weak_alias(__libc_pread,pread)
+
+@@ -44,22 +47,24 @@ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
+ }
+ weak_alias(__libc_pread64,pread64)
+ # endif /* __UCLIBC_HAS_LFS__ */
+
+-#endif /* __NR_pread */
+-
+-#ifdef __NR_pwrite
+-
+-# define __NR___syscall_pwrite __NR_pwrite
++# define __NR___syscall_pwrite __NR_pwrite64
+ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
+ }
+ weak_alias(__libc_pwrite,pwrite)
+
+@@ -68,120 +73,10 @@ 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);
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low));
++ LIBC_CANCEL_RESET (oldtype);
+ 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 */
+--
+cgit v0.9.1
diff --git a/tools-uclibc/portage.mipsel3.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch b/tools-uclibc/portage.mipsel3.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
new file mode 100644
index 0000000..007ec33
--- /dev/null
+++ b/tools-uclibc/portage.mipsel3.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
@@ -0,0 +1,65 @@
+From f22cca4722fa66e424562e69f4afa2bca0af871d Mon Sep 17 00:00:00 2001
+From: "Anthony G. Basile" <blueness@gentoo.org>
+Date: Sun, 28 Jul 2013 09:08:34 -0400
+Subject: [PATCH] libc: add isfdtype()
+
+isfdtype(int fd, int fdtype) check whether a file descriptor fd is
+of type fdtype, where the types are defined in stat(2). It is
+supported in glibc and BSD, and used by utilities such as acpid.
+
+Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+ libc/misc/file/isfdtype.c | 40 ++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 40 insertions(+)
+ create mode 100644 libc/misc/file/isfdtype.c
+
+diff --git a/libc/misc/file/isfdtype.c b/libc/misc/file/isfdtype.c
+new file mode 100644
+index 0000000..4d9199b
+--- /dev/null
++++ libc/misc/file/isfdtype.c
+@@ -0,0 +1,40 @@
++/* Determine whether descriptor has given property.
++ Copyright (C) 1996-2013 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/>. */
++
++#include <errno.h>
++#include <sys/stat.h>
++#include <sys/socket.h>
++#include <sys/types.h>
++#ifdef __UCLIBC_HAS_LFS__
++# include <_lfs_64.h>
++#else
++# define stat64 stat
++# define fstat64 fstat
++#endif
++
++int
++isfdtype (int fildes, int fdtype)
++{
++ struct stat64 st;
++ int save_error = errno;
++ int result = fstat64 (fildes, &st);
++ __set_errno (save_error);
++ if (result)
++ return result;
++ return (st.st_mode & S_IFMT) == (mode_t) fdtype;
++}
+--
+1.8.3.2.733.gf8abaeb
+
diff --git a/tools-uclibc/portage.mipsel3.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch b/tools-uclibc/portage.mipsel3.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
new file mode 100644
index 0000000..7ea9486
--- /dev/null
+++ b/tools-uclibc/portage.mipsel3.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
@@ -0,0 +1,215 @@
+From 342a3d861fde5651ee53486addbacddcec6a0a58 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <natanael.copa@gmail.com>
+Date: Sat, 04 Aug 2012 17:32:45 +0000
+Subject: pread/pwrite: backport fix
+
+pread/pwrite syscalls has been renamed to pread64/pwrite in 2.6 kernel.
+
+There was a fallback function using lseek for kernels who did not have
+this syscall (pre 2.1.60). This is broken in many ways.
+
+uclibc have been using the broken fallback due to they forgot to rename
+pread syscall.
+
+This got detected with git-1.7.11 which introduced threaded index-pack
+which broke in similar ways a windows (msys).
+
+This issue in uclibc have been reported upstream and fixed in git master
+so this patch does not need to be upstreamed. It might be an idea to
+backport it properly for 0.9.33 branch though.
+
+Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
+index 88e6957..baf8691 100644
+--- a/libc/sysdeps/linux/common/pread_write.c
++++ b/libc/sysdeps/linux/common/pread_write.c
+@@ -17,6 +17,7 @@
+ #include <unistd.h>
+ #include <stdint.h>
+ #include <endian.h>
++#include <sysdep-cancel.h>
+
+ extern __typeof(pread) __libc_pread;
+ extern __typeof(pwrite) __libc_pwrite;
+@@ -27,15 +28,17 @@ extern __typeof(pwrite64) __libc_pwrite64;
+
+ #include <bits/kernel_types.h>
+
+-#ifdef __NR_pread
+-
+-# define __NR___syscall_pread __NR_pread
++# define __NR___syscall_pread __NR_pread64
+ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
++
+ }
+ weak_alias(__libc_pread,pread)
+
+@@ -44,22 +47,24 @@ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
+ }
+ weak_alias(__libc_pread64,pread64)
+ # endif /* __UCLIBC_HAS_LFS__ */
+
+-#endif /* __NR_pread */
+-
+-#ifdef __NR_pwrite
+-
+-# define __NR___syscall_pwrite __NR_pwrite
++# define __NR___syscall_pwrite __NR_pwrite64
+ 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));
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
++ LIBC_CANCEL_RESET (oldtype);
++ return result;
+ }
+ weak_alias(__libc_pwrite,pwrite)
+
+@@ -68,120 +73,10 @@ 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);
++ int oldtype = LIBC_CANCEL_ASYNC ();
++ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low));
++ LIBC_CANCEL_RESET (oldtype);
+ 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 */
+--
+cgit v0.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] proj/releng:master commit in: tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/, ...
@ 2013-12-28 21:23 Anthony G. Basile
0 siblings, 0 replies; 7+ messages in thread
From: Anthony G. Basile @ 2013-12-28 21:23 UTC (permalink / raw
To: gentoo-commits
commit: 08cef68c75f0523120260fb30ee8cecb31268d7a
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 28 21:24:44 2013 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sat Dec 28 21:24:44 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/releng.git;a=commit;h=08cef68c
tools-uclibc: update patches for uclibc-0.9.33.2-r8
---
.../patches/sys-libs/uclibc/00_fix-eventfd.patch | 59 ------
.../sys-libs/uclibc/03-pread_pwrite-backport.patch | 215 ---------------------
...d-isfdtype.patch => 99-libc-add-isfdtype.patch} | 0
.../patches/sys-libs/uclibc/00_fix-eventfd.patch | 59 ------
.../sys-libs/uclibc/03-pread_pwrite-backport.patch | 215 ---------------------
...d-isfdtype.patch => 99-libc-add-isfdtype.patch} | 0
.../patches/sys-libs/uclibc/00_fix-eventfd.patch | 59 ------
.../sys-libs/uclibc/03-pread_pwrite-backport.patch | 215 ---------------------
...d-isfdtype.patch => 99-libc-add-isfdtype.patch} | 0
.../patches/sys-libs/uclibc/00_fix-eventfd.patch | 59 ------
.../sys-libs/uclibc/03-pread_pwrite-backport.patch | 215 ---------------------
...d-isfdtype.patch => 99-libc-add-isfdtype.patch} | 0
.../patches/sys-libs/uclibc/00_fix-eventfd.patch | 59 ------
.../sys-libs/uclibc/03-pread_pwrite-backport.patch | 215 ---------------------
...d-isfdtype.patch => 99-libc-add-isfdtype.patch} | 0
.../patches/sys-libs/uclibc/00_fix-eventfd.patch | 59 ------
.../sys-libs/uclibc/03-pread_pwrite-backport.patch | 215 ---------------------
...d-isfdtype.patch => 99-libc-add-isfdtype.patch} | 0
.../patches/sys-libs/uclibc/00_fix-eventfd.patch | 59 ------
.../sys-libs/uclibc/03-pread_pwrite-backport.patch | 215 ---------------------
...d-isfdtype.patch => 99-libc-add-isfdtype.patch} | 0
.../patches/sys-libs/uclibc/00_fix-eventfd.patch | 59 ------
.../sys-libs/uclibc/03-pread_pwrite-backport.patch | 215 ---------------------
...d-isfdtype.patch => 99-libc-add-isfdtype.patch} | 0
.../patches/sys-libs/uclibc/00_fix-eventfd.patch | 59 ------
.../sys-libs/uclibc/03-pread_pwrite-backport.patch | 215 ---------------------
...d-isfdtype.patch => 99-libc-add-isfdtype.patch} | 0
.../patches/sys-libs/uclibc/00_fix-eventfd.patch | 59 ------
.../sys-libs/uclibc/03-pread_pwrite-backport.patch | 215 ---------------------
...d-isfdtype.patch => 99-libc-add-isfdtype.patch} | 0
30 files changed, 2740 deletions(-)
diff --git a/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/00_fix-eventfd.patch b/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/00_fix-eventfd.patch
deleted file mode 100644
index cfc64de..0000000
--- a/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/00_fix-eventfd.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From e118373cbb58ba5ffa5fb6670957678d5b87cdb9 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 10 Jun 2012 16:36:23 +0000
-Subject: eventfd: Implement eventfd2 and fix eventfd
-
-eventfd: evntfd assumes to take two arguments instead it
-should be one evntfd expects two therefore implement both syscalls with
-correct parameters
-
-Thanks Eugene Rudoy for reporting it and also providing the patch
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-diff --git a/libc/sysdeps/linux/common/eventfd.c b/libc/sysdeps/linux/common/eventfd.c
-index cc3f3f0..96597ab 100644
---- a/libc/sysdeps/linux/common/eventfd.c
-+++ b/libc/sysdeps/linux/common/eventfd.c
-@@ -7,12 +7,24 @@
- * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- */
-
-+#include <errno.h>
- #include <sys/syscall.h>
- #include <sys/eventfd.h>
-
- /*
- * eventfd()
- */
--#ifdef __NR_eventfd
--_syscall2(int, eventfd, int, count, int, flags)
-+#if defined __NR_eventfd || defined __NR_eventfd2
-+int eventfd (int count, int flags)
-+{
-+#if defined __NR_eventfd2
-+ return INLINE_SYSCALL (eventfd2, 2, count, flags);
-+#elif defined __NR_eventfd
-+ if (flags != 0) {
-+ __set_errno (EINVAL);
-+ return -1;
-+ }
-+ return INLINE_SYSCALL (eventfd, 1, count);
-+#endif
-+}
- #endif
-diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c
-index 3567b07..1fc2393 100644
---- a/libc/sysdeps/linux/common/stubs.c
-+++ b/libc/sysdeps/linux/common/stubs.c
-@@ -110,7 +110,7 @@ make_stub(epoll_pwait)
- make_stub(epoll_wait)
- #endif
-
--#if !defined __NR_eventfd && defined __UCLIBC_LINUX_SPECIFIC__
-+#if !defined __NR_eventfd && !defined __NR_eventfd2 && defined __UCLIBC_LINUX_SPECIFIC__
- make_stub(eventfd)
- #endif
-
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch b/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
deleted file mode 100644
index 7ea9486..0000000
--- a/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
+++ /dev/null
@@ -1,215 +0,0 @@
-From 342a3d861fde5651ee53486addbacddcec6a0a58 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <natanael.copa@gmail.com>
-Date: Sat, 04 Aug 2012 17:32:45 +0000
-Subject: pread/pwrite: backport fix
-
-pread/pwrite syscalls has been renamed to pread64/pwrite in 2.6 kernel.
-
-There was a fallback function using lseek for kernels who did not have
-this syscall (pre 2.1.60). This is broken in many ways.
-
-uclibc have been using the broken fallback due to they forgot to rename
-pread syscall.
-
-This got detected with git-1.7.11 which introduced threaded index-pack
-which broke in similar ways a windows (msys).
-
-This issue in uclibc have been reported upstream and fixed in git master
-so this patch does not need to be upstreamed. It might be an idea to
-backport it properly for 0.9.33 branch though.
-
-Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
-diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
-index 88e6957..baf8691 100644
---- a/libc/sysdeps/linux/common/pread_write.c
-+++ b/libc/sysdeps/linux/common/pread_write.c
-@@ -17,6 +17,7 @@
- #include <unistd.h>
- #include <stdint.h>
- #include <endian.h>
-+#include <sysdep-cancel.h>
-
- extern __typeof(pread) __libc_pread;
- extern __typeof(pwrite) __libc_pwrite;
-@@ -27,15 +28,17 @@ extern __typeof(pwrite64) __libc_pwrite64;
-
- #include <bits/kernel_types.h>
-
--#ifdef __NR_pread
--
--# define __NR___syscall_pread __NR_pread
-+# define __NR___syscall_pread __NR_pread64
- 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
-+
- }
- weak_alias(__libc_pread,pread)
-
-@@ -44,22 +47,24 @@ 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
- }
- weak_alias(__libc_pread64,pread64)
- # endif /* __UCLIBC_HAS_LFS__ */
-
--#endif /* __NR_pread */
--
--#ifdef __NR_pwrite
--
--# define __NR___syscall_pwrite __NR_pwrite
-+# define __NR___syscall_pwrite __NR_pwrite64
- 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
- }
- weak_alias(__libc_pwrite,pwrite)
-
-@@ -68,120 +73,10 @@ 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);
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low));
-+ LIBC_CANCEL_RESET (oldtype);
- 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 */
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch b/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/99-libc-add-isfdtype.patch
similarity index 100%
rename from tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
rename to tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/99-libc-add-isfdtype.patch
diff --git a/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/00_fix-eventfd.patch b/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/00_fix-eventfd.patch
deleted file mode 100644
index cfc64de..0000000
--- a/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/00_fix-eventfd.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From e118373cbb58ba5ffa5fb6670957678d5b87cdb9 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 10 Jun 2012 16:36:23 +0000
-Subject: eventfd: Implement eventfd2 and fix eventfd
-
-eventfd: evntfd assumes to take two arguments instead it
-should be one evntfd expects two therefore implement both syscalls with
-correct parameters
-
-Thanks Eugene Rudoy for reporting it and also providing the patch
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-diff --git a/libc/sysdeps/linux/common/eventfd.c b/libc/sysdeps/linux/common/eventfd.c
-index cc3f3f0..96597ab 100644
---- a/libc/sysdeps/linux/common/eventfd.c
-+++ b/libc/sysdeps/linux/common/eventfd.c
-@@ -7,12 +7,24 @@
- * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- */
-
-+#include <errno.h>
- #include <sys/syscall.h>
- #include <sys/eventfd.h>
-
- /*
- * eventfd()
- */
--#ifdef __NR_eventfd
--_syscall2(int, eventfd, int, count, int, flags)
-+#if defined __NR_eventfd || defined __NR_eventfd2
-+int eventfd (int count, int flags)
-+{
-+#if defined __NR_eventfd2
-+ return INLINE_SYSCALL (eventfd2, 2, count, flags);
-+#elif defined __NR_eventfd
-+ if (flags != 0) {
-+ __set_errno (EINVAL);
-+ return -1;
-+ }
-+ return INLINE_SYSCALL (eventfd, 1, count);
-+#endif
-+}
- #endif
-diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c
-index 3567b07..1fc2393 100644
---- a/libc/sysdeps/linux/common/stubs.c
-+++ b/libc/sysdeps/linux/common/stubs.c
-@@ -110,7 +110,7 @@ make_stub(epoll_pwait)
- make_stub(epoll_wait)
- #endif
-
--#if !defined __NR_eventfd && defined __UCLIBC_LINUX_SPECIFIC__
-+#if !defined __NR_eventfd && !defined __NR_eventfd2 && defined __UCLIBC_LINUX_SPECIFIC__
- make_stub(eventfd)
- #endif
-
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch b/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
deleted file mode 100644
index 7ea9486..0000000
--- a/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
+++ /dev/null
@@ -1,215 +0,0 @@
-From 342a3d861fde5651ee53486addbacddcec6a0a58 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <natanael.copa@gmail.com>
-Date: Sat, 04 Aug 2012 17:32:45 +0000
-Subject: pread/pwrite: backport fix
-
-pread/pwrite syscalls has been renamed to pread64/pwrite in 2.6 kernel.
-
-There was a fallback function using lseek for kernels who did not have
-this syscall (pre 2.1.60). This is broken in many ways.
-
-uclibc have been using the broken fallback due to they forgot to rename
-pread syscall.
-
-This got detected with git-1.7.11 which introduced threaded index-pack
-which broke in similar ways a windows (msys).
-
-This issue in uclibc have been reported upstream and fixed in git master
-so this patch does not need to be upstreamed. It might be an idea to
-backport it properly for 0.9.33 branch though.
-
-Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
-diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
-index 88e6957..baf8691 100644
---- a/libc/sysdeps/linux/common/pread_write.c
-+++ b/libc/sysdeps/linux/common/pread_write.c
-@@ -17,6 +17,7 @@
- #include <unistd.h>
- #include <stdint.h>
- #include <endian.h>
-+#include <sysdep-cancel.h>
-
- extern __typeof(pread) __libc_pread;
- extern __typeof(pwrite) __libc_pwrite;
-@@ -27,15 +28,17 @@ extern __typeof(pwrite64) __libc_pwrite64;
-
- #include <bits/kernel_types.h>
-
--#ifdef __NR_pread
--
--# define __NR___syscall_pread __NR_pread
-+# define __NR___syscall_pread __NR_pread64
- 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
-+
- }
- weak_alias(__libc_pread,pread)
-
-@@ -44,22 +47,24 @@ 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
- }
- weak_alias(__libc_pread64,pread64)
- # endif /* __UCLIBC_HAS_LFS__ */
-
--#endif /* __NR_pread */
--
--#ifdef __NR_pwrite
--
--# define __NR___syscall_pwrite __NR_pwrite
-+# define __NR___syscall_pwrite __NR_pwrite64
- 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
- }
- weak_alias(__libc_pwrite,pwrite)
-
-@@ -68,120 +73,10 @@ 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);
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low));
-+ LIBC_CANCEL_RESET (oldtype);
- 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 */
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch b/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/99-libc-add-isfdtype.patch
similarity index 100%
rename from tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
rename to tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/99-libc-add-isfdtype.patch
diff --git a/tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/00_fix-eventfd.patch b/tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/00_fix-eventfd.patch
deleted file mode 100644
index cfc64de..0000000
--- a/tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/00_fix-eventfd.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From e118373cbb58ba5ffa5fb6670957678d5b87cdb9 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 10 Jun 2012 16:36:23 +0000
-Subject: eventfd: Implement eventfd2 and fix eventfd
-
-eventfd: evntfd assumes to take two arguments instead it
-should be one evntfd expects two therefore implement both syscalls with
-correct parameters
-
-Thanks Eugene Rudoy for reporting it and also providing the patch
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-diff --git a/libc/sysdeps/linux/common/eventfd.c b/libc/sysdeps/linux/common/eventfd.c
-index cc3f3f0..96597ab 100644
---- a/libc/sysdeps/linux/common/eventfd.c
-+++ b/libc/sysdeps/linux/common/eventfd.c
-@@ -7,12 +7,24 @@
- * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- */
-
-+#include <errno.h>
- #include <sys/syscall.h>
- #include <sys/eventfd.h>
-
- /*
- * eventfd()
- */
--#ifdef __NR_eventfd
--_syscall2(int, eventfd, int, count, int, flags)
-+#if defined __NR_eventfd || defined __NR_eventfd2
-+int eventfd (int count, int flags)
-+{
-+#if defined __NR_eventfd2
-+ return INLINE_SYSCALL (eventfd2, 2, count, flags);
-+#elif defined __NR_eventfd
-+ if (flags != 0) {
-+ __set_errno (EINVAL);
-+ return -1;
-+ }
-+ return INLINE_SYSCALL (eventfd, 1, count);
-+#endif
-+}
- #endif
-diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c
-index 3567b07..1fc2393 100644
---- a/libc/sysdeps/linux/common/stubs.c
-+++ b/libc/sysdeps/linux/common/stubs.c
-@@ -110,7 +110,7 @@ make_stub(epoll_pwait)
- make_stub(epoll_wait)
- #endif
-
--#if !defined __NR_eventfd && defined __UCLIBC_LINUX_SPECIFIC__
-+#if !defined __NR_eventfd && !defined __NR_eventfd2 && defined __UCLIBC_LINUX_SPECIFIC__
- make_stub(eventfd)
- #endif
-
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch b/tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
deleted file mode 100644
index 7ea9486..0000000
--- a/tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
+++ /dev/null
@@ -1,215 +0,0 @@
-From 342a3d861fde5651ee53486addbacddcec6a0a58 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <natanael.copa@gmail.com>
-Date: Sat, 04 Aug 2012 17:32:45 +0000
-Subject: pread/pwrite: backport fix
-
-pread/pwrite syscalls has been renamed to pread64/pwrite in 2.6 kernel.
-
-There was a fallback function using lseek for kernels who did not have
-this syscall (pre 2.1.60). This is broken in many ways.
-
-uclibc have been using the broken fallback due to they forgot to rename
-pread syscall.
-
-This got detected with git-1.7.11 which introduced threaded index-pack
-which broke in similar ways a windows (msys).
-
-This issue in uclibc have been reported upstream and fixed in git master
-so this patch does not need to be upstreamed. It might be an idea to
-backport it properly for 0.9.33 branch though.
-
-Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
-diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
-index 88e6957..baf8691 100644
---- a/libc/sysdeps/linux/common/pread_write.c
-+++ b/libc/sysdeps/linux/common/pread_write.c
-@@ -17,6 +17,7 @@
- #include <unistd.h>
- #include <stdint.h>
- #include <endian.h>
-+#include <sysdep-cancel.h>
-
- extern __typeof(pread) __libc_pread;
- extern __typeof(pwrite) __libc_pwrite;
-@@ -27,15 +28,17 @@ extern __typeof(pwrite64) __libc_pwrite64;
-
- #include <bits/kernel_types.h>
-
--#ifdef __NR_pread
--
--# define __NR___syscall_pread __NR_pread
-+# define __NR___syscall_pread __NR_pread64
- 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
-+
- }
- weak_alias(__libc_pread,pread)
-
-@@ -44,22 +47,24 @@ 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
- }
- weak_alias(__libc_pread64,pread64)
- # endif /* __UCLIBC_HAS_LFS__ */
-
--#endif /* __NR_pread */
--
--#ifdef __NR_pwrite
--
--# define __NR___syscall_pwrite __NR_pwrite
-+# define __NR___syscall_pwrite __NR_pwrite64
- 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
- }
- weak_alias(__libc_pwrite,pwrite)
-
-@@ -68,120 +73,10 @@ 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);
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low));
-+ LIBC_CANCEL_RESET (oldtype);
- 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 */
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch b/tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/99-libc-add-isfdtype.patch
similarity index 100%
rename from tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
rename to tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/99-libc-add-isfdtype.patch
diff --git a/tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/00_fix-eventfd.patch b/tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/00_fix-eventfd.patch
deleted file mode 100644
index cfc64de..0000000
--- a/tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/00_fix-eventfd.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From e118373cbb58ba5ffa5fb6670957678d5b87cdb9 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 10 Jun 2012 16:36:23 +0000
-Subject: eventfd: Implement eventfd2 and fix eventfd
-
-eventfd: evntfd assumes to take two arguments instead it
-should be one evntfd expects two therefore implement both syscalls with
-correct parameters
-
-Thanks Eugene Rudoy for reporting it and also providing the patch
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-diff --git a/libc/sysdeps/linux/common/eventfd.c b/libc/sysdeps/linux/common/eventfd.c
-index cc3f3f0..96597ab 100644
---- a/libc/sysdeps/linux/common/eventfd.c
-+++ b/libc/sysdeps/linux/common/eventfd.c
-@@ -7,12 +7,24 @@
- * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- */
-
-+#include <errno.h>
- #include <sys/syscall.h>
- #include <sys/eventfd.h>
-
- /*
- * eventfd()
- */
--#ifdef __NR_eventfd
--_syscall2(int, eventfd, int, count, int, flags)
-+#if defined __NR_eventfd || defined __NR_eventfd2
-+int eventfd (int count, int flags)
-+{
-+#if defined __NR_eventfd2
-+ return INLINE_SYSCALL (eventfd2, 2, count, flags);
-+#elif defined __NR_eventfd
-+ if (flags != 0) {
-+ __set_errno (EINVAL);
-+ return -1;
-+ }
-+ return INLINE_SYSCALL (eventfd, 1, count);
-+#endif
-+}
- #endif
-diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c
-index 3567b07..1fc2393 100644
---- a/libc/sysdeps/linux/common/stubs.c
-+++ b/libc/sysdeps/linux/common/stubs.c
-@@ -110,7 +110,7 @@ make_stub(epoll_pwait)
- make_stub(epoll_wait)
- #endif
-
--#if !defined __NR_eventfd && defined __UCLIBC_LINUX_SPECIFIC__
-+#if !defined __NR_eventfd && !defined __NR_eventfd2 && defined __UCLIBC_LINUX_SPECIFIC__
- make_stub(eventfd)
- #endif
-
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch b/tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
deleted file mode 100644
index 7ea9486..0000000
--- a/tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
+++ /dev/null
@@ -1,215 +0,0 @@
-From 342a3d861fde5651ee53486addbacddcec6a0a58 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <natanael.copa@gmail.com>
-Date: Sat, 04 Aug 2012 17:32:45 +0000
-Subject: pread/pwrite: backport fix
-
-pread/pwrite syscalls has been renamed to pread64/pwrite in 2.6 kernel.
-
-There was a fallback function using lseek for kernels who did not have
-this syscall (pre 2.1.60). This is broken in many ways.
-
-uclibc have been using the broken fallback due to they forgot to rename
-pread syscall.
-
-This got detected with git-1.7.11 which introduced threaded index-pack
-which broke in similar ways a windows (msys).
-
-This issue in uclibc have been reported upstream and fixed in git master
-so this patch does not need to be upstreamed. It might be an idea to
-backport it properly for 0.9.33 branch though.
-
-Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
-diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
-index 88e6957..baf8691 100644
---- a/libc/sysdeps/linux/common/pread_write.c
-+++ b/libc/sysdeps/linux/common/pread_write.c
-@@ -17,6 +17,7 @@
- #include <unistd.h>
- #include <stdint.h>
- #include <endian.h>
-+#include <sysdep-cancel.h>
-
- extern __typeof(pread) __libc_pread;
- extern __typeof(pwrite) __libc_pwrite;
-@@ -27,15 +28,17 @@ extern __typeof(pwrite64) __libc_pwrite64;
-
- #include <bits/kernel_types.h>
-
--#ifdef __NR_pread
--
--# define __NR___syscall_pread __NR_pread
-+# define __NR___syscall_pread __NR_pread64
- 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
-+
- }
- weak_alias(__libc_pread,pread)
-
-@@ -44,22 +47,24 @@ 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
- }
- weak_alias(__libc_pread64,pread64)
- # endif /* __UCLIBC_HAS_LFS__ */
-
--#endif /* __NR_pread */
--
--#ifdef __NR_pwrite
--
--# define __NR___syscall_pwrite __NR_pwrite
-+# define __NR___syscall_pwrite __NR_pwrite64
- 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
- }
- weak_alias(__libc_pwrite,pwrite)
-
-@@ -68,120 +73,10 @@ 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);
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low));
-+ LIBC_CANCEL_RESET (oldtype);
- 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 */
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch b/tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/99-libc-add-isfdtype.patch
similarity index 100%
rename from tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
rename to tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/99-libc-add-isfdtype.patch
diff --git a/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/00_fix-eventfd.patch b/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/00_fix-eventfd.patch
deleted file mode 100644
index cfc64de..0000000
--- a/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/00_fix-eventfd.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From e118373cbb58ba5ffa5fb6670957678d5b87cdb9 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 10 Jun 2012 16:36:23 +0000
-Subject: eventfd: Implement eventfd2 and fix eventfd
-
-eventfd: evntfd assumes to take two arguments instead it
-should be one evntfd expects two therefore implement both syscalls with
-correct parameters
-
-Thanks Eugene Rudoy for reporting it and also providing the patch
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-diff --git a/libc/sysdeps/linux/common/eventfd.c b/libc/sysdeps/linux/common/eventfd.c
-index cc3f3f0..96597ab 100644
---- a/libc/sysdeps/linux/common/eventfd.c
-+++ b/libc/sysdeps/linux/common/eventfd.c
-@@ -7,12 +7,24 @@
- * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- */
-
-+#include <errno.h>
- #include <sys/syscall.h>
- #include <sys/eventfd.h>
-
- /*
- * eventfd()
- */
--#ifdef __NR_eventfd
--_syscall2(int, eventfd, int, count, int, flags)
-+#if defined __NR_eventfd || defined __NR_eventfd2
-+int eventfd (int count, int flags)
-+{
-+#if defined __NR_eventfd2
-+ return INLINE_SYSCALL (eventfd2, 2, count, flags);
-+#elif defined __NR_eventfd
-+ if (flags != 0) {
-+ __set_errno (EINVAL);
-+ return -1;
-+ }
-+ return INLINE_SYSCALL (eventfd, 1, count);
-+#endif
-+}
- #endif
-diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c
-index 3567b07..1fc2393 100644
---- a/libc/sysdeps/linux/common/stubs.c
-+++ b/libc/sysdeps/linux/common/stubs.c
-@@ -110,7 +110,7 @@ make_stub(epoll_pwait)
- make_stub(epoll_wait)
- #endif
-
--#if !defined __NR_eventfd && defined __UCLIBC_LINUX_SPECIFIC__
-+#if !defined __NR_eventfd && !defined __NR_eventfd2 && defined __UCLIBC_LINUX_SPECIFIC__
- make_stub(eventfd)
- #endif
-
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch b/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
deleted file mode 100644
index 7ea9486..0000000
--- a/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
+++ /dev/null
@@ -1,215 +0,0 @@
-From 342a3d861fde5651ee53486addbacddcec6a0a58 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <natanael.copa@gmail.com>
-Date: Sat, 04 Aug 2012 17:32:45 +0000
-Subject: pread/pwrite: backport fix
-
-pread/pwrite syscalls has been renamed to pread64/pwrite in 2.6 kernel.
-
-There was a fallback function using lseek for kernels who did not have
-this syscall (pre 2.1.60). This is broken in many ways.
-
-uclibc have been using the broken fallback due to they forgot to rename
-pread syscall.
-
-This got detected with git-1.7.11 which introduced threaded index-pack
-which broke in similar ways a windows (msys).
-
-This issue in uclibc have been reported upstream and fixed in git master
-so this patch does not need to be upstreamed. It might be an idea to
-backport it properly for 0.9.33 branch though.
-
-Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
-diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
-index 88e6957..baf8691 100644
---- a/libc/sysdeps/linux/common/pread_write.c
-+++ b/libc/sysdeps/linux/common/pread_write.c
-@@ -17,6 +17,7 @@
- #include <unistd.h>
- #include <stdint.h>
- #include <endian.h>
-+#include <sysdep-cancel.h>
-
- extern __typeof(pread) __libc_pread;
- extern __typeof(pwrite) __libc_pwrite;
-@@ -27,15 +28,17 @@ extern __typeof(pwrite64) __libc_pwrite64;
-
- #include <bits/kernel_types.h>
-
--#ifdef __NR_pread
--
--# define __NR___syscall_pread __NR_pread
-+# define __NR___syscall_pread __NR_pread64
- 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
-+
- }
- weak_alias(__libc_pread,pread)
-
-@@ -44,22 +47,24 @@ 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
- }
- weak_alias(__libc_pread64,pread64)
- # endif /* __UCLIBC_HAS_LFS__ */
-
--#endif /* __NR_pread */
--
--#ifdef __NR_pwrite
--
--# define __NR___syscall_pwrite __NR_pwrite
-+# define __NR___syscall_pwrite __NR_pwrite64
- 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
- }
- weak_alias(__libc_pwrite,pwrite)
-
-@@ -68,120 +73,10 @@ 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);
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low));
-+ LIBC_CANCEL_RESET (oldtype);
- 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 */
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch b/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/99-libc-add-isfdtype.patch
similarity index 100%
rename from tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
rename to tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/99-libc-add-isfdtype.patch
diff --git a/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/00_fix-eventfd.patch b/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/00_fix-eventfd.patch
deleted file mode 100644
index cfc64de..0000000
--- a/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/00_fix-eventfd.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From e118373cbb58ba5ffa5fb6670957678d5b87cdb9 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 10 Jun 2012 16:36:23 +0000
-Subject: eventfd: Implement eventfd2 and fix eventfd
-
-eventfd: evntfd assumes to take two arguments instead it
-should be one evntfd expects two therefore implement both syscalls with
-correct parameters
-
-Thanks Eugene Rudoy for reporting it and also providing the patch
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-diff --git a/libc/sysdeps/linux/common/eventfd.c b/libc/sysdeps/linux/common/eventfd.c
-index cc3f3f0..96597ab 100644
---- a/libc/sysdeps/linux/common/eventfd.c
-+++ b/libc/sysdeps/linux/common/eventfd.c
-@@ -7,12 +7,24 @@
- * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- */
-
-+#include <errno.h>
- #include <sys/syscall.h>
- #include <sys/eventfd.h>
-
- /*
- * eventfd()
- */
--#ifdef __NR_eventfd
--_syscall2(int, eventfd, int, count, int, flags)
-+#if defined __NR_eventfd || defined __NR_eventfd2
-+int eventfd (int count, int flags)
-+{
-+#if defined __NR_eventfd2
-+ return INLINE_SYSCALL (eventfd2, 2, count, flags);
-+#elif defined __NR_eventfd
-+ if (flags != 0) {
-+ __set_errno (EINVAL);
-+ return -1;
-+ }
-+ return INLINE_SYSCALL (eventfd, 1, count);
-+#endif
-+}
- #endif
-diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c
-index 3567b07..1fc2393 100644
---- a/libc/sysdeps/linux/common/stubs.c
-+++ b/libc/sysdeps/linux/common/stubs.c
-@@ -110,7 +110,7 @@ make_stub(epoll_pwait)
- make_stub(epoll_wait)
- #endif
-
--#if !defined __NR_eventfd && defined __UCLIBC_LINUX_SPECIFIC__
-+#if !defined __NR_eventfd && !defined __NR_eventfd2 && defined __UCLIBC_LINUX_SPECIFIC__
- make_stub(eventfd)
- #endif
-
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch b/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
deleted file mode 100644
index 7ea9486..0000000
--- a/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
+++ /dev/null
@@ -1,215 +0,0 @@
-From 342a3d861fde5651ee53486addbacddcec6a0a58 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <natanael.copa@gmail.com>
-Date: Sat, 04 Aug 2012 17:32:45 +0000
-Subject: pread/pwrite: backport fix
-
-pread/pwrite syscalls has been renamed to pread64/pwrite in 2.6 kernel.
-
-There was a fallback function using lseek for kernels who did not have
-this syscall (pre 2.1.60). This is broken in many ways.
-
-uclibc have been using the broken fallback due to they forgot to rename
-pread syscall.
-
-This got detected with git-1.7.11 which introduced threaded index-pack
-which broke in similar ways a windows (msys).
-
-This issue in uclibc have been reported upstream and fixed in git master
-so this patch does not need to be upstreamed. It might be an idea to
-backport it properly for 0.9.33 branch though.
-
-Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
-diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
-index 88e6957..baf8691 100644
---- a/libc/sysdeps/linux/common/pread_write.c
-+++ b/libc/sysdeps/linux/common/pread_write.c
-@@ -17,6 +17,7 @@
- #include <unistd.h>
- #include <stdint.h>
- #include <endian.h>
-+#include <sysdep-cancel.h>
-
- extern __typeof(pread) __libc_pread;
- extern __typeof(pwrite) __libc_pwrite;
-@@ -27,15 +28,17 @@ extern __typeof(pwrite64) __libc_pwrite64;
-
- #include <bits/kernel_types.h>
-
--#ifdef __NR_pread
--
--# define __NR___syscall_pread __NR_pread
-+# define __NR___syscall_pread __NR_pread64
- 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
-+
- }
- weak_alias(__libc_pread,pread)
-
-@@ -44,22 +47,24 @@ 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
- }
- weak_alias(__libc_pread64,pread64)
- # endif /* __UCLIBC_HAS_LFS__ */
-
--#endif /* __NR_pread */
--
--#ifdef __NR_pwrite
--
--# define __NR___syscall_pwrite __NR_pwrite
-+# define __NR___syscall_pwrite __NR_pwrite64
- 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
- }
- weak_alias(__libc_pwrite,pwrite)
-
-@@ -68,120 +73,10 @@ 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);
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low));
-+ LIBC_CANCEL_RESET (oldtype);
- 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 */
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch b/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/99-libc-add-isfdtype.patch
similarity index 100%
rename from tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
rename to tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/99-libc-add-isfdtype.patch
diff --git a/tools-uclibc/portage.mips32r2.hardened/patches/sys-libs/uclibc/00_fix-eventfd.patch b/tools-uclibc/portage.mips32r2.hardened/patches/sys-libs/uclibc/00_fix-eventfd.patch
deleted file mode 100644
index cfc64de..0000000
--- a/tools-uclibc/portage.mips32r2.hardened/patches/sys-libs/uclibc/00_fix-eventfd.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From e118373cbb58ba5ffa5fb6670957678d5b87cdb9 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 10 Jun 2012 16:36:23 +0000
-Subject: eventfd: Implement eventfd2 and fix eventfd
-
-eventfd: evntfd assumes to take two arguments instead it
-should be one evntfd expects two therefore implement both syscalls with
-correct parameters
-
-Thanks Eugene Rudoy for reporting it and also providing the patch
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-diff --git a/libc/sysdeps/linux/common/eventfd.c b/libc/sysdeps/linux/common/eventfd.c
-index cc3f3f0..96597ab 100644
---- a/libc/sysdeps/linux/common/eventfd.c
-+++ b/libc/sysdeps/linux/common/eventfd.c
-@@ -7,12 +7,24 @@
- * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- */
-
-+#include <errno.h>
- #include <sys/syscall.h>
- #include <sys/eventfd.h>
-
- /*
- * eventfd()
- */
--#ifdef __NR_eventfd
--_syscall2(int, eventfd, int, count, int, flags)
-+#if defined __NR_eventfd || defined __NR_eventfd2
-+int eventfd (int count, int flags)
-+{
-+#if defined __NR_eventfd2
-+ return INLINE_SYSCALL (eventfd2, 2, count, flags);
-+#elif defined __NR_eventfd
-+ if (flags != 0) {
-+ __set_errno (EINVAL);
-+ return -1;
-+ }
-+ return INLINE_SYSCALL (eventfd, 1, count);
-+#endif
-+}
- #endif
-diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c
-index 3567b07..1fc2393 100644
---- a/libc/sysdeps/linux/common/stubs.c
-+++ b/libc/sysdeps/linux/common/stubs.c
-@@ -110,7 +110,7 @@ make_stub(epoll_pwait)
- make_stub(epoll_wait)
- #endif
-
--#if !defined __NR_eventfd && defined __UCLIBC_LINUX_SPECIFIC__
-+#if !defined __NR_eventfd && !defined __NR_eventfd2 && defined __UCLIBC_LINUX_SPECIFIC__
- make_stub(eventfd)
- #endif
-
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.mips32r2.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch b/tools-uclibc/portage.mips32r2.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
deleted file mode 100644
index 7ea9486..0000000
--- a/tools-uclibc/portage.mips32r2.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
+++ /dev/null
@@ -1,215 +0,0 @@
-From 342a3d861fde5651ee53486addbacddcec6a0a58 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <natanael.copa@gmail.com>
-Date: Sat, 04 Aug 2012 17:32:45 +0000
-Subject: pread/pwrite: backport fix
-
-pread/pwrite syscalls has been renamed to pread64/pwrite in 2.6 kernel.
-
-There was a fallback function using lseek for kernels who did not have
-this syscall (pre 2.1.60). This is broken in many ways.
-
-uclibc have been using the broken fallback due to they forgot to rename
-pread syscall.
-
-This got detected with git-1.7.11 which introduced threaded index-pack
-which broke in similar ways a windows (msys).
-
-This issue in uclibc have been reported upstream and fixed in git master
-so this patch does not need to be upstreamed. It might be an idea to
-backport it properly for 0.9.33 branch though.
-
-Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
-diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
-index 88e6957..baf8691 100644
---- a/libc/sysdeps/linux/common/pread_write.c
-+++ b/libc/sysdeps/linux/common/pread_write.c
-@@ -17,6 +17,7 @@
- #include <unistd.h>
- #include <stdint.h>
- #include <endian.h>
-+#include <sysdep-cancel.h>
-
- extern __typeof(pread) __libc_pread;
- extern __typeof(pwrite) __libc_pwrite;
-@@ -27,15 +28,17 @@ extern __typeof(pwrite64) __libc_pwrite64;
-
- #include <bits/kernel_types.h>
-
--#ifdef __NR_pread
--
--# define __NR___syscall_pread __NR_pread
-+# define __NR___syscall_pread __NR_pread64
- 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
-+
- }
- weak_alias(__libc_pread,pread)
-
-@@ -44,22 +47,24 @@ 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
- }
- weak_alias(__libc_pread64,pread64)
- # endif /* __UCLIBC_HAS_LFS__ */
-
--#endif /* __NR_pread */
--
--#ifdef __NR_pwrite
--
--# define __NR___syscall_pwrite __NR_pwrite
-+# define __NR___syscall_pwrite __NR_pwrite64
- 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
- }
- weak_alias(__libc_pwrite,pwrite)
-
-@@ -68,120 +73,10 @@ 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);
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low));
-+ LIBC_CANCEL_RESET (oldtype);
- 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 */
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.mips32r2.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch b/tools-uclibc/portage.mips32r2.hardened/patches/sys-libs/uclibc/99-libc-add-isfdtype.patch
similarity index 100%
rename from tools-uclibc/portage.mips32r2.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
rename to tools-uclibc/portage.mips32r2.hardened/patches/sys-libs/uclibc/99-libc-add-isfdtype.patch
diff --git a/tools-uclibc/portage.mips32r2.vanilla/patches/sys-libs/uclibc/00_fix-eventfd.patch b/tools-uclibc/portage.mips32r2.vanilla/patches/sys-libs/uclibc/00_fix-eventfd.patch
deleted file mode 100644
index cfc64de..0000000
--- a/tools-uclibc/portage.mips32r2.vanilla/patches/sys-libs/uclibc/00_fix-eventfd.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From e118373cbb58ba5ffa5fb6670957678d5b87cdb9 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 10 Jun 2012 16:36:23 +0000
-Subject: eventfd: Implement eventfd2 and fix eventfd
-
-eventfd: evntfd assumes to take two arguments instead it
-should be one evntfd expects two therefore implement both syscalls with
-correct parameters
-
-Thanks Eugene Rudoy for reporting it and also providing the patch
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-diff --git a/libc/sysdeps/linux/common/eventfd.c b/libc/sysdeps/linux/common/eventfd.c
-index cc3f3f0..96597ab 100644
---- a/libc/sysdeps/linux/common/eventfd.c
-+++ b/libc/sysdeps/linux/common/eventfd.c
-@@ -7,12 +7,24 @@
- * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- */
-
-+#include <errno.h>
- #include <sys/syscall.h>
- #include <sys/eventfd.h>
-
- /*
- * eventfd()
- */
--#ifdef __NR_eventfd
--_syscall2(int, eventfd, int, count, int, flags)
-+#if defined __NR_eventfd || defined __NR_eventfd2
-+int eventfd (int count, int flags)
-+{
-+#if defined __NR_eventfd2
-+ return INLINE_SYSCALL (eventfd2, 2, count, flags);
-+#elif defined __NR_eventfd
-+ if (flags != 0) {
-+ __set_errno (EINVAL);
-+ return -1;
-+ }
-+ return INLINE_SYSCALL (eventfd, 1, count);
-+#endif
-+}
- #endif
-diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c
-index 3567b07..1fc2393 100644
---- a/libc/sysdeps/linux/common/stubs.c
-+++ b/libc/sysdeps/linux/common/stubs.c
-@@ -110,7 +110,7 @@ make_stub(epoll_pwait)
- make_stub(epoll_wait)
- #endif
-
--#if !defined __NR_eventfd && defined __UCLIBC_LINUX_SPECIFIC__
-+#if !defined __NR_eventfd && !defined __NR_eventfd2 && defined __UCLIBC_LINUX_SPECIFIC__
- make_stub(eventfd)
- #endif
-
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.mips32r2.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch b/tools-uclibc/portage.mips32r2.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
deleted file mode 100644
index 7ea9486..0000000
--- a/tools-uclibc/portage.mips32r2.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
+++ /dev/null
@@ -1,215 +0,0 @@
-From 342a3d861fde5651ee53486addbacddcec6a0a58 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <natanael.copa@gmail.com>
-Date: Sat, 04 Aug 2012 17:32:45 +0000
-Subject: pread/pwrite: backport fix
-
-pread/pwrite syscalls has been renamed to pread64/pwrite in 2.6 kernel.
-
-There was a fallback function using lseek for kernels who did not have
-this syscall (pre 2.1.60). This is broken in many ways.
-
-uclibc have been using the broken fallback due to they forgot to rename
-pread syscall.
-
-This got detected with git-1.7.11 which introduced threaded index-pack
-which broke in similar ways a windows (msys).
-
-This issue in uclibc have been reported upstream and fixed in git master
-so this patch does not need to be upstreamed. It might be an idea to
-backport it properly for 0.9.33 branch though.
-
-Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
-diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
-index 88e6957..baf8691 100644
---- a/libc/sysdeps/linux/common/pread_write.c
-+++ b/libc/sysdeps/linux/common/pread_write.c
-@@ -17,6 +17,7 @@
- #include <unistd.h>
- #include <stdint.h>
- #include <endian.h>
-+#include <sysdep-cancel.h>
-
- extern __typeof(pread) __libc_pread;
- extern __typeof(pwrite) __libc_pwrite;
-@@ -27,15 +28,17 @@ extern __typeof(pwrite64) __libc_pwrite64;
-
- #include <bits/kernel_types.h>
-
--#ifdef __NR_pread
--
--# define __NR___syscall_pread __NR_pread
-+# define __NR___syscall_pread __NR_pread64
- 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
-+
- }
- weak_alias(__libc_pread,pread)
-
-@@ -44,22 +47,24 @@ 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
- }
- weak_alias(__libc_pread64,pread64)
- # endif /* __UCLIBC_HAS_LFS__ */
-
--#endif /* __NR_pread */
--
--#ifdef __NR_pwrite
--
--# define __NR___syscall_pwrite __NR_pwrite
-+# define __NR___syscall_pwrite __NR_pwrite64
- 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
- }
- weak_alias(__libc_pwrite,pwrite)
-
-@@ -68,120 +73,10 @@ 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);
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low));
-+ LIBC_CANCEL_RESET (oldtype);
- 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 */
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.mips32r2.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch b/tools-uclibc/portage.mips32r2.vanilla/patches/sys-libs/uclibc/99-libc-add-isfdtype.patch
similarity index 100%
rename from tools-uclibc/portage.mips32r2.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
rename to tools-uclibc/portage.mips32r2.vanilla/patches/sys-libs/uclibc/99-libc-add-isfdtype.patch
diff --git a/tools-uclibc/portage.mipsel3.hardened/patches/sys-libs/uclibc/00_fix-eventfd.patch b/tools-uclibc/portage.mipsel3.hardened/patches/sys-libs/uclibc/00_fix-eventfd.patch
deleted file mode 100644
index cfc64de..0000000
--- a/tools-uclibc/portage.mipsel3.hardened/patches/sys-libs/uclibc/00_fix-eventfd.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From e118373cbb58ba5ffa5fb6670957678d5b87cdb9 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 10 Jun 2012 16:36:23 +0000
-Subject: eventfd: Implement eventfd2 and fix eventfd
-
-eventfd: evntfd assumes to take two arguments instead it
-should be one evntfd expects two therefore implement both syscalls with
-correct parameters
-
-Thanks Eugene Rudoy for reporting it and also providing the patch
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-diff --git a/libc/sysdeps/linux/common/eventfd.c b/libc/sysdeps/linux/common/eventfd.c
-index cc3f3f0..96597ab 100644
---- a/libc/sysdeps/linux/common/eventfd.c
-+++ b/libc/sysdeps/linux/common/eventfd.c
-@@ -7,12 +7,24 @@
- * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- */
-
-+#include <errno.h>
- #include <sys/syscall.h>
- #include <sys/eventfd.h>
-
- /*
- * eventfd()
- */
--#ifdef __NR_eventfd
--_syscall2(int, eventfd, int, count, int, flags)
-+#if defined __NR_eventfd || defined __NR_eventfd2
-+int eventfd (int count, int flags)
-+{
-+#if defined __NR_eventfd2
-+ return INLINE_SYSCALL (eventfd2, 2, count, flags);
-+#elif defined __NR_eventfd
-+ if (flags != 0) {
-+ __set_errno (EINVAL);
-+ return -1;
-+ }
-+ return INLINE_SYSCALL (eventfd, 1, count);
-+#endif
-+}
- #endif
-diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c
-index 3567b07..1fc2393 100644
---- a/libc/sysdeps/linux/common/stubs.c
-+++ b/libc/sysdeps/linux/common/stubs.c
-@@ -110,7 +110,7 @@ make_stub(epoll_pwait)
- make_stub(epoll_wait)
- #endif
-
--#if !defined __NR_eventfd && defined __UCLIBC_LINUX_SPECIFIC__
-+#if !defined __NR_eventfd && !defined __NR_eventfd2 && defined __UCLIBC_LINUX_SPECIFIC__
- make_stub(eventfd)
- #endif
-
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.mipsel3.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch b/tools-uclibc/portage.mipsel3.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
deleted file mode 100644
index 7ea9486..0000000
--- a/tools-uclibc/portage.mipsel3.hardened/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
+++ /dev/null
@@ -1,215 +0,0 @@
-From 342a3d861fde5651ee53486addbacddcec6a0a58 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <natanael.copa@gmail.com>
-Date: Sat, 04 Aug 2012 17:32:45 +0000
-Subject: pread/pwrite: backport fix
-
-pread/pwrite syscalls has been renamed to pread64/pwrite in 2.6 kernel.
-
-There was a fallback function using lseek for kernels who did not have
-this syscall (pre 2.1.60). This is broken in many ways.
-
-uclibc have been using the broken fallback due to they forgot to rename
-pread syscall.
-
-This got detected with git-1.7.11 which introduced threaded index-pack
-which broke in similar ways a windows (msys).
-
-This issue in uclibc have been reported upstream and fixed in git master
-so this patch does not need to be upstreamed. It might be an idea to
-backport it properly for 0.9.33 branch though.
-
-Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
-diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
-index 88e6957..baf8691 100644
---- a/libc/sysdeps/linux/common/pread_write.c
-+++ b/libc/sysdeps/linux/common/pread_write.c
-@@ -17,6 +17,7 @@
- #include <unistd.h>
- #include <stdint.h>
- #include <endian.h>
-+#include <sysdep-cancel.h>
-
- extern __typeof(pread) __libc_pread;
- extern __typeof(pwrite) __libc_pwrite;
-@@ -27,15 +28,17 @@ extern __typeof(pwrite64) __libc_pwrite64;
-
- #include <bits/kernel_types.h>
-
--#ifdef __NR_pread
--
--# define __NR___syscall_pread __NR_pread
-+# define __NR___syscall_pread __NR_pread64
- 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
-+
- }
- weak_alias(__libc_pread,pread)
-
-@@ -44,22 +47,24 @@ 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
- }
- weak_alias(__libc_pread64,pread64)
- # endif /* __UCLIBC_HAS_LFS__ */
-
--#endif /* __NR_pread */
--
--#ifdef __NR_pwrite
--
--# define __NR___syscall_pwrite __NR_pwrite
-+# define __NR___syscall_pwrite __NR_pwrite64
- 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
- }
- weak_alias(__libc_pwrite,pwrite)
-
-@@ -68,120 +73,10 @@ 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);
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low));
-+ LIBC_CANCEL_RESET (oldtype);
- 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 */
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.mipsel3.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch b/tools-uclibc/portage.mipsel3.hardened/patches/sys-libs/uclibc/99-libc-add-isfdtype.patch
similarity index 100%
rename from tools-uclibc/portage.mipsel3.hardened/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
rename to tools-uclibc/portage.mipsel3.hardened/patches/sys-libs/uclibc/99-libc-add-isfdtype.patch
diff --git a/tools-uclibc/portage.mipsel3.vanilla/patches/sys-libs/uclibc/00_fix-eventfd.patch b/tools-uclibc/portage.mipsel3.vanilla/patches/sys-libs/uclibc/00_fix-eventfd.patch
deleted file mode 100644
index cfc64de..0000000
--- a/tools-uclibc/portage.mipsel3.vanilla/patches/sys-libs/uclibc/00_fix-eventfd.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From e118373cbb58ba5ffa5fb6670957678d5b87cdb9 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 10 Jun 2012 16:36:23 +0000
-Subject: eventfd: Implement eventfd2 and fix eventfd
-
-eventfd: evntfd assumes to take two arguments instead it
-should be one evntfd expects two therefore implement both syscalls with
-correct parameters
-
-Thanks Eugene Rudoy for reporting it and also providing the patch
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-diff --git a/libc/sysdeps/linux/common/eventfd.c b/libc/sysdeps/linux/common/eventfd.c
-index cc3f3f0..96597ab 100644
---- a/libc/sysdeps/linux/common/eventfd.c
-+++ b/libc/sysdeps/linux/common/eventfd.c
-@@ -7,12 +7,24 @@
- * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- */
-
-+#include <errno.h>
- #include <sys/syscall.h>
- #include <sys/eventfd.h>
-
- /*
- * eventfd()
- */
--#ifdef __NR_eventfd
--_syscall2(int, eventfd, int, count, int, flags)
-+#if defined __NR_eventfd || defined __NR_eventfd2
-+int eventfd (int count, int flags)
-+{
-+#if defined __NR_eventfd2
-+ return INLINE_SYSCALL (eventfd2, 2, count, flags);
-+#elif defined __NR_eventfd
-+ if (flags != 0) {
-+ __set_errno (EINVAL);
-+ return -1;
-+ }
-+ return INLINE_SYSCALL (eventfd, 1, count);
-+#endif
-+}
- #endif
-diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c
-index 3567b07..1fc2393 100644
---- a/libc/sysdeps/linux/common/stubs.c
-+++ b/libc/sysdeps/linux/common/stubs.c
-@@ -110,7 +110,7 @@ make_stub(epoll_pwait)
- make_stub(epoll_wait)
- #endif
-
--#if !defined __NR_eventfd && defined __UCLIBC_LINUX_SPECIFIC__
-+#if !defined __NR_eventfd && !defined __NR_eventfd2 && defined __UCLIBC_LINUX_SPECIFIC__
- make_stub(eventfd)
- #endif
-
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.mipsel3.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch b/tools-uclibc/portage.mipsel3.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
deleted file mode 100644
index 7ea9486..0000000
--- a/tools-uclibc/portage.mipsel3.vanilla/patches/sys-libs/uclibc/03-pread_pwrite-backport.patch
+++ /dev/null
@@ -1,215 +0,0 @@
-From 342a3d861fde5651ee53486addbacddcec6a0a58 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <natanael.copa@gmail.com>
-Date: Sat, 04 Aug 2012 17:32:45 +0000
-Subject: pread/pwrite: backport fix
-
-pread/pwrite syscalls has been renamed to pread64/pwrite in 2.6 kernel.
-
-There was a fallback function using lseek for kernels who did not have
-this syscall (pre 2.1.60). This is broken in many ways.
-
-uclibc have been using the broken fallback due to they forgot to rename
-pread syscall.
-
-This got detected with git-1.7.11 which introduced threaded index-pack
-which broke in similar ways a windows (msys).
-
-This issue in uclibc have been reported upstream and fixed in git master
-so this patch does not need to be upstreamed. It might be an idea to
-backport it properly for 0.9.33 branch though.
-
-Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
-diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
-index 88e6957..baf8691 100644
---- a/libc/sysdeps/linux/common/pread_write.c
-+++ b/libc/sysdeps/linux/common/pread_write.c
-@@ -17,6 +17,7 @@
- #include <unistd.h>
- #include <stdint.h>
- #include <endian.h>
-+#include <sysdep-cancel.h>
-
- extern __typeof(pread) __libc_pread;
- extern __typeof(pwrite) __libc_pwrite;
-@@ -27,15 +28,17 @@ extern __typeof(pwrite64) __libc_pwrite64;
-
- #include <bits/kernel_types.h>
-
--#ifdef __NR_pread
--
--# define __NR___syscall_pread __NR_pread
-+# define __NR___syscall_pread __NR_pread64
- 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
-+
- }
- weak_alias(__libc_pread,pread)
-
-@@ -44,22 +47,24 @@ 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(high, low));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
- }
- weak_alias(__libc_pread64,pread64)
- # endif /* __UCLIBC_HAS_LFS__ */
-
--#endif /* __NR_pread */
--
--#ifdef __NR_pwrite
--
--# define __NR___syscall_pwrite __NR_pwrite
-+# define __NR___syscall_pwrite __NR_pwrite64
- 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));
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
-+ LIBC_CANCEL_RESET (oldtype);
-+ return result;
- }
- weak_alias(__libc_pwrite,pwrite)
-
-@@ -68,120 +73,10 @@ 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);
-+ int oldtype = LIBC_CANCEL_ASYNC ();
-+ int result = __syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR(high, low));
-+ LIBC_CANCEL_RESET (oldtype);
- 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 */
---
-cgit v0.9.1
diff --git a/tools-uclibc/portage.mipsel3.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch b/tools-uclibc/portage.mipsel3.vanilla/patches/sys-libs/uclibc/99-libc-add-isfdtype.patch
similarity index 100%
rename from tools-uclibc/portage.mipsel3.vanilla/patches/sys-libs/uclibc/02-libc-add-isfdtype.patch
rename to tools-uclibc/portage.mipsel3.vanilla/patches/sys-libs/uclibc/99-libc-add-isfdtype.patch
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] proj/releng:master commit in: tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/, ...
@ 2014-04-26 14:32 Anthony G. Basile
0 siblings, 0 replies; 7+ messages in thread
From: Anthony G. Basile @ 2014-04-26 14:32 UTC (permalink / raw
To: gentoo-commits
commit: 7b5960b0b4ea310676849f4530b9c14ce925ba87
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 26 14:32:33 2014 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sat Apr 26 14:32:33 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/releng.git;a=commit;h=7b5960b0
tools-uclibc: update uClibc's mount.h, bug #508522
---
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ++++++++++++++++++++++
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ++++++++++++++++++++++
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ++++++++++++++++++++++
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ++++++++++++++++++++++
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ++++++++++++++++++++++
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ++++++++++++++++++++++
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ++++++++++++++++++++++
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ++++++++++++++++++++++
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ++++++++++++++++++++++
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ++++++++++++++++++++++
10 files changed, 910 insertions(+)
diff --git a/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
new file mode 100644
index 0000000..85c2c3a
--- /dev/null
+++ b/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
@@ -0,0 +1,91 @@
+From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
+From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+Date: Fri, 18 Jan 2013 11:12:49 +0100
+Subject: [PATCH] mount.h: update
+
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+ include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 35 insertions(+), 10 deletions(-)
+
+diff --git a/include/sys/mount.h b/include/sys/mount.h
+index fbd61fd..c0e7b84 100644
+--- a/include/sys/mount.h
++++ b/include/sys/mount.h
+@@ -1,5 +1,5 @@
+ /* Header file for mounting/unmount Linux filesystems.
+- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
++ Copyright (C) 1996-2000, 2004, 2010, 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
+@@ -46,23 +46,46 @@ enum
+ #define MS_REMOUNT MS_REMOUNT
+ MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
+ #define MS_MANDLOCK MS_MANDLOCK
+- S_WRITE = 128, /* Write on file/directory/symlink. */
+-#define S_WRITE S_WRITE
+- S_APPEND = 256, /* Append-only file. */
+-#define S_APPEND S_APPEND
+- S_IMMUTABLE = 512, /* Immutable file. */
+-#define S_IMMUTABLE S_IMMUTABLE
++ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
++#define MS_DIRSYNC MS_DIRSYNC
+ MS_NOATIME = 1024, /* Do not update access times. */
+ #define MS_NOATIME MS_NOATIME
+ MS_NODIRATIME = 2048, /* Do not update directory access times. */
+ #define MS_NODIRATIME MS_NODIRATIME
+ MS_BIND = 4096, /* Bind directory at different place. */
+ #define MS_BIND MS_BIND
++ MS_MOVE = 8192,
++#define MS_MOVE MS_MOVE
++ MS_REC = 16384,
++#define MS_REC MS_REC
++ MS_SILENT = 32768,
++#define MS_SILENT MS_SILENT
++ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
++#define MS_POSIXACL MS_POSIXACL
++ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
++#define MS_UNBINDABLE MS_UNBINDABLE
++ MS_PRIVATE = 1 << 18, /* Change to private. */
++#define MS_PRIVATE MS_PRIVATE
++ MS_SLAVE = 1 << 19, /* Change to slave. */
++#define MS_SLAVE MS_SLAVE
++ MS_SHARED = 1 << 20, /* Change to shared. */
++#define MS_SHARED MS_SHARED
++ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
++#define MS_RELATIME MS_RELATIME
++ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
++#define MS_KERNMOUNT MS_KERNMOUNT
++ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
++#define MS_I_VERSION MS_I_VERSION
++ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
++#define MS_STRICTATIME MS_STRICTATIME
++ MS_ACTIVE = 1 << 30,
++#define MS_ACTIVE MS_ACTIVE
++ MS_NOUSER = 1 << 31
++#define MS_NOUSER MS_NOUSER
+ };
+
+ /* Flags that can be altered by MS_REMOUNT */
+-#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
+- |MS_NODIRATIME)
++#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
+
+
+ /* Magic mount flag number. Has to be or-ed to the flag values. */
+@@ -99,8 +122,10 @@ enum
+ #define MNT_FORCE MNT_FORCE
+ MNT_DETACH = 2, /* Just detach from the tree. */
+ #define MNT_DETACH MNT_DETACH
+- MNT_EXPIRE = 4 /* Mark for expiry. */
++ MNT_EXPIRE = 4, /* Mark for expiry. */
+ #define MNT_EXPIRE MNT_EXPIRE
++ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
++#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
+ };
+
+
+--
+1.8.3.2
+
diff --git a/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
new file mode 100644
index 0000000..85c2c3a
--- /dev/null
+++ b/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
@@ -0,0 +1,91 @@
+From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
+From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+Date: Fri, 18 Jan 2013 11:12:49 +0100
+Subject: [PATCH] mount.h: update
+
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+ include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 35 insertions(+), 10 deletions(-)
+
+diff --git a/include/sys/mount.h b/include/sys/mount.h
+index fbd61fd..c0e7b84 100644
+--- a/include/sys/mount.h
++++ b/include/sys/mount.h
+@@ -1,5 +1,5 @@
+ /* Header file for mounting/unmount Linux filesystems.
+- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
++ Copyright (C) 1996-2000, 2004, 2010, 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
+@@ -46,23 +46,46 @@ enum
+ #define MS_REMOUNT MS_REMOUNT
+ MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
+ #define MS_MANDLOCK MS_MANDLOCK
+- S_WRITE = 128, /* Write on file/directory/symlink. */
+-#define S_WRITE S_WRITE
+- S_APPEND = 256, /* Append-only file. */
+-#define S_APPEND S_APPEND
+- S_IMMUTABLE = 512, /* Immutable file. */
+-#define S_IMMUTABLE S_IMMUTABLE
++ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
++#define MS_DIRSYNC MS_DIRSYNC
+ MS_NOATIME = 1024, /* Do not update access times. */
+ #define MS_NOATIME MS_NOATIME
+ MS_NODIRATIME = 2048, /* Do not update directory access times. */
+ #define MS_NODIRATIME MS_NODIRATIME
+ MS_BIND = 4096, /* Bind directory at different place. */
+ #define MS_BIND MS_BIND
++ MS_MOVE = 8192,
++#define MS_MOVE MS_MOVE
++ MS_REC = 16384,
++#define MS_REC MS_REC
++ MS_SILENT = 32768,
++#define MS_SILENT MS_SILENT
++ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
++#define MS_POSIXACL MS_POSIXACL
++ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
++#define MS_UNBINDABLE MS_UNBINDABLE
++ MS_PRIVATE = 1 << 18, /* Change to private. */
++#define MS_PRIVATE MS_PRIVATE
++ MS_SLAVE = 1 << 19, /* Change to slave. */
++#define MS_SLAVE MS_SLAVE
++ MS_SHARED = 1 << 20, /* Change to shared. */
++#define MS_SHARED MS_SHARED
++ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
++#define MS_RELATIME MS_RELATIME
++ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
++#define MS_KERNMOUNT MS_KERNMOUNT
++ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
++#define MS_I_VERSION MS_I_VERSION
++ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
++#define MS_STRICTATIME MS_STRICTATIME
++ MS_ACTIVE = 1 << 30,
++#define MS_ACTIVE MS_ACTIVE
++ MS_NOUSER = 1 << 31
++#define MS_NOUSER MS_NOUSER
+ };
+
+ /* Flags that can be altered by MS_REMOUNT */
+-#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
+- |MS_NODIRATIME)
++#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
+
+
+ /* Magic mount flag number. Has to be or-ed to the flag values. */
+@@ -99,8 +122,10 @@ enum
+ #define MNT_FORCE MNT_FORCE
+ MNT_DETACH = 2, /* Just detach from the tree. */
+ #define MNT_DETACH MNT_DETACH
+- MNT_EXPIRE = 4 /* Mark for expiry. */
++ MNT_EXPIRE = 4, /* Mark for expiry. */
+ #define MNT_EXPIRE MNT_EXPIRE
++ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
++#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
+ };
+
+
+--
+1.8.3.2
+
diff --git a/tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
new file mode 100644
index 0000000..85c2c3a
--- /dev/null
+++ b/tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
@@ -0,0 +1,91 @@
+From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
+From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+Date: Fri, 18 Jan 2013 11:12:49 +0100
+Subject: [PATCH] mount.h: update
+
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+ include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 35 insertions(+), 10 deletions(-)
+
+diff --git a/include/sys/mount.h b/include/sys/mount.h
+index fbd61fd..c0e7b84 100644
+--- a/include/sys/mount.h
++++ b/include/sys/mount.h
+@@ -1,5 +1,5 @@
+ /* Header file for mounting/unmount Linux filesystems.
+- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
++ Copyright (C) 1996-2000, 2004, 2010, 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
+@@ -46,23 +46,46 @@ enum
+ #define MS_REMOUNT MS_REMOUNT
+ MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
+ #define MS_MANDLOCK MS_MANDLOCK
+- S_WRITE = 128, /* Write on file/directory/symlink. */
+-#define S_WRITE S_WRITE
+- S_APPEND = 256, /* Append-only file. */
+-#define S_APPEND S_APPEND
+- S_IMMUTABLE = 512, /* Immutable file. */
+-#define S_IMMUTABLE S_IMMUTABLE
++ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
++#define MS_DIRSYNC MS_DIRSYNC
+ MS_NOATIME = 1024, /* Do not update access times. */
+ #define MS_NOATIME MS_NOATIME
+ MS_NODIRATIME = 2048, /* Do not update directory access times. */
+ #define MS_NODIRATIME MS_NODIRATIME
+ MS_BIND = 4096, /* Bind directory at different place. */
+ #define MS_BIND MS_BIND
++ MS_MOVE = 8192,
++#define MS_MOVE MS_MOVE
++ MS_REC = 16384,
++#define MS_REC MS_REC
++ MS_SILENT = 32768,
++#define MS_SILENT MS_SILENT
++ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
++#define MS_POSIXACL MS_POSIXACL
++ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
++#define MS_UNBINDABLE MS_UNBINDABLE
++ MS_PRIVATE = 1 << 18, /* Change to private. */
++#define MS_PRIVATE MS_PRIVATE
++ MS_SLAVE = 1 << 19, /* Change to slave. */
++#define MS_SLAVE MS_SLAVE
++ MS_SHARED = 1 << 20, /* Change to shared. */
++#define MS_SHARED MS_SHARED
++ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
++#define MS_RELATIME MS_RELATIME
++ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
++#define MS_KERNMOUNT MS_KERNMOUNT
++ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
++#define MS_I_VERSION MS_I_VERSION
++ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
++#define MS_STRICTATIME MS_STRICTATIME
++ MS_ACTIVE = 1 << 30,
++#define MS_ACTIVE MS_ACTIVE
++ MS_NOUSER = 1 << 31
++#define MS_NOUSER MS_NOUSER
+ };
+
+ /* Flags that can be altered by MS_REMOUNT */
+-#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
+- |MS_NODIRATIME)
++#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
+
+
+ /* Magic mount flag number. Has to be or-ed to the flag values. */
+@@ -99,8 +122,10 @@ enum
+ #define MNT_FORCE MNT_FORCE
+ MNT_DETACH = 2, /* Just detach from the tree. */
+ #define MNT_DETACH MNT_DETACH
+- MNT_EXPIRE = 4 /* Mark for expiry. */
++ MNT_EXPIRE = 4, /* Mark for expiry. */
+ #define MNT_EXPIRE MNT_EXPIRE
++ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
++#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
+ };
+
+
+--
+1.8.3.2
+
diff --git a/tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
new file mode 100644
index 0000000..85c2c3a
--- /dev/null
+++ b/tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
@@ -0,0 +1,91 @@
+From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
+From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+Date: Fri, 18 Jan 2013 11:12:49 +0100
+Subject: [PATCH] mount.h: update
+
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+ include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 35 insertions(+), 10 deletions(-)
+
+diff --git a/include/sys/mount.h b/include/sys/mount.h
+index fbd61fd..c0e7b84 100644
+--- a/include/sys/mount.h
++++ b/include/sys/mount.h
+@@ -1,5 +1,5 @@
+ /* Header file for mounting/unmount Linux filesystems.
+- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
++ Copyright (C) 1996-2000, 2004, 2010, 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
+@@ -46,23 +46,46 @@ enum
+ #define MS_REMOUNT MS_REMOUNT
+ MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
+ #define MS_MANDLOCK MS_MANDLOCK
+- S_WRITE = 128, /* Write on file/directory/symlink. */
+-#define S_WRITE S_WRITE
+- S_APPEND = 256, /* Append-only file. */
+-#define S_APPEND S_APPEND
+- S_IMMUTABLE = 512, /* Immutable file. */
+-#define S_IMMUTABLE S_IMMUTABLE
++ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
++#define MS_DIRSYNC MS_DIRSYNC
+ MS_NOATIME = 1024, /* Do not update access times. */
+ #define MS_NOATIME MS_NOATIME
+ MS_NODIRATIME = 2048, /* Do not update directory access times. */
+ #define MS_NODIRATIME MS_NODIRATIME
+ MS_BIND = 4096, /* Bind directory at different place. */
+ #define MS_BIND MS_BIND
++ MS_MOVE = 8192,
++#define MS_MOVE MS_MOVE
++ MS_REC = 16384,
++#define MS_REC MS_REC
++ MS_SILENT = 32768,
++#define MS_SILENT MS_SILENT
++ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
++#define MS_POSIXACL MS_POSIXACL
++ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
++#define MS_UNBINDABLE MS_UNBINDABLE
++ MS_PRIVATE = 1 << 18, /* Change to private. */
++#define MS_PRIVATE MS_PRIVATE
++ MS_SLAVE = 1 << 19, /* Change to slave. */
++#define MS_SLAVE MS_SLAVE
++ MS_SHARED = 1 << 20, /* Change to shared. */
++#define MS_SHARED MS_SHARED
++ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
++#define MS_RELATIME MS_RELATIME
++ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
++#define MS_KERNMOUNT MS_KERNMOUNT
++ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
++#define MS_I_VERSION MS_I_VERSION
++ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
++#define MS_STRICTATIME MS_STRICTATIME
++ MS_ACTIVE = 1 << 30,
++#define MS_ACTIVE MS_ACTIVE
++ MS_NOUSER = 1 << 31
++#define MS_NOUSER MS_NOUSER
+ };
+
+ /* Flags that can be altered by MS_REMOUNT */
+-#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
+- |MS_NODIRATIME)
++#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
+
+
+ /* Magic mount flag number. Has to be or-ed to the flag values. */
+@@ -99,8 +122,10 @@ enum
+ #define MNT_FORCE MNT_FORCE
+ MNT_DETACH = 2, /* Just detach from the tree. */
+ #define MNT_DETACH MNT_DETACH
+- MNT_EXPIRE = 4 /* Mark for expiry. */
++ MNT_EXPIRE = 4, /* Mark for expiry. */
+ #define MNT_EXPIRE MNT_EXPIRE
++ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
++#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
+ };
+
+
+--
+1.8.3.2
+
diff --git a/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
new file mode 100644
index 0000000..85c2c3a
--- /dev/null
+++ b/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
@@ -0,0 +1,91 @@
+From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
+From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+Date: Fri, 18 Jan 2013 11:12:49 +0100
+Subject: [PATCH] mount.h: update
+
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+ include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 35 insertions(+), 10 deletions(-)
+
+diff --git a/include/sys/mount.h b/include/sys/mount.h
+index fbd61fd..c0e7b84 100644
+--- a/include/sys/mount.h
++++ b/include/sys/mount.h
+@@ -1,5 +1,5 @@
+ /* Header file for mounting/unmount Linux filesystems.
+- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
++ Copyright (C) 1996-2000, 2004, 2010, 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
+@@ -46,23 +46,46 @@ enum
+ #define MS_REMOUNT MS_REMOUNT
+ MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
+ #define MS_MANDLOCK MS_MANDLOCK
+- S_WRITE = 128, /* Write on file/directory/symlink. */
+-#define S_WRITE S_WRITE
+- S_APPEND = 256, /* Append-only file. */
+-#define S_APPEND S_APPEND
+- S_IMMUTABLE = 512, /* Immutable file. */
+-#define S_IMMUTABLE S_IMMUTABLE
++ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
++#define MS_DIRSYNC MS_DIRSYNC
+ MS_NOATIME = 1024, /* Do not update access times. */
+ #define MS_NOATIME MS_NOATIME
+ MS_NODIRATIME = 2048, /* Do not update directory access times. */
+ #define MS_NODIRATIME MS_NODIRATIME
+ MS_BIND = 4096, /* Bind directory at different place. */
+ #define MS_BIND MS_BIND
++ MS_MOVE = 8192,
++#define MS_MOVE MS_MOVE
++ MS_REC = 16384,
++#define MS_REC MS_REC
++ MS_SILENT = 32768,
++#define MS_SILENT MS_SILENT
++ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
++#define MS_POSIXACL MS_POSIXACL
++ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
++#define MS_UNBINDABLE MS_UNBINDABLE
++ MS_PRIVATE = 1 << 18, /* Change to private. */
++#define MS_PRIVATE MS_PRIVATE
++ MS_SLAVE = 1 << 19, /* Change to slave. */
++#define MS_SLAVE MS_SLAVE
++ MS_SHARED = 1 << 20, /* Change to shared. */
++#define MS_SHARED MS_SHARED
++ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
++#define MS_RELATIME MS_RELATIME
++ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
++#define MS_KERNMOUNT MS_KERNMOUNT
++ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
++#define MS_I_VERSION MS_I_VERSION
++ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
++#define MS_STRICTATIME MS_STRICTATIME
++ MS_ACTIVE = 1 << 30,
++#define MS_ACTIVE MS_ACTIVE
++ MS_NOUSER = 1 << 31
++#define MS_NOUSER MS_NOUSER
+ };
+
+ /* Flags that can be altered by MS_REMOUNT */
+-#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
+- |MS_NODIRATIME)
++#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
+
+
+ /* Magic mount flag number. Has to be or-ed to the flag values. */
+@@ -99,8 +122,10 @@ enum
+ #define MNT_FORCE MNT_FORCE
+ MNT_DETACH = 2, /* Just detach from the tree. */
+ #define MNT_DETACH MNT_DETACH
+- MNT_EXPIRE = 4 /* Mark for expiry. */
++ MNT_EXPIRE = 4, /* Mark for expiry. */
+ #define MNT_EXPIRE MNT_EXPIRE
++ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
++#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
+ };
+
+
+--
+1.8.3.2
+
diff --git a/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
new file mode 100644
index 0000000..85c2c3a
--- /dev/null
+++ b/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
@@ -0,0 +1,91 @@
+From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
+From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+Date: Fri, 18 Jan 2013 11:12:49 +0100
+Subject: [PATCH] mount.h: update
+
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+ include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 35 insertions(+), 10 deletions(-)
+
+diff --git a/include/sys/mount.h b/include/sys/mount.h
+index fbd61fd..c0e7b84 100644
+--- a/include/sys/mount.h
++++ b/include/sys/mount.h
+@@ -1,5 +1,5 @@
+ /* Header file for mounting/unmount Linux filesystems.
+- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
++ Copyright (C) 1996-2000, 2004, 2010, 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
+@@ -46,23 +46,46 @@ enum
+ #define MS_REMOUNT MS_REMOUNT
+ MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
+ #define MS_MANDLOCK MS_MANDLOCK
+- S_WRITE = 128, /* Write on file/directory/symlink. */
+-#define S_WRITE S_WRITE
+- S_APPEND = 256, /* Append-only file. */
+-#define S_APPEND S_APPEND
+- S_IMMUTABLE = 512, /* Immutable file. */
+-#define S_IMMUTABLE S_IMMUTABLE
++ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
++#define MS_DIRSYNC MS_DIRSYNC
+ MS_NOATIME = 1024, /* Do not update access times. */
+ #define MS_NOATIME MS_NOATIME
+ MS_NODIRATIME = 2048, /* Do not update directory access times. */
+ #define MS_NODIRATIME MS_NODIRATIME
+ MS_BIND = 4096, /* Bind directory at different place. */
+ #define MS_BIND MS_BIND
++ MS_MOVE = 8192,
++#define MS_MOVE MS_MOVE
++ MS_REC = 16384,
++#define MS_REC MS_REC
++ MS_SILENT = 32768,
++#define MS_SILENT MS_SILENT
++ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
++#define MS_POSIXACL MS_POSIXACL
++ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
++#define MS_UNBINDABLE MS_UNBINDABLE
++ MS_PRIVATE = 1 << 18, /* Change to private. */
++#define MS_PRIVATE MS_PRIVATE
++ MS_SLAVE = 1 << 19, /* Change to slave. */
++#define MS_SLAVE MS_SLAVE
++ MS_SHARED = 1 << 20, /* Change to shared. */
++#define MS_SHARED MS_SHARED
++ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
++#define MS_RELATIME MS_RELATIME
++ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
++#define MS_KERNMOUNT MS_KERNMOUNT
++ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
++#define MS_I_VERSION MS_I_VERSION
++ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
++#define MS_STRICTATIME MS_STRICTATIME
++ MS_ACTIVE = 1 << 30,
++#define MS_ACTIVE MS_ACTIVE
++ MS_NOUSER = 1 << 31
++#define MS_NOUSER MS_NOUSER
+ };
+
+ /* Flags that can be altered by MS_REMOUNT */
+-#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
+- |MS_NODIRATIME)
++#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
+
+
+ /* Magic mount flag number. Has to be or-ed to the flag values. */
+@@ -99,8 +122,10 @@ enum
+ #define MNT_FORCE MNT_FORCE
+ MNT_DETACH = 2, /* Just detach from the tree. */
+ #define MNT_DETACH MNT_DETACH
+- MNT_EXPIRE = 4 /* Mark for expiry. */
++ MNT_EXPIRE = 4, /* Mark for expiry. */
+ #define MNT_EXPIRE MNT_EXPIRE
++ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
++#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
+ };
+
+
+--
+1.8.3.2
+
diff --git a/tools-uclibc/portage.mips32r2.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.mips32r2.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
new file mode 100644
index 0000000..85c2c3a
--- /dev/null
+++ b/tools-uclibc/portage.mips32r2.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
@@ -0,0 +1,91 @@
+From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
+From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+Date: Fri, 18 Jan 2013 11:12:49 +0100
+Subject: [PATCH] mount.h: update
+
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+ include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 35 insertions(+), 10 deletions(-)
+
+diff --git a/include/sys/mount.h b/include/sys/mount.h
+index fbd61fd..c0e7b84 100644
+--- a/include/sys/mount.h
++++ b/include/sys/mount.h
+@@ -1,5 +1,5 @@
+ /* Header file for mounting/unmount Linux filesystems.
+- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
++ Copyright (C) 1996-2000, 2004, 2010, 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
+@@ -46,23 +46,46 @@ enum
+ #define MS_REMOUNT MS_REMOUNT
+ MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
+ #define MS_MANDLOCK MS_MANDLOCK
+- S_WRITE = 128, /* Write on file/directory/symlink. */
+-#define S_WRITE S_WRITE
+- S_APPEND = 256, /* Append-only file. */
+-#define S_APPEND S_APPEND
+- S_IMMUTABLE = 512, /* Immutable file. */
+-#define S_IMMUTABLE S_IMMUTABLE
++ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
++#define MS_DIRSYNC MS_DIRSYNC
+ MS_NOATIME = 1024, /* Do not update access times. */
+ #define MS_NOATIME MS_NOATIME
+ MS_NODIRATIME = 2048, /* Do not update directory access times. */
+ #define MS_NODIRATIME MS_NODIRATIME
+ MS_BIND = 4096, /* Bind directory at different place. */
+ #define MS_BIND MS_BIND
++ MS_MOVE = 8192,
++#define MS_MOVE MS_MOVE
++ MS_REC = 16384,
++#define MS_REC MS_REC
++ MS_SILENT = 32768,
++#define MS_SILENT MS_SILENT
++ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
++#define MS_POSIXACL MS_POSIXACL
++ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
++#define MS_UNBINDABLE MS_UNBINDABLE
++ MS_PRIVATE = 1 << 18, /* Change to private. */
++#define MS_PRIVATE MS_PRIVATE
++ MS_SLAVE = 1 << 19, /* Change to slave. */
++#define MS_SLAVE MS_SLAVE
++ MS_SHARED = 1 << 20, /* Change to shared. */
++#define MS_SHARED MS_SHARED
++ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
++#define MS_RELATIME MS_RELATIME
++ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
++#define MS_KERNMOUNT MS_KERNMOUNT
++ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
++#define MS_I_VERSION MS_I_VERSION
++ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
++#define MS_STRICTATIME MS_STRICTATIME
++ MS_ACTIVE = 1 << 30,
++#define MS_ACTIVE MS_ACTIVE
++ MS_NOUSER = 1 << 31
++#define MS_NOUSER MS_NOUSER
+ };
+
+ /* Flags that can be altered by MS_REMOUNT */
+-#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
+- |MS_NODIRATIME)
++#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
+
+
+ /* Magic mount flag number. Has to be or-ed to the flag values. */
+@@ -99,8 +122,10 @@ enum
+ #define MNT_FORCE MNT_FORCE
+ MNT_DETACH = 2, /* Just detach from the tree. */
+ #define MNT_DETACH MNT_DETACH
+- MNT_EXPIRE = 4 /* Mark for expiry. */
++ MNT_EXPIRE = 4, /* Mark for expiry. */
+ #define MNT_EXPIRE MNT_EXPIRE
++ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
++#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
+ };
+
+
+--
+1.8.3.2
+
diff --git a/tools-uclibc/portage.mips32r2.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.mips32r2.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
new file mode 100644
index 0000000..85c2c3a
--- /dev/null
+++ b/tools-uclibc/portage.mips32r2.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
@@ -0,0 +1,91 @@
+From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
+From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+Date: Fri, 18 Jan 2013 11:12:49 +0100
+Subject: [PATCH] mount.h: update
+
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+ include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 35 insertions(+), 10 deletions(-)
+
+diff --git a/include/sys/mount.h b/include/sys/mount.h
+index fbd61fd..c0e7b84 100644
+--- a/include/sys/mount.h
++++ b/include/sys/mount.h
+@@ -1,5 +1,5 @@
+ /* Header file for mounting/unmount Linux filesystems.
+- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
++ Copyright (C) 1996-2000, 2004, 2010, 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
+@@ -46,23 +46,46 @@ enum
+ #define MS_REMOUNT MS_REMOUNT
+ MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
+ #define MS_MANDLOCK MS_MANDLOCK
+- S_WRITE = 128, /* Write on file/directory/symlink. */
+-#define S_WRITE S_WRITE
+- S_APPEND = 256, /* Append-only file. */
+-#define S_APPEND S_APPEND
+- S_IMMUTABLE = 512, /* Immutable file. */
+-#define S_IMMUTABLE S_IMMUTABLE
++ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
++#define MS_DIRSYNC MS_DIRSYNC
+ MS_NOATIME = 1024, /* Do not update access times. */
+ #define MS_NOATIME MS_NOATIME
+ MS_NODIRATIME = 2048, /* Do not update directory access times. */
+ #define MS_NODIRATIME MS_NODIRATIME
+ MS_BIND = 4096, /* Bind directory at different place. */
+ #define MS_BIND MS_BIND
++ MS_MOVE = 8192,
++#define MS_MOVE MS_MOVE
++ MS_REC = 16384,
++#define MS_REC MS_REC
++ MS_SILENT = 32768,
++#define MS_SILENT MS_SILENT
++ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
++#define MS_POSIXACL MS_POSIXACL
++ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
++#define MS_UNBINDABLE MS_UNBINDABLE
++ MS_PRIVATE = 1 << 18, /* Change to private. */
++#define MS_PRIVATE MS_PRIVATE
++ MS_SLAVE = 1 << 19, /* Change to slave. */
++#define MS_SLAVE MS_SLAVE
++ MS_SHARED = 1 << 20, /* Change to shared. */
++#define MS_SHARED MS_SHARED
++ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
++#define MS_RELATIME MS_RELATIME
++ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
++#define MS_KERNMOUNT MS_KERNMOUNT
++ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
++#define MS_I_VERSION MS_I_VERSION
++ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
++#define MS_STRICTATIME MS_STRICTATIME
++ MS_ACTIVE = 1 << 30,
++#define MS_ACTIVE MS_ACTIVE
++ MS_NOUSER = 1 << 31
++#define MS_NOUSER MS_NOUSER
+ };
+
+ /* Flags that can be altered by MS_REMOUNT */
+-#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
+- |MS_NODIRATIME)
++#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
+
+
+ /* Magic mount flag number. Has to be or-ed to the flag values. */
+@@ -99,8 +122,10 @@ enum
+ #define MNT_FORCE MNT_FORCE
+ MNT_DETACH = 2, /* Just detach from the tree. */
+ #define MNT_DETACH MNT_DETACH
+- MNT_EXPIRE = 4 /* Mark for expiry. */
++ MNT_EXPIRE = 4, /* Mark for expiry. */
+ #define MNT_EXPIRE MNT_EXPIRE
++ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
++#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
+ };
+
+
+--
+1.8.3.2
+
diff --git a/tools-uclibc/portage.mipsel3.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.mipsel3.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
new file mode 100644
index 0000000..85c2c3a
--- /dev/null
+++ b/tools-uclibc/portage.mipsel3.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
@@ -0,0 +1,91 @@
+From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
+From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+Date: Fri, 18 Jan 2013 11:12:49 +0100
+Subject: [PATCH] mount.h: update
+
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+ include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 35 insertions(+), 10 deletions(-)
+
+diff --git a/include/sys/mount.h b/include/sys/mount.h
+index fbd61fd..c0e7b84 100644
+--- a/include/sys/mount.h
++++ b/include/sys/mount.h
+@@ -1,5 +1,5 @@
+ /* Header file for mounting/unmount Linux filesystems.
+- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
++ Copyright (C) 1996-2000, 2004, 2010, 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
+@@ -46,23 +46,46 @@ enum
+ #define MS_REMOUNT MS_REMOUNT
+ MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
+ #define MS_MANDLOCK MS_MANDLOCK
+- S_WRITE = 128, /* Write on file/directory/symlink. */
+-#define S_WRITE S_WRITE
+- S_APPEND = 256, /* Append-only file. */
+-#define S_APPEND S_APPEND
+- S_IMMUTABLE = 512, /* Immutable file. */
+-#define S_IMMUTABLE S_IMMUTABLE
++ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
++#define MS_DIRSYNC MS_DIRSYNC
+ MS_NOATIME = 1024, /* Do not update access times. */
+ #define MS_NOATIME MS_NOATIME
+ MS_NODIRATIME = 2048, /* Do not update directory access times. */
+ #define MS_NODIRATIME MS_NODIRATIME
+ MS_BIND = 4096, /* Bind directory at different place. */
+ #define MS_BIND MS_BIND
++ MS_MOVE = 8192,
++#define MS_MOVE MS_MOVE
++ MS_REC = 16384,
++#define MS_REC MS_REC
++ MS_SILENT = 32768,
++#define MS_SILENT MS_SILENT
++ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
++#define MS_POSIXACL MS_POSIXACL
++ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
++#define MS_UNBINDABLE MS_UNBINDABLE
++ MS_PRIVATE = 1 << 18, /* Change to private. */
++#define MS_PRIVATE MS_PRIVATE
++ MS_SLAVE = 1 << 19, /* Change to slave. */
++#define MS_SLAVE MS_SLAVE
++ MS_SHARED = 1 << 20, /* Change to shared. */
++#define MS_SHARED MS_SHARED
++ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
++#define MS_RELATIME MS_RELATIME
++ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
++#define MS_KERNMOUNT MS_KERNMOUNT
++ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
++#define MS_I_VERSION MS_I_VERSION
++ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
++#define MS_STRICTATIME MS_STRICTATIME
++ MS_ACTIVE = 1 << 30,
++#define MS_ACTIVE MS_ACTIVE
++ MS_NOUSER = 1 << 31
++#define MS_NOUSER MS_NOUSER
+ };
+
+ /* Flags that can be altered by MS_REMOUNT */
+-#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
+- |MS_NODIRATIME)
++#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
+
+
+ /* Magic mount flag number. Has to be or-ed to the flag values. */
+@@ -99,8 +122,10 @@ enum
+ #define MNT_FORCE MNT_FORCE
+ MNT_DETACH = 2, /* Just detach from the tree. */
+ #define MNT_DETACH MNT_DETACH
+- MNT_EXPIRE = 4 /* Mark for expiry. */
++ MNT_EXPIRE = 4, /* Mark for expiry. */
+ #define MNT_EXPIRE MNT_EXPIRE
++ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
++#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
+ };
+
+
+--
+1.8.3.2
+
diff --git a/tools-uclibc/portage.mipsel3.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.mipsel3.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
new file mode 100644
index 0000000..85c2c3a
--- /dev/null
+++ b/tools-uclibc/portage.mipsel3.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
@@ -0,0 +1,91 @@
+From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
+From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+Date: Fri, 18 Jan 2013 11:12:49 +0100
+Subject: [PATCH] mount.h: update
+
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+ include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 35 insertions(+), 10 deletions(-)
+
+diff --git a/include/sys/mount.h b/include/sys/mount.h
+index fbd61fd..c0e7b84 100644
+--- a/include/sys/mount.h
++++ b/include/sys/mount.h
+@@ -1,5 +1,5 @@
+ /* Header file for mounting/unmount Linux filesystems.
+- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
++ Copyright (C) 1996-2000, 2004, 2010, 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
+@@ -46,23 +46,46 @@ enum
+ #define MS_REMOUNT MS_REMOUNT
+ MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
+ #define MS_MANDLOCK MS_MANDLOCK
+- S_WRITE = 128, /* Write on file/directory/symlink. */
+-#define S_WRITE S_WRITE
+- S_APPEND = 256, /* Append-only file. */
+-#define S_APPEND S_APPEND
+- S_IMMUTABLE = 512, /* Immutable file. */
+-#define S_IMMUTABLE S_IMMUTABLE
++ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
++#define MS_DIRSYNC MS_DIRSYNC
+ MS_NOATIME = 1024, /* Do not update access times. */
+ #define MS_NOATIME MS_NOATIME
+ MS_NODIRATIME = 2048, /* Do not update directory access times. */
+ #define MS_NODIRATIME MS_NODIRATIME
+ MS_BIND = 4096, /* Bind directory at different place. */
+ #define MS_BIND MS_BIND
++ MS_MOVE = 8192,
++#define MS_MOVE MS_MOVE
++ MS_REC = 16384,
++#define MS_REC MS_REC
++ MS_SILENT = 32768,
++#define MS_SILENT MS_SILENT
++ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
++#define MS_POSIXACL MS_POSIXACL
++ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
++#define MS_UNBINDABLE MS_UNBINDABLE
++ MS_PRIVATE = 1 << 18, /* Change to private. */
++#define MS_PRIVATE MS_PRIVATE
++ MS_SLAVE = 1 << 19, /* Change to slave. */
++#define MS_SLAVE MS_SLAVE
++ MS_SHARED = 1 << 20, /* Change to shared. */
++#define MS_SHARED MS_SHARED
++ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
++#define MS_RELATIME MS_RELATIME
++ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
++#define MS_KERNMOUNT MS_KERNMOUNT
++ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
++#define MS_I_VERSION MS_I_VERSION
++ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
++#define MS_STRICTATIME MS_STRICTATIME
++ MS_ACTIVE = 1 << 30,
++#define MS_ACTIVE MS_ACTIVE
++ MS_NOUSER = 1 << 31
++#define MS_NOUSER MS_NOUSER
+ };
+
+ /* Flags that can be altered by MS_REMOUNT */
+-#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
+- |MS_NODIRATIME)
++#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
+
+
+ /* Magic mount flag number. Has to be or-ed to the flag values. */
+@@ -99,8 +122,10 @@ enum
+ #define MNT_FORCE MNT_FORCE
+ MNT_DETACH = 2, /* Just detach from the tree. */
+ #define MNT_DETACH MNT_DETACH
+- MNT_EXPIRE = 4 /* Mark for expiry. */
++ MNT_EXPIRE = 4, /* Mark for expiry. */
+ #define MNT_EXPIRE MNT_EXPIRE
++ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
++#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
+ };
+
+
+--
+1.8.3.2
+
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] proj/releng:master commit in: tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/, ...
@ 2014-08-08 13:18 Anthony G. Basile
0 siblings, 0 replies; 7+ messages in thread
From: Anthony G. Basile @ 2014-08-08 13:18 UTC (permalink / raw
To: gentoo-commits
commit: 290076f048ec05c50e64d341ad9e5df1c98a2a66
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 8 13:19:55 2014 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Fri Aug 8 13:19:55 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/releng.git;a=commit;h=290076f0
tools-uclibc: mount.h patch is in uclibc-0.9.33.2-r11
---
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ----------------------
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ----------------------
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ----------------------
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ----------------------
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ----------------------
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ----------------------
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ----------------------
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ----------------------
8 files changed, 728 deletions(-)
diff --git a/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
deleted file mode 100644
index 85c2c3a..0000000
--- a/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
-From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Fri, 18 Jan 2013 11:12:49 +0100
-Subject: [PATCH] mount.h: update
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
- include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
- 1 file changed, 35 insertions(+), 10 deletions(-)
-
-diff --git a/include/sys/mount.h b/include/sys/mount.h
-index fbd61fd..c0e7b84 100644
---- a/include/sys/mount.h
-+++ b/include/sys/mount.h
-@@ -1,5 +1,5 @@
- /* Header file for mounting/unmount Linux filesystems.
-- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
-+ Copyright (C) 1996-2000, 2004, 2010, 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
-@@ -46,23 +46,46 @@ enum
- #define MS_REMOUNT MS_REMOUNT
- MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
- #define MS_MANDLOCK MS_MANDLOCK
-- S_WRITE = 128, /* Write on file/directory/symlink. */
--#define S_WRITE S_WRITE
-- S_APPEND = 256, /* Append-only file. */
--#define S_APPEND S_APPEND
-- S_IMMUTABLE = 512, /* Immutable file. */
--#define S_IMMUTABLE S_IMMUTABLE
-+ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
-+#define MS_DIRSYNC MS_DIRSYNC
- MS_NOATIME = 1024, /* Do not update access times. */
- #define MS_NOATIME MS_NOATIME
- MS_NODIRATIME = 2048, /* Do not update directory access times. */
- #define MS_NODIRATIME MS_NODIRATIME
- MS_BIND = 4096, /* Bind directory at different place. */
- #define MS_BIND MS_BIND
-+ MS_MOVE = 8192,
-+#define MS_MOVE MS_MOVE
-+ MS_REC = 16384,
-+#define MS_REC MS_REC
-+ MS_SILENT = 32768,
-+#define MS_SILENT MS_SILENT
-+ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
-+#define MS_POSIXACL MS_POSIXACL
-+ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
-+#define MS_UNBINDABLE MS_UNBINDABLE
-+ MS_PRIVATE = 1 << 18, /* Change to private. */
-+#define MS_PRIVATE MS_PRIVATE
-+ MS_SLAVE = 1 << 19, /* Change to slave. */
-+#define MS_SLAVE MS_SLAVE
-+ MS_SHARED = 1 << 20, /* Change to shared. */
-+#define MS_SHARED MS_SHARED
-+ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
-+#define MS_RELATIME MS_RELATIME
-+ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
-+#define MS_KERNMOUNT MS_KERNMOUNT
-+ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
-+#define MS_I_VERSION MS_I_VERSION
-+ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
-+#define MS_STRICTATIME MS_STRICTATIME
-+ MS_ACTIVE = 1 << 30,
-+#define MS_ACTIVE MS_ACTIVE
-+ MS_NOUSER = 1 << 31
-+#define MS_NOUSER MS_NOUSER
- };
-
- /* Flags that can be altered by MS_REMOUNT */
--#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
-- |MS_NODIRATIME)
-+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
-
-
- /* Magic mount flag number. Has to be or-ed to the flag values. */
-@@ -99,8 +122,10 @@ enum
- #define MNT_FORCE MNT_FORCE
- MNT_DETACH = 2, /* Just detach from the tree. */
- #define MNT_DETACH MNT_DETACH
-- MNT_EXPIRE = 4 /* Mark for expiry. */
-+ MNT_EXPIRE = 4, /* Mark for expiry. */
- #define MNT_EXPIRE MNT_EXPIRE
-+ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
-+#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
- };
-
-
---
-1.8.3.2
-
diff --git a/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
deleted file mode 100644
index 85c2c3a..0000000
--- a/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
-From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Fri, 18 Jan 2013 11:12:49 +0100
-Subject: [PATCH] mount.h: update
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
- include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
- 1 file changed, 35 insertions(+), 10 deletions(-)
-
-diff --git a/include/sys/mount.h b/include/sys/mount.h
-index fbd61fd..c0e7b84 100644
---- a/include/sys/mount.h
-+++ b/include/sys/mount.h
-@@ -1,5 +1,5 @@
- /* Header file for mounting/unmount Linux filesystems.
-- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
-+ Copyright (C) 1996-2000, 2004, 2010, 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
-@@ -46,23 +46,46 @@ enum
- #define MS_REMOUNT MS_REMOUNT
- MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
- #define MS_MANDLOCK MS_MANDLOCK
-- S_WRITE = 128, /* Write on file/directory/symlink. */
--#define S_WRITE S_WRITE
-- S_APPEND = 256, /* Append-only file. */
--#define S_APPEND S_APPEND
-- S_IMMUTABLE = 512, /* Immutable file. */
--#define S_IMMUTABLE S_IMMUTABLE
-+ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
-+#define MS_DIRSYNC MS_DIRSYNC
- MS_NOATIME = 1024, /* Do not update access times. */
- #define MS_NOATIME MS_NOATIME
- MS_NODIRATIME = 2048, /* Do not update directory access times. */
- #define MS_NODIRATIME MS_NODIRATIME
- MS_BIND = 4096, /* Bind directory at different place. */
- #define MS_BIND MS_BIND
-+ MS_MOVE = 8192,
-+#define MS_MOVE MS_MOVE
-+ MS_REC = 16384,
-+#define MS_REC MS_REC
-+ MS_SILENT = 32768,
-+#define MS_SILENT MS_SILENT
-+ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
-+#define MS_POSIXACL MS_POSIXACL
-+ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
-+#define MS_UNBINDABLE MS_UNBINDABLE
-+ MS_PRIVATE = 1 << 18, /* Change to private. */
-+#define MS_PRIVATE MS_PRIVATE
-+ MS_SLAVE = 1 << 19, /* Change to slave. */
-+#define MS_SLAVE MS_SLAVE
-+ MS_SHARED = 1 << 20, /* Change to shared. */
-+#define MS_SHARED MS_SHARED
-+ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
-+#define MS_RELATIME MS_RELATIME
-+ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
-+#define MS_KERNMOUNT MS_KERNMOUNT
-+ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
-+#define MS_I_VERSION MS_I_VERSION
-+ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
-+#define MS_STRICTATIME MS_STRICTATIME
-+ MS_ACTIVE = 1 << 30,
-+#define MS_ACTIVE MS_ACTIVE
-+ MS_NOUSER = 1 << 31
-+#define MS_NOUSER MS_NOUSER
- };
-
- /* Flags that can be altered by MS_REMOUNT */
--#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
-- |MS_NODIRATIME)
-+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
-
-
- /* Magic mount flag number. Has to be or-ed to the flag values. */
-@@ -99,8 +122,10 @@ enum
- #define MNT_FORCE MNT_FORCE
- MNT_DETACH = 2, /* Just detach from the tree. */
- #define MNT_DETACH MNT_DETACH
-- MNT_EXPIRE = 4 /* Mark for expiry. */
-+ MNT_EXPIRE = 4, /* Mark for expiry. */
- #define MNT_EXPIRE MNT_EXPIRE
-+ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
-+#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
- };
-
-
---
-1.8.3.2
-
diff --git a/tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
deleted file mode 100644
index 85c2c3a..0000000
--- a/tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
-From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Fri, 18 Jan 2013 11:12:49 +0100
-Subject: [PATCH] mount.h: update
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
- include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
- 1 file changed, 35 insertions(+), 10 deletions(-)
-
-diff --git a/include/sys/mount.h b/include/sys/mount.h
-index fbd61fd..c0e7b84 100644
---- a/include/sys/mount.h
-+++ b/include/sys/mount.h
-@@ -1,5 +1,5 @@
- /* Header file for mounting/unmount Linux filesystems.
-- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
-+ Copyright (C) 1996-2000, 2004, 2010, 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
-@@ -46,23 +46,46 @@ enum
- #define MS_REMOUNT MS_REMOUNT
- MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
- #define MS_MANDLOCK MS_MANDLOCK
-- S_WRITE = 128, /* Write on file/directory/symlink. */
--#define S_WRITE S_WRITE
-- S_APPEND = 256, /* Append-only file. */
--#define S_APPEND S_APPEND
-- S_IMMUTABLE = 512, /* Immutable file. */
--#define S_IMMUTABLE S_IMMUTABLE
-+ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
-+#define MS_DIRSYNC MS_DIRSYNC
- MS_NOATIME = 1024, /* Do not update access times. */
- #define MS_NOATIME MS_NOATIME
- MS_NODIRATIME = 2048, /* Do not update directory access times. */
- #define MS_NODIRATIME MS_NODIRATIME
- MS_BIND = 4096, /* Bind directory at different place. */
- #define MS_BIND MS_BIND
-+ MS_MOVE = 8192,
-+#define MS_MOVE MS_MOVE
-+ MS_REC = 16384,
-+#define MS_REC MS_REC
-+ MS_SILENT = 32768,
-+#define MS_SILENT MS_SILENT
-+ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
-+#define MS_POSIXACL MS_POSIXACL
-+ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
-+#define MS_UNBINDABLE MS_UNBINDABLE
-+ MS_PRIVATE = 1 << 18, /* Change to private. */
-+#define MS_PRIVATE MS_PRIVATE
-+ MS_SLAVE = 1 << 19, /* Change to slave. */
-+#define MS_SLAVE MS_SLAVE
-+ MS_SHARED = 1 << 20, /* Change to shared. */
-+#define MS_SHARED MS_SHARED
-+ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
-+#define MS_RELATIME MS_RELATIME
-+ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
-+#define MS_KERNMOUNT MS_KERNMOUNT
-+ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
-+#define MS_I_VERSION MS_I_VERSION
-+ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
-+#define MS_STRICTATIME MS_STRICTATIME
-+ MS_ACTIVE = 1 << 30,
-+#define MS_ACTIVE MS_ACTIVE
-+ MS_NOUSER = 1 << 31
-+#define MS_NOUSER MS_NOUSER
- };
-
- /* Flags that can be altered by MS_REMOUNT */
--#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
-- |MS_NODIRATIME)
-+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
-
-
- /* Magic mount flag number. Has to be or-ed to the flag values. */
-@@ -99,8 +122,10 @@ enum
- #define MNT_FORCE MNT_FORCE
- MNT_DETACH = 2, /* Just detach from the tree. */
- #define MNT_DETACH MNT_DETACH
-- MNT_EXPIRE = 4 /* Mark for expiry. */
-+ MNT_EXPIRE = 4, /* Mark for expiry. */
- #define MNT_EXPIRE MNT_EXPIRE
-+ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
-+#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
- };
-
-
---
-1.8.3.2
-
diff --git a/tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
deleted file mode 100644
index 85c2c3a..0000000
--- a/tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
-From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Fri, 18 Jan 2013 11:12:49 +0100
-Subject: [PATCH] mount.h: update
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
- include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
- 1 file changed, 35 insertions(+), 10 deletions(-)
-
-diff --git a/include/sys/mount.h b/include/sys/mount.h
-index fbd61fd..c0e7b84 100644
---- a/include/sys/mount.h
-+++ b/include/sys/mount.h
-@@ -1,5 +1,5 @@
- /* Header file for mounting/unmount Linux filesystems.
-- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
-+ Copyright (C) 1996-2000, 2004, 2010, 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
-@@ -46,23 +46,46 @@ enum
- #define MS_REMOUNT MS_REMOUNT
- MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
- #define MS_MANDLOCK MS_MANDLOCK
-- S_WRITE = 128, /* Write on file/directory/symlink. */
--#define S_WRITE S_WRITE
-- S_APPEND = 256, /* Append-only file. */
--#define S_APPEND S_APPEND
-- S_IMMUTABLE = 512, /* Immutable file. */
--#define S_IMMUTABLE S_IMMUTABLE
-+ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
-+#define MS_DIRSYNC MS_DIRSYNC
- MS_NOATIME = 1024, /* Do not update access times. */
- #define MS_NOATIME MS_NOATIME
- MS_NODIRATIME = 2048, /* Do not update directory access times. */
- #define MS_NODIRATIME MS_NODIRATIME
- MS_BIND = 4096, /* Bind directory at different place. */
- #define MS_BIND MS_BIND
-+ MS_MOVE = 8192,
-+#define MS_MOVE MS_MOVE
-+ MS_REC = 16384,
-+#define MS_REC MS_REC
-+ MS_SILENT = 32768,
-+#define MS_SILENT MS_SILENT
-+ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
-+#define MS_POSIXACL MS_POSIXACL
-+ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
-+#define MS_UNBINDABLE MS_UNBINDABLE
-+ MS_PRIVATE = 1 << 18, /* Change to private. */
-+#define MS_PRIVATE MS_PRIVATE
-+ MS_SLAVE = 1 << 19, /* Change to slave. */
-+#define MS_SLAVE MS_SLAVE
-+ MS_SHARED = 1 << 20, /* Change to shared. */
-+#define MS_SHARED MS_SHARED
-+ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
-+#define MS_RELATIME MS_RELATIME
-+ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
-+#define MS_KERNMOUNT MS_KERNMOUNT
-+ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
-+#define MS_I_VERSION MS_I_VERSION
-+ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
-+#define MS_STRICTATIME MS_STRICTATIME
-+ MS_ACTIVE = 1 << 30,
-+#define MS_ACTIVE MS_ACTIVE
-+ MS_NOUSER = 1 << 31
-+#define MS_NOUSER MS_NOUSER
- };
-
- /* Flags that can be altered by MS_REMOUNT */
--#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
-- |MS_NODIRATIME)
-+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
-
-
- /* Magic mount flag number. Has to be or-ed to the flag values. */
-@@ -99,8 +122,10 @@ enum
- #define MNT_FORCE MNT_FORCE
- MNT_DETACH = 2, /* Just detach from the tree. */
- #define MNT_DETACH MNT_DETACH
-- MNT_EXPIRE = 4 /* Mark for expiry. */
-+ MNT_EXPIRE = 4, /* Mark for expiry. */
- #define MNT_EXPIRE MNT_EXPIRE
-+ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
-+#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
- };
-
-
---
-1.8.3.2
-
diff --git a/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
deleted file mode 100644
index 85c2c3a..0000000
--- a/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
-From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Fri, 18 Jan 2013 11:12:49 +0100
-Subject: [PATCH] mount.h: update
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
- include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
- 1 file changed, 35 insertions(+), 10 deletions(-)
-
-diff --git a/include/sys/mount.h b/include/sys/mount.h
-index fbd61fd..c0e7b84 100644
---- a/include/sys/mount.h
-+++ b/include/sys/mount.h
-@@ -1,5 +1,5 @@
- /* Header file for mounting/unmount Linux filesystems.
-- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
-+ Copyright (C) 1996-2000, 2004, 2010, 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
-@@ -46,23 +46,46 @@ enum
- #define MS_REMOUNT MS_REMOUNT
- MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
- #define MS_MANDLOCK MS_MANDLOCK
-- S_WRITE = 128, /* Write on file/directory/symlink. */
--#define S_WRITE S_WRITE
-- S_APPEND = 256, /* Append-only file. */
--#define S_APPEND S_APPEND
-- S_IMMUTABLE = 512, /* Immutable file. */
--#define S_IMMUTABLE S_IMMUTABLE
-+ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
-+#define MS_DIRSYNC MS_DIRSYNC
- MS_NOATIME = 1024, /* Do not update access times. */
- #define MS_NOATIME MS_NOATIME
- MS_NODIRATIME = 2048, /* Do not update directory access times. */
- #define MS_NODIRATIME MS_NODIRATIME
- MS_BIND = 4096, /* Bind directory at different place. */
- #define MS_BIND MS_BIND
-+ MS_MOVE = 8192,
-+#define MS_MOVE MS_MOVE
-+ MS_REC = 16384,
-+#define MS_REC MS_REC
-+ MS_SILENT = 32768,
-+#define MS_SILENT MS_SILENT
-+ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
-+#define MS_POSIXACL MS_POSIXACL
-+ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
-+#define MS_UNBINDABLE MS_UNBINDABLE
-+ MS_PRIVATE = 1 << 18, /* Change to private. */
-+#define MS_PRIVATE MS_PRIVATE
-+ MS_SLAVE = 1 << 19, /* Change to slave. */
-+#define MS_SLAVE MS_SLAVE
-+ MS_SHARED = 1 << 20, /* Change to shared. */
-+#define MS_SHARED MS_SHARED
-+ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
-+#define MS_RELATIME MS_RELATIME
-+ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
-+#define MS_KERNMOUNT MS_KERNMOUNT
-+ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
-+#define MS_I_VERSION MS_I_VERSION
-+ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
-+#define MS_STRICTATIME MS_STRICTATIME
-+ MS_ACTIVE = 1 << 30,
-+#define MS_ACTIVE MS_ACTIVE
-+ MS_NOUSER = 1 << 31
-+#define MS_NOUSER MS_NOUSER
- };
-
- /* Flags that can be altered by MS_REMOUNT */
--#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
-- |MS_NODIRATIME)
-+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
-
-
- /* Magic mount flag number. Has to be or-ed to the flag values. */
-@@ -99,8 +122,10 @@ enum
- #define MNT_FORCE MNT_FORCE
- MNT_DETACH = 2, /* Just detach from the tree. */
- #define MNT_DETACH MNT_DETACH
-- MNT_EXPIRE = 4 /* Mark for expiry. */
-+ MNT_EXPIRE = 4, /* Mark for expiry. */
- #define MNT_EXPIRE MNT_EXPIRE
-+ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
-+#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
- };
-
-
---
-1.8.3.2
-
diff --git a/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
deleted file mode 100644
index 85c2c3a..0000000
--- a/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
-From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Fri, 18 Jan 2013 11:12:49 +0100
-Subject: [PATCH] mount.h: update
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
- include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
- 1 file changed, 35 insertions(+), 10 deletions(-)
-
-diff --git a/include/sys/mount.h b/include/sys/mount.h
-index fbd61fd..c0e7b84 100644
---- a/include/sys/mount.h
-+++ b/include/sys/mount.h
-@@ -1,5 +1,5 @@
- /* Header file for mounting/unmount Linux filesystems.
-- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
-+ Copyright (C) 1996-2000, 2004, 2010, 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
-@@ -46,23 +46,46 @@ enum
- #define MS_REMOUNT MS_REMOUNT
- MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
- #define MS_MANDLOCK MS_MANDLOCK
-- S_WRITE = 128, /* Write on file/directory/symlink. */
--#define S_WRITE S_WRITE
-- S_APPEND = 256, /* Append-only file. */
--#define S_APPEND S_APPEND
-- S_IMMUTABLE = 512, /* Immutable file. */
--#define S_IMMUTABLE S_IMMUTABLE
-+ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
-+#define MS_DIRSYNC MS_DIRSYNC
- MS_NOATIME = 1024, /* Do not update access times. */
- #define MS_NOATIME MS_NOATIME
- MS_NODIRATIME = 2048, /* Do not update directory access times. */
- #define MS_NODIRATIME MS_NODIRATIME
- MS_BIND = 4096, /* Bind directory at different place. */
- #define MS_BIND MS_BIND
-+ MS_MOVE = 8192,
-+#define MS_MOVE MS_MOVE
-+ MS_REC = 16384,
-+#define MS_REC MS_REC
-+ MS_SILENT = 32768,
-+#define MS_SILENT MS_SILENT
-+ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
-+#define MS_POSIXACL MS_POSIXACL
-+ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
-+#define MS_UNBINDABLE MS_UNBINDABLE
-+ MS_PRIVATE = 1 << 18, /* Change to private. */
-+#define MS_PRIVATE MS_PRIVATE
-+ MS_SLAVE = 1 << 19, /* Change to slave. */
-+#define MS_SLAVE MS_SLAVE
-+ MS_SHARED = 1 << 20, /* Change to shared. */
-+#define MS_SHARED MS_SHARED
-+ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
-+#define MS_RELATIME MS_RELATIME
-+ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
-+#define MS_KERNMOUNT MS_KERNMOUNT
-+ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
-+#define MS_I_VERSION MS_I_VERSION
-+ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
-+#define MS_STRICTATIME MS_STRICTATIME
-+ MS_ACTIVE = 1 << 30,
-+#define MS_ACTIVE MS_ACTIVE
-+ MS_NOUSER = 1 << 31
-+#define MS_NOUSER MS_NOUSER
- };
-
- /* Flags that can be altered by MS_REMOUNT */
--#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
-- |MS_NODIRATIME)
-+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
-
-
- /* Magic mount flag number. Has to be or-ed to the flag values. */
-@@ -99,8 +122,10 @@ enum
- #define MNT_FORCE MNT_FORCE
- MNT_DETACH = 2, /* Just detach from the tree. */
- #define MNT_DETACH MNT_DETACH
-- MNT_EXPIRE = 4 /* Mark for expiry. */
-+ MNT_EXPIRE = 4, /* Mark for expiry. */
- #define MNT_EXPIRE MNT_EXPIRE
-+ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
-+#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
- };
-
-
---
-1.8.3.2
-
diff --git a/tools-uclibc/portage.ppc.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.ppc.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
deleted file mode 100644
index 85c2c3a..0000000
--- a/tools-uclibc/portage.ppc.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
-From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Fri, 18 Jan 2013 11:12:49 +0100
-Subject: [PATCH] mount.h: update
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
- include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
- 1 file changed, 35 insertions(+), 10 deletions(-)
-
-diff --git a/include/sys/mount.h b/include/sys/mount.h
-index fbd61fd..c0e7b84 100644
---- a/include/sys/mount.h
-+++ b/include/sys/mount.h
-@@ -1,5 +1,5 @@
- /* Header file for mounting/unmount Linux filesystems.
-- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
-+ Copyright (C) 1996-2000, 2004, 2010, 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
-@@ -46,23 +46,46 @@ enum
- #define MS_REMOUNT MS_REMOUNT
- MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
- #define MS_MANDLOCK MS_MANDLOCK
-- S_WRITE = 128, /* Write on file/directory/symlink. */
--#define S_WRITE S_WRITE
-- S_APPEND = 256, /* Append-only file. */
--#define S_APPEND S_APPEND
-- S_IMMUTABLE = 512, /* Immutable file. */
--#define S_IMMUTABLE S_IMMUTABLE
-+ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
-+#define MS_DIRSYNC MS_DIRSYNC
- MS_NOATIME = 1024, /* Do not update access times. */
- #define MS_NOATIME MS_NOATIME
- MS_NODIRATIME = 2048, /* Do not update directory access times. */
- #define MS_NODIRATIME MS_NODIRATIME
- MS_BIND = 4096, /* Bind directory at different place. */
- #define MS_BIND MS_BIND
-+ MS_MOVE = 8192,
-+#define MS_MOVE MS_MOVE
-+ MS_REC = 16384,
-+#define MS_REC MS_REC
-+ MS_SILENT = 32768,
-+#define MS_SILENT MS_SILENT
-+ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
-+#define MS_POSIXACL MS_POSIXACL
-+ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
-+#define MS_UNBINDABLE MS_UNBINDABLE
-+ MS_PRIVATE = 1 << 18, /* Change to private. */
-+#define MS_PRIVATE MS_PRIVATE
-+ MS_SLAVE = 1 << 19, /* Change to slave. */
-+#define MS_SLAVE MS_SLAVE
-+ MS_SHARED = 1 << 20, /* Change to shared. */
-+#define MS_SHARED MS_SHARED
-+ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
-+#define MS_RELATIME MS_RELATIME
-+ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
-+#define MS_KERNMOUNT MS_KERNMOUNT
-+ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
-+#define MS_I_VERSION MS_I_VERSION
-+ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
-+#define MS_STRICTATIME MS_STRICTATIME
-+ MS_ACTIVE = 1 << 30,
-+#define MS_ACTIVE MS_ACTIVE
-+ MS_NOUSER = 1 << 31
-+#define MS_NOUSER MS_NOUSER
- };
-
- /* Flags that can be altered by MS_REMOUNT */
--#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
-- |MS_NODIRATIME)
-+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
-
-
- /* Magic mount flag number. Has to be or-ed to the flag values. */
-@@ -99,8 +122,10 @@ enum
- #define MNT_FORCE MNT_FORCE
- MNT_DETACH = 2, /* Just detach from the tree. */
- #define MNT_DETACH MNT_DETACH
-- MNT_EXPIRE = 4 /* Mark for expiry. */
-+ MNT_EXPIRE = 4, /* Mark for expiry. */
- #define MNT_EXPIRE MNT_EXPIRE
-+ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
-+#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
- };
-
-
---
-1.8.3.2
-
diff --git a/tools-uclibc/portage.ppc.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.ppc.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
deleted file mode 100644
index 85c2c3a..0000000
--- a/tools-uclibc/portage.ppc.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
-From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Fri, 18 Jan 2013 11:12:49 +0100
-Subject: [PATCH] mount.h: update
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
- include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
- 1 file changed, 35 insertions(+), 10 deletions(-)
-
-diff --git a/include/sys/mount.h b/include/sys/mount.h
-index fbd61fd..c0e7b84 100644
---- a/include/sys/mount.h
-+++ b/include/sys/mount.h
-@@ -1,5 +1,5 @@
- /* Header file for mounting/unmount Linux filesystems.
-- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
-+ Copyright (C) 1996-2000, 2004, 2010, 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
-@@ -46,23 +46,46 @@ enum
- #define MS_REMOUNT MS_REMOUNT
- MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
- #define MS_MANDLOCK MS_MANDLOCK
-- S_WRITE = 128, /* Write on file/directory/symlink. */
--#define S_WRITE S_WRITE
-- S_APPEND = 256, /* Append-only file. */
--#define S_APPEND S_APPEND
-- S_IMMUTABLE = 512, /* Immutable file. */
--#define S_IMMUTABLE S_IMMUTABLE
-+ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
-+#define MS_DIRSYNC MS_DIRSYNC
- MS_NOATIME = 1024, /* Do not update access times. */
- #define MS_NOATIME MS_NOATIME
- MS_NODIRATIME = 2048, /* Do not update directory access times. */
- #define MS_NODIRATIME MS_NODIRATIME
- MS_BIND = 4096, /* Bind directory at different place. */
- #define MS_BIND MS_BIND
-+ MS_MOVE = 8192,
-+#define MS_MOVE MS_MOVE
-+ MS_REC = 16384,
-+#define MS_REC MS_REC
-+ MS_SILENT = 32768,
-+#define MS_SILENT MS_SILENT
-+ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
-+#define MS_POSIXACL MS_POSIXACL
-+ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
-+#define MS_UNBINDABLE MS_UNBINDABLE
-+ MS_PRIVATE = 1 << 18, /* Change to private. */
-+#define MS_PRIVATE MS_PRIVATE
-+ MS_SLAVE = 1 << 19, /* Change to slave. */
-+#define MS_SLAVE MS_SLAVE
-+ MS_SHARED = 1 << 20, /* Change to shared. */
-+#define MS_SHARED MS_SHARED
-+ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
-+#define MS_RELATIME MS_RELATIME
-+ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
-+#define MS_KERNMOUNT MS_KERNMOUNT
-+ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
-+#define MS_I_VERSION MS_I_VERSION
-+ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
-+#define MS_STRICTATIME MS_STRICTATIME
-+ MS_ACTIVE = 1 << 30,
-+#define MS_ACTIVE MS_ACTIVE
-+ MS_NOUSER = 1 << 31
-+#define MS_NOUSER MS_NOUSER
- };
-
- /* Flags that can be altered by MS_REMOUNT */
--#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
-- |MS_NODIRATIME)
-+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
-
-
- /* Magic mount flag number. Has to be or-ed to the flag values. */
-@@ -99,8 +122,10 @@ enum
- #define MNT_FORCE MNT_FORCE
- MNT_DETACH = 2, /* Just detach from the tree. */
- #define MNT_DETACH MNT_DETACH
-- MNT_EXPIRE = 4 /* Mark for expiry. */
-+ MNT_EXPIRE = 4, /* Mark for expiry. */
- #define MNT_EXPIRE MNT_EXPIRE
-+ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
-+#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
- };
-
-
---
-1.8.3.2
-
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] proj/releng:master commit in: tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/, ...
@ 2014-08-18 21:59 Robin H. Johnson
0 siblings, 0 replies; 7+ messages in thread
From: Robin H. Johnson @ 2014-08-18 21:59 UTC (permalink / raw
To: gentoo-commits
commit: 290076f048ec05c50e64d341ad9e5df1c98a2a66
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 8 13:19:55 2014 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Fri Aug 8 13:19:55 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/releng.git;a=commit;h=290076f0
tools-uclibc: mount.h patch is in uclibc-0.9.33.2-r11
---
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ----------------------
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ----------------------
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ----------------------
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ----------------------
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ----------------------
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ----------------------
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ----------------------
.../sys-libs/uclibc/0001-mount.h-update.patch | 91 ----------------------
8 files changed, 728 deletions(-)
diff --git a/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
deleted file mode 100644
index 85c2c3a..0000000
--- a/tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
-From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Fri, 18 Jan 2013 11:12:49 +0100
-Subject: [PATCH] mount.h: update
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
- include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
- 1 file changed, 35 insertions(+), 10 deletions(-)
-
-diff --git a/include/sys/mount.h b/include/sys/mount.h
-index fbd61fd..c0e7b84 100644
---- a/include/sys/mount.h
-+++ b/include/sys/mount.h
-@@ -1,5 +1,5 @@
- /* Header file for mounting/unmount Linux filesystems.
-- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
-+ Copyright (C) 1996-2000, 2004, 2010, 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
-@@ -46,23 +46,46 @@ enum
- #define MS_REMOUNT MS_REMOUNT
- MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
- #define MS_MANDLOCK MS_MANDLOCK
-- S_WRITE = 128, /* Write on file/directory/symlink. */
--#define S_WRITE S_WRITE
-- S_APPEND = 256, /* Append-only file. */
--#define S_APPEND S_APPEND
-- S_IMMUTABLE = 512, /* Immutable file. */
--#define S_IMMUTABLE S_IMMUTABLE
-+ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
-+#define MS_DIRSYNC MS_DIRSYNC
- MS_NOATIME = 1024, /* Do not update access times. */
- #define MS_NOATIME MS_NOATIME
- MS_NODIRATIME = 2048, /* Do not update directory access times. */
- #define MS_NODIRATIME MS_NODIRATIME
- MS_BIND = 4096, /* Bind directory at different place. */
- #define MS_BIND MS_BIND
-+ MS_MOVE = 8192,
-+#define MS_MOVE MS_MOVE
-+ MS_REC = 16384,
-+#define MS_REC MS_REC
-+ MS_SILENT = 32768,
-+#define MS_SILENT MS_SILENT
-+ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
-+#define MS_POSIXACL MS_POSIXACL
-+ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
-+#define MS_UNBINDABLE MS_UNBINDABLE
-+ MS_PRIVATE = 1 << 18, /* Change to private. */
-+#define MS_PRIVATE MS_PRIVATE
-+ MS_SLAVE = 1 << 19, /* Change to slave. */
-+#define MS_SLAVE MS_SLAVE
-+ MS_SHARED = 1 << 20, /* Change to shared. */
-+#define MS_SHARED MS_SHARED
-+ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
-+#define MS_RELATIME MS_RELATIME
-+ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
-+#define MS_KERNMOUNT MS_KERNMOUNT
-+ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
-+#define MS_I_VERSION MS_I_VERSION
-+ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
-+#define MS_STRICTATIME MS_STRICTATIME
-+ MS_ACTIVE = 1 << 30,
-+#define MS_ACTIVE MS_ACTIVE
-+ MS_NOUSER = 1 << 31
-+#define MS_NOUSER MS_NOUSER
- };
-
- /* Flags that can be altered by MS_REMOUNT */
--#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
-- |MS_NODIRATIME)
-+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
-
-
- /* Magic mount flag number. Has to be or-ed to the flag values. */
-@@ -99,8 +122,10 @@ enum
- #define MNT_FORCE MNT_FORCE
- MNT_DETACH = 2, /* Just detach from the tree. */
- #define MNT_DETACH MNT_DETACH
-- MNT_EXPIRE = 4 /* Mark for expiry. */
-+ MNT_EXPIRE = 4, /* Mark for expiry. */
- #define MNT_EXPIRE MNT_EXPIRE
-+ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
-+#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
- };
-
-
---
-1.8.3.2
-
diff --git a/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
deleted file mode 100644
index 85c2c3a..0000000
--- a/tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
-From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Fri, 18 Jan 2013 11:12:49 +0100
-Subject: [PATCH] mount.h: update
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
- include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
- 1 file changed, 35 insertions(+), 10 deletions(-)
-
-diff --git a/include/sys/mount.h b/include/sys/mount.h
-index fbd61fd..c0e7b84 100644
---- a/include/sys/mount.h
-+++ b/include/sys/mount.h
-@@ -1,5 +1,5 @@
- /* Header file for mounting/unmount Linux filesystems.
-- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
-+ Copyright (C) 1996-2000, 2004, 2010, 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
-@@ -46,23 +46,46 @@ enum
- #define MS_REMOUNT MS_REMOUNT
- MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
- #define MS_MANDLOCK MS_MANDLOCK
-- S_WRITE = 128, /* Write on file/directory/symlink. */
--#define S_WRITE S_WRITE
-- S_APPEND = 256, /* Append-only file. */
--#define S_APPEND S_APPEND
-- S_IMMUTABLE = 512, /* Immutable file. */
--#define S_IMMUTABLE S_IMMUTABLE
-+ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
-+#define MS_DIRSYNC MS_DIRSYNC
- MS_NOATIME = 1024, /* Do not update access times. */
- #define MS_NOATIME MS_NOATIME
- MS_NODIRATIME = 2048, /* Do not update directory access times. */
- #define MS_NODIRATIME MS_NODIRATIME
- MS_BIND = 4096, /* Bind directory at different place. */
- #define MS_BIND MS_BIND
-+ MS_MOVE = 8192,
-+#define MS_MOVE MS_MOVE
-+ MS_REC = 16384,
-+#define MS_REC MS_REC
-+ MS_SILENT = 32768,
-+#define MS_SILENT MS_SILENT
-+ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
-+#define MS_POSIXACL MS_POSIXACL
-+ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
-+#define MS_UNBINDABLE MS_UNBINDABLE
-+ MS_PRIVATE = 1 << 18, /* Change to private. */
-+#define MS_PRIVATE MS_PRIVATE
-+ MS_SLAVE = 1 << 19, /* Change to slave. */
-+#define MS_SLAVE MS_SLAVE
-+ MS_SHARED = 1 << 20, /* Change to shared. */
-+#define MS_SHARED MS_SHARED
-+ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
-+#define MS_RELATIME MS_RELATIME
-+ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
-+#define MS_KERNMOUNT MS_KERNMOUNT
-+ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
-+#define MS_I_VERSION MS_I_VERSION
-+ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
-+#define MS_STRICTATIME MS_STRICTATIME
-+ MS_ACTIVE = 1 << 30,
-+#define MS_ACTIVE MS_ACTIVE
-+ MS_NOUSER = 1 << 31
-+#define MS_NOUSER MS_NOUSER
- };
-
- /* Flags that can be altered by MS_REMOUNT */
--#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
-- |MS_NODIRATIME)
-+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
-
-
- /* Magic mount flag number. Has to be or-ed to the flag values. */
-@@ -99,8 +122,10 @@ enum
- #define MNT_FORCE MNT_FORCE
- MNT_DETACH = 2, /* Just detach from the tree. */
- #define MNT_DETACH MNT_DETACH
-- MNT_EXPIRE = 4 /* Mark for expiry. */
-+ MNT_EXPIRE = 4, /* Mark for expiry. */
- #define MNT_EXPIRE MNT_EXPIRE
-+ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
-+#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
- };
-
-
---
-1.8.3.2
-
diff --git a/tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
deleted file mode 100644
index 85c2c3a..0000000
--- a/tools-uclibc/portage.armv7a.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
-From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Fri, 18 Jan 2013 11:12:49 +0100
-Subject: [PATCH] mount.h: update
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
- include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
- 1 file changed, 35 insertions(+), 10 deletions(-)
-
-diff --git a/include/sys/mount.h b/include/sys/mount.h
-index fbd61fd..c0e7b84 100644
---- a/include/sys/mount.h
-+++ b/include/sys/mount.h
-@@ -1,5 +1,5 @@
- /* Header file for mounting/unmount Linux filesystems.
-- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
-+ Copyright (C) 1996-2000, 2004, 2010, 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
-@@ -46,23 +46,46 @@ enum
- #define MS_REMOUNT MS_REMOUNT
- MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
- #define MS_MANDLOCK MS_MANDLOCK
-- S_WRITE = 128, /* Write on file/directory/symlink. */
--#define S_WRITE S_WRITE
-- S_APPEND = 256, /* Append-only file. */
--#define S_APPEND S_APPEND
-- S_IMMUTABLE = 512, /* Immutable file. */
--#define S_IMMUTABLE S_IMMUTABLE
-+ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
-+#define MS_DIRSYNC MS_DIRSYNC
- MS_NOATIME = 1024, /* Do not update access times. */
- #define MS_NOATIME MS_NOATIME
- MS_NODIRATIME = 2048, /* Do not update directory access times. */
- #define MS_NODIRATIME MS_NODIRATIME
- MS_BIND = 4096, /* Bind directory at different place. */
- #define MS_BIND MS_BIND
-+ MS_MOVE = 8192,
-+#define MS_MOVE MS_MOVE
-+ MS_REC = 16384,
-+#define MS_REC MS_REC
-+ MS_SILENT = 32768,
-+#define MS_SILENT MS_SILENT
-+ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
-+#define MS_POSIXACL MS_POSIXACL
-+ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
-+#define MS_UNBINDABLE MS_UNBINDABLE
-+ MS_PRIVATE = 1 << 18, /* Change to private. */
-+#define MS_PRIVATE MS_PRIVATE
-+ MS_SLAVE = 1 << 19, /* Change to slave. */
-+#define MS_SLAVE MS_SLAVE
-+ MS_SHARED = 1 << 20, /* Change to shared. */
-+#define MS_SHARED MS_SHARED
-+ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
-+#define MS_RELATIME MS_RELATIME
-+ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
-+#define MS_KERNMOUNT MS_KERNMOUNT
-+ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
-+#define MS_I_VERSION MS_I_VERSION
-+ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
-+#define MS_STRICTATIME MS_STRICTATIME
-+ MS_ACTIVE = 1 << 30,
-+#define MS_ACTIVE MS_ACTIVE
-+ MS_NOUSER = 1 << 31
-+#define MS_NOUSER MS_NOUSER
- };
-
- /* Flags that can be altered by MS_REMOUNT */
--#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
-- |MS_NODIRATIME)
-+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
-
-
- /* Magic mount flag number. Has to be or-ed to the flag values. */
-@@ -99,8 +122,10 @@ enum
- #define MNT_FORCE MNT_FORCE
- MNT_DETACH = 2, /* Just detach from the tree. */
- #define MNT_DETACH MNT_DETACH
-- MNT_EXPIRE = 4 /* Mark for expiry. */
-+ MNT_EXPIRE = 4, /* Mark for expiry. */
- #define MNT_EXPIRE MNT_EXPIRE
-+ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
-+#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
- };
-
-
---
-1.8.3.2
-
diff --git a/tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
deleted file mode 100644
index 85c2c3a..0000000
--- a/tools-uclibc/portage.armv7a.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
-From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Fri, 18 Jan 2013 11:12:49 +0100
-Subject: [PATCH] mount.h: update
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
- include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
- 1 file changed, 35 insertions(+), 10 deletions(-)
-
-diff --git a/include/sys/mount.h b/include/sys/mount.h
-index fbd61fd..c0e7b84 100644
---- a/include/sys/mount.h
-+++ b/include/sys/mount.h
-@@ -1,5 +1,5 @@
- /* Header file for mounting/unmount Linux filesystems.
-- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
-+ Copyright (C) 1996-2000, 2004, 2010, 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
-@@ -46,23 +46,46 @@ enum
- #define MS_REMOUNT MS_REMOUNT
- MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
- #define MS_MANDLOCK MS_MANDLOCK
-- S_WRITE = 128, /* Write on file/directory/symlink. */
--#define S_WRITE S_WRITE
-- S_APPEND = 256, /* Append-only file. */
--#define S_APPEND S_APPEND
-- S_IMMUTABLE = 512, /* Immutable file. */
--#define S_IMMUTABLE S_IMMUTABLE
-+ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
-+#define MS_DIRSYNC MS_DIRSYNC
- MS_NOATIME = 1024, /* Do not update access times. */
- #define MS_NOATIME MS_NOATIME
- MS_NODIRATIME = 2048, /* Do not update directory access times. */
- #define MS_NODIRATIME MS_NODIRATIME
- MS_BIND = 4096, /* Bind directory at different place. */
- #define MS_BIND MS_BIND
-+ MS_MOVE = 8192,
-+#define MS_MOVE MS_MOVE
-+ MS_REC = 16384,
-+#define MS_REC MS_REC
-+ MS_SILENT = 32768,
-+#define MS_SILENT MS_SILENT
-+ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
-+#define MS_POSIXACL MS_POSIXACL
-+ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
-+#define MS_UNBINDABLE MS_UNBINDABLE
-+ MS_PRIVATE = 1 << 18, /* Change to private. */
-+#define MS_PRIVATE MS_PRIVATE
-+ MS_SLAVE = 1 << 19, /* Change to slave. */
-+#define MS_SLAVE MS_SLAVE
-+ MS_SHARED = 1 << 20, /* Change to shared. */
-+#define MS_SHARED MS_SHARED
-+ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
-+#define MS_RELATIME MS_RELATIME
-+ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
-+#define MS_KERNMOUNT MS_KERNMOUNT
-+ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
-+#define MS_I_VERSION MS_I_VERSION
-+ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
-+#define MS_STRICTATIME MS_STRICTATIME
-+ MS_ACTIVE = 1 << 30,
-+#define MS_ACTIVE MS_ACTIVE
-+ MS_NOUSER = 1 << 31
-+#define MS_NOUSER MS_NOUSER
- };
-
- /* Flags that can be altered by MS_REMOUNT */
--#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
-- |MS_NODIRATIME)
-+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
-
-
- /* Magic mount flag number. Has to be or-ed to the flag values. */
-@@ -99,8 +122,10 @@ enum
- #define MNT_FORCE MNT_FORCE
- MNT_DETACH = 2, /* Just detach from the tree. */
- #define MNT_DETACH MNT_DETACH
-- MNT_EXPIRE = 4 /* Mark for expiry. */
-+ MNT_EXPIRE = 4, /* Mark for expiry. */
- #define MNT_EXPIRE MNT_EXPIRE
-+ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
-+#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
- };
-
-
---
-1.8.3.2
-
diff --git a/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
deleted file mode 100644
index 85c2c3a..0000000
--- a/tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
-From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Fri, 18 Jan 2013 11:12:49 +0100
-Subject: [PATCH] mount.h: update
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
- include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
- 1 file changed, 35 insertions(+), 10 deletions(-)
-
-diff --git a/include/sys/mount.h b/include/sys/mount.h
-index fbd61fd..c0e7b84 100644
---- a/include/sys/mount.h
-+++ b/include/sys/mount.h
-@@ -1,5 +1,5 @@
- /* Header file for mounting/unmount Linux filesystems.
-- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
-+ Copyright (C) 1996-2000, 2004, 2010, 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
-@@ -46,23 +46,46 @@ enum
- #define MS_REMOUNT MS_REMOUNT
- MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
- #define MS_MANDLOCK MS_MANDLOCK
-- S_WRITE = 128, /* Write on file/directory/symlink. */
--#define S_WRITE S_WRITE
-- S_APPEND = 256, /* Append-only file. */
--#define S_APPEND S_APPEND
-- S_IMMUTABLE = 512, /* Immutable file. */
--#define S_IMMUTABLE S_IMMUTABLE
-+ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
-+#define MS_DIRSYNC MS_DIRSYNC
- MS_NOATIME = 1024, /* Do not update access times. */
- #define MS_NOATIME MS_NOATIME
- MS_NODIRATIME = 2048, /* Do not update directory access times. */
- #define MS_NODIRATIME MS_NODIRATIME
- MS_BIND = 4096, /* Bind directory at different place. */
- #define MS_BIND MS_BIND
-+ MS_MOVE = 8192,
-+#define MS_MOVE MS_MOVE
-+ MS_REC = 16384,
-+#define MS_REC MS_REC
-+ MS_SILENT = 32768,
-+#define MS_SILENT MS_SILENT
-+ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
-+#define MS_POSIXACL MS_POSIXACL
-+ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
-+#define MS_UNBINDABLE MS_UNBINDABLE
-+ MS_PRIVATE = 1 << 18, /* Change to private. */
-+#define MS_PRIVATE MS_PRIVATE
-+ MS_SLAVE = 1 << 19, /* Change to slave. */
-+#define MS_SLAVE MS_SLAVE
-+ MS_SHARED = 1 << 20, /* Change to shared. */
-+#define MS_SHARED MS_SHARED
-+ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
-+#define MS_RELATIME MS_RELATIME
-+ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
-+#define MS_KERNMOUNT MS_KERNMOUNT
-+ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
-+#define MS_I_VERSION MS_I_VERSION
-+ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
-+#define MS_STRICTATIME MS_STRICTATIME
-+ MS_ACTIVE = 1 << 30,
-+#define MS_ACTIVE MS_ACTIVE
-+ MS_NOUSER = 1 << 31
-+#define MS_NOUSER MS_NOUSER
- };
-
- /* Flags that can be altered by MS_REMOUNT */
--#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
-- |MS_NODIRATIME)
-+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
-
-
- /* Magic mount flag number. Has to be or-ed to the flag values. */
-@@ -99,8 +122,10 @@ enum
- #define MNT_FORCE MNT_FORCE
- MNT_DETACH = 2, /* Just detach from the tree. */
- #define MNT_DETACH MNT_DETACH
-- MNT_EXPIRE = 4 /* Mark for expiry. */
-+ MNT_EXPIRE = 4, /* Mark for expiry. */
- #define MNT_EXPIRE MNT_EXPIRE
-+ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
-+#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
- };
-
-
---
-1.8.3.2
-
diff --git a/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
deleted file mode 100644
index 85c2c3a..0000000
--- a/tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
-From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Fri, 18 Jan 2013 11:12:49 +0100
-Subject: [PATCH] mount.h: update
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
- include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
- 1 file changed, 35 insertions(+), 10 deletions(-)
-
-diff --git a/include/sys/mount.h b/include/sys/mount.h
-index fbd61fd..c0e7b84 100644
---- a/include/sys/mount.h
-+++ b/include/sys/mount.h
-@@ -1,5 +1,5 @@
- /* Header file for mounting/unmount Linux filesystems.
-- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
-+ Copyright (C) 1996-2000, 2004, 2010, 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
-@@ -46,23 +46,46 @@ enum
- #define MS_REMOUNT MS_REMOUNT
- MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
- #define MS_MANDLOCK MS_MANDLOCK
-- S_WRITE = 128, /* Write on file/directory/symlink. */
--#define S_WRITE S_WRITE
-- S_APPEND = 256, /* Append-only file. */
--#define S_APPEND S_APPEND
-- S_IMMUTABLE = 512, /* Immutable file. */
--#define S_IMMUTABLE S_IMMUTABLE
-+ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
-+#define MS_DIRSYNC MS_DIRSYNC
- MS_NOATIME = 1024, /* Do not update access times. */
- #define MS_NOATIME MS_NOATIME
- MS_NODIRATIME = 2048, /* Do not update directory access times. */
- #define MS_NODIRATIME MS_NODIRATIME
- MS_BIND = 4096, /* Bind directory at different place. */
- #define MS_BIND MS_BIND
-+ MS_MOVE = 8192,
-+#define MS_MOVE MS_MOVE
-+ MS_REC = 16384,
-+#define MS_REC MS_REC
-+ MS_SILENT = 32768,
-+#define MS_SILENT MS_SILENT
-+ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
-+#define MS_POSIXACL MS_POSIXACL
-+ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
-+#define MS_UNBINDABLE MS_UNBINDABLE
-+ MS_PRIVATE = 1 << 18, /* Change to private. */
-+#define MS_PRIVATE MS_PRIVATE
-+ MS_SLAVE = 1 << 19, /* Change to slave. */
-+#define MS_SLAVE MS_SLAVE
-+ MS_SHARED = 1 << 20, /* Change to shared. */
-+#define MS_SHARED MS_SHARED
-+ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
-+#define MS_RELATIME MS_RELATIME
-+ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
-+#define MS_KERNMOUNT MS_KERNMOUNT
-+ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
-+#define MS_I_VERSION MS_I_VERSION
-+ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
-+#define MS_STRICTATIME MS_STRICTATIME
-+ MS_ACTIVE = 1 << 30,
-+#define MS_ACTIVE MS_ACTIVE
-+ MS_NOUSER = 1 << 31
-+#define MS_NOUSER MS_NOUSER
- };
-
- /* Flags that can be altered by MS_REMOUNT */
--#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
-- |MS_NODIRATIME)
-+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
-
-
- /* Magic mount flag number. Has to be or-ed to the flag values. */
-@@ -99,8 +122,10 @@ enum
- #define MNT_FORCE MNT_FORCE
- MNT_DETACH = 2, /* Just detach from the tree. */
- #define MNT_DETACH MNT_DETACH
-- MNT_EXPIRE = 4 /* Mark for expiry. */
-+ MNT_EXPIRE = 4, /* Mark for expiry. */
- #define MNT_EXPIRE MNT_EXPIRE
-+ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
-+#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
- };
-
-
---
-1.8.3.2
-
diff --git a/tools-uclibc/portage.ppc.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.ppc.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
deleted file mode 100644
index 85c2c3a..0000000
--- a/tools-uclibc/portage.ppc.hardened/patches/sys-libs/uclibc/0001-mount.h-update.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
-From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Fri, 18 Jan 2013 11:12:49 +0100
-Subject: [PATCH] mount.h: update
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
- include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
- 1 file changed, 35 insertions(+), 10 deletions(-)
-
-diff --git a/include/sys/mount.h b/include/sys/mount.h
-index fbd61fd..c0e7b84 100644
---- a/include/sys/mount.h
-+++ b/include/sys/mount.h
-@@ -1,5 +1,5 @@
- /* Header file for mounting/unmount Linux filesystems.
-- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
-+ Copyright (C) 1996-2000, 2004, 2010, 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
-@@ -46,23 +46,46 @@ enum
- #define MS_REMOUNT MS_REMOUNT
- MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
- #define MS_MANDLOCK MS_MANDLOCK
-- S_WRITE = 128, /* Write on file/directory/symlink. */
--#define S_WRITE S_WRITE
-- S_APPEND = 256, /* Append-only file. */
--#define S_APPEND S_APPEND
-- S_IMMUTABLE = 512, /* Immutable file. */
--#define S_IMMUTABLE S_IMMUTABLE
-+ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
-+#define MS_DIRSYNC MS_DIRSYNC
- MS_NOATIME = 1024, /* Do not update access times. */
- #define MS_NOATIME MS_NOATIME
- MS_NODIRATIME = 2048, /* Do not update directory access times. */
- #define MS_NODIRATIME MS_NODIRATIME
- MS_BIND = 4096, /* Bind directory at different place. */
- #define MS_BIND MS_BIND
-+ MS_MOVE = 8192,
-+#define MS_MOVE MS_MOVE
-+ MS_REC = 16384,
-+#define MS_REC MS_REC
-+ MS_SILENT = 32768,
-+#define MS_SILENT MS_SILENT
-+ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
-+#define MS_POSIXACL MS_POSIXACL
-+ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
-+#define MS_UNBINDABLE MS_UNBINDABLE
-+ MS_PRIVATE = 1 << 18, /* Change to private. */
-+#define MS_PRIVATE MS_PRIVATE
-+ MS_SLAVE = 1 << 19, /* Change to slave. */
-+#define MS_SLAVE MS_SLAVE
-+ MS_SHARED = 1 << 20, /* Change to shared. */
-+#define MS_SHARED MS_SHARED
-+ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
-+#define MS_RELATIME MS_RELATIME
-+ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
-+#define MS_KERNMOUNT MS_KERNMOUNT
-+ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
-+#define MS_I_VERSION MS_I_VERSION
-+ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
-+#define MS_STRICTATIME MS_STRICTATIME
-+ MS_ACTIVE = 1 << 30,
-+#define MS_ACTIVE MS_ACTIVE
-+ MS_NOUSER = 1 << 31
-+#define MS_NOUSER MS_NOUSER
- };
-
- /* Flags that can be altered by MS_REMOUNT */
--#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
-- |MS_NODIRATIME)
-+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
-
-
- /* Magic mount flag number. Has to be or-ed to the flag values. */
-@@ -99,8 +122,10 @@ enum
- #define MNT_FORCE MNT_FORCE
- MNT_DETACH = 2, /* Just detach from the tree. */
- #define MNT_DETACH MNT_DETACH
-- MNT_EXPIRE = 4 /* Mark for expiry. */
-+ MNT_EXPIRE = 4, /* Mark for expiry. */
- #define MNT_EXPIRE MNT_EXPIRE
-+ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
-+#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
- };
-
-
---
-1.8.3.2
-
diff --git a/tools-uclibc/portage.ppc.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch b/tools-uclibc/portage.ppc.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
deleted file mode 100644
index 85c2c3a..0000000
--- a/tools-uclibc/portage.ppc.vanilla/patches/sys-libs/uclibc/0001-mount.h-update.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 76ff037059f6d387bde9d540f7e27a2b376d7cd7 Mon Sep 17 00:00:00 2001
-From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Fri, 18 Jan 2013 11:12:49 +0100
-Subject: [PATCH] mount.h: update
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
- include/sys/mount.h | 45 +++++++++++++++++++++++++++++++++++----------
- 1 file changed, 35 insertions(+), 10 deletions(-)
-
-diff --git a/include/sys/mount.h b/include/sys/mount.h
-index fbd61fd..c0e7b84 100644
---- a/include/sys/mount.h
-+++ b/include/sys/mount.h
-@@ -1,5 +1,5 @@
- /* Header file for mounting/unmount Linux filesystems.
-- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
-+ Copyright (C) 1996-2000, 2004, 2010, 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
-@@ -46,23 +46,46 @@ enum
- #define MS_REMOUNT MS_REMOUNT
- MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
- #define MS_MANDLOCK MS_MANDLOCK
-- S_WRITE = 128, /* Write on file/directory/symlink. */
--#define S_WRITE S_WRITE
-- S_APPEND = 256, /* Append-only file. */
--#define S_APPEND S_APPEND
-- S_IMMUTABLE = 512, /* Immutable file. */
--#define S_IMMUTABLE S_IMMUTABLE
-+ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
-+#define MS_DIRSYNC MS_DIRSYNC
- MS_NOATIME = 1024, /* Do not update access times. */
- #define MS_NOATIME MS_NOATIME
- MS_NODIRATIME = 2048, /* Do not update directory access times. */
- #define MS_NODIRATIME MS_NODIRATIME
- MS_BIND = 4096, /* Bind directory at different place. */
- #define MS_BIND MS_BIND
-+ MS_MOVE = 8192,
-+#define MS_MOVE MS_MOVE
-+ MS_REC = 16384,
-+#define MS_REC MS_REC
-+ MS_SILENT = 32768,
-+#define MS_SILENT MS_SILENT
-+ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
-+#define MS_POSIXACL MS_POSIXACL
-+ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
-+#define MS_UNBINDABLE MS_UNBINDABLE
-+ MS_PRIVATE = 1 << 18, /* Change to private. */
-+#define MS_PRIVATE MS_PRIVATE
-+ MS_SLAVE = 1 << 19, /* Change to slave. */
-+#define MS_SLAVE MS_SLAVE
-+ MS_SHARED = 1 << 20, /* Change to shared. */
-+#define MS_SHARED MS_SHARED
-+ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
-+#define MS_RELATIME MS_RELATIME
-+ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
-+#define MS_KERNMOUNT MS_KERNMOUNT
-+ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
-+#define MS_I_VERSION MS_I_VERSION
-+ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
-+#define MS_STRICTATIME MS_STRICTATIME
-+ MS_ACTIVE = 1 << 30,
-+#define MS_ACTIVE MS_ACTIVE
-+ MS_NOUSER = 1 << 31
-+#define MS_NOUSER MS_NOUSER
- };
-
- /* Flags that can be altered by MS_REMOUNT */
--#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
-- |MS_NODIRATIME)
-+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
-
-
- /* Magic mount flag number. Has to be or-ed to the flag values. */
-@@ -99,8 +122,10 @@ enum
- #define MNT_FORCE MNT_FORCE
- MNT_DETACH = 2, /* Just detach from the tree. */
- #define MNT_DETACH MNT_DETACH
-- MNT_EXPIRE = 4 /* Mark for expiry. */
-+ MNT_EXPIRE = 4, /* Mark for expiry. */
- #define MNT_EXPIRE MNT_EXPIRE
-+ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
-+#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
- };
-
-
---
-1.8.3.2
-
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-08-18 21:59 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-18 21:59 [gentoo-commits] proj/releng:master commit in: tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/, Robin H. Johnson
-- strict thread matches above, loose matches on Subject: below --
2014-08-08 13:18 Anthony G. Basile
2014-04-26 14:32 Anthony G. Basile
2013-12-28 21:23 Anthony G. Basile
2013-12-20 18:58 Anthony G. Basile
2013-06-05 17:45 Anthony G. Basile
2013-05-10 11:00 Anthony G. Basile
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox