From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 5601A1381F3 for ; Wed, 5 Jun 2013 17:45:49 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B21EBE0949; Wed, 5 Jun 2013 17:45:43 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CE651E0949 for ; Wed, 5 Jun 2013 17:45:42 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BC76C33E121 for ; Wed, 5 Jun 2013 17:45:41 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 6A0E7E468F for ; Wed, 5 Jun 2013 17:45:40 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: <1370454359.3748e4529759c0720443f8c4ff699d3154be994f.blueness@gentoo> Subject: [gentoo-commits] proj/releng:master commit in: tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/, ... X-VCS-Repository: proj/releng X-VCS-Files: tools-uclibc/portage.amd64.hardened/package.accept_keywords/uclibc tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/01_add-posix_fallocate.patch tools-uclibc/portage.amd64.hardened/savedconfig/sys-libs/uclibc-0.9.33.2-r3 tools-uclibc/portage.amd64.hardened/savedconfig/sys-libs/uclibc-0.9.33.2-r4 tools-uclibc/portage.amd64.vanilla/package.accept_keywords/uclibc tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/01_add-posix_fallocate.patch tools-uclibc/portage.amd64.vanilla/savedconfig/sys-libs/uclibc-0.9.33.2-r3 tools-uclibc/portage.amd64.vanilla/savedconfig/sys-libs/uclibc-0.9.33.2-r4 tools-uclibc/portage.i686.hardened/package.accept_keywords/uclibc tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/01_add-posix_fallocate.patch tools-uclibc/portage.i686.hardened/savedconfig/sys-libs/uclibc-0.9.33.2-r3 tools-uclibc/portage.i686.hardened/savedconfig/sys-libs/uclibc-0.9.33.2-r4 tools-uclibc/portage.i686.vanilla/package.accept_keywords/uclibc tool s-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/01_add-posix_fallocate.patch tools-uclibc/portage.i686.vanilla/savedconfig/sys-libs/uclibc-0.9.33.2-r3 tools-uclibc/portage.i686.vanilla/savedconfig/sys-libs/uclibc-0.9.33.2-r4 X-VCS-Directories: tools-uclibc/portage.i686.vanilla/patches/sys-libs/uclibc/ tools-uclibc/portage.i686.hardened/patches/sys-libs/uclibc/ tools-uclibc/portage.amd64.hardened/savedconfig/sys-libs/ tools-uclibc/portage.amd64.vanilla/savedconfig/sys-libs/ tools-uclibc/portage.amd64.vanilla/patches/sys-libs/uclibc/ tools-uclibc/portage.amd64.vanilla/package.accept_keywords/ tools-uclibc/portage.i686.hardened/package.accept_keywords/ tools-uclibc/portage.i686.vanilla/package.accept_keywords/ tools-uclibc/portage.i686.hardened/savedconfig/sys-libs/ tools-uclibc/portage.i686.vanilla/savedconfig/sys-libs/ tools-uclibc/portage.amd64.hardened/package.accept_keywords/ tools-uclibc/portage.amd64.hardened/patches/sys-libs/uclibc/ X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: 3748e4529759c0720443f8c4ff699d3154be994f X-VCS-Branch: master Date: Wed, 5 Jun 2013 17:45:40 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 8bdc199c-c32d-429d-923f-88c4ab5de6b1 X-Archives-Hash: 80f9ffb9cd3e9d632b72d930332b7f09 commit: 3748e4529759c0720443f8c4ff699d3154be994f Author: Anthony G. Basile gentoo org> AuthorDate: Wed Jun 5 17:45:59 2013 +0000 Commit: Anthony G. Basile gentoo 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 -Date: Tue, 17 Apr 2012 07:30:15 +0000 -Subject: libc: add posix_fallocate() - -Signed-off-by: Bernhard Reutner-Fischer ---- -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 -+ * -+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#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 -+ * -+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#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 -+#include -+ -+#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 -+ -+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 -Date: Tue, 17 Apr 2012 07:30:15 +0000 -Subject: libc: add posix_fallocate() - -Signed-off-by: Bernhard Reutner-Fischer ---- -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 -+ * -+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#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 -+ * -+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#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 -+#include -+ -+#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 -+ -+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 -Date: Tue, 17 Apr 2012 07:30:15 +0000 -Subject: libc: add posix_fallocate() - -Signed-off-by: Bernhard Reutner-Fischer ---- -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 -+ * -+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#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 -+ * -+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#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 -+#include -+ -+#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 -+ -+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 -Date: Tue, 17 Apr 2012 07:30:15 +0000 -Subject: libc: add posix_fallocate() - -Signed-off-by: Bernhard Reutner-Fischer ---- -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 -+ * -+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#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 -+ * -+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#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 -+#include -+ -+#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 -+ -+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