From patchwork Thu Jan 2 19:10:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 306249 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 1D8322C009A for ; Fri, 3 Jan 2014 06:10:19 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B18F3933A8; Thu, 2 Jan 2014 19:10:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PgSTbNbCAOzm; Thu, 2 Jan 2014 19:10:15 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id CCC2893375; Thu, 2 Jan 2014 19:10:14 +0000 (UTC) X-Original-To: uclibc@lists.busybox.net Delivered-To: uclibc@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 9DDAB1BF952 for ; Thu, 2 Jan 2014 19:10:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 9801B8B667 for ; Thu, 2 Jan 2014 19:10:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9WVfeK0c+vkH for ; Thu, 2 Jan 2014 19:10:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by whitealder.osuosl.org (Postfix) with ESMTPS id 29FFB8B392 for ; Thu, 2 Jan 2014 19:10:13 +0000 (UTC) Received: from vapier.localnet (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id BBBF433F2DD; Thu, 2 Jan 2014 19:10:12 +0000 (UTC) From: Mike Frysinger Organization: wh0rd.org To: Baruch Siach Subject: Re: [PATCH] linux: posix_fadvise: restore implementation for xtensa Date: Thu, 2 Jan 2014 14:10:14 -0500 User-Agent: KMail/1.13.7 (Linux/3.12.1; KDE/4.6.5; x86_64; ; ) References: <5cb8c9327dd274cc0ce7f15c0faade7da4cbbeef.1388657774.git.baruch@tkos.co.il> In-Reply-To: <5cb8c9327dd274cc0ce7f15c0faade7da4cbbeef.1388657774.git.baruch@tkos.co.il> MIME-Version: 1.0 Message-Id: <201401021410.15637.vapier@gentoo.org> Cc: uclibc@uclibc.org X-BeenThere: uclibc@uclibc.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion and development of uClibc \(the embedded C library\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: uclibc-bounces@uclibc.org Sender: uclibc-bounces@uclibc.org On Thursday 02 January 2014 05:16:14 Baruch Siach wrote: > Commit ee84b8b400 (linux: posix_fadvise: use new SYSCALL_ALIGN_64BIT) > removed posix_fadvise implementation for xtensa, since xtensa does not > define __NR_fadvise64. Redefine __NR_fadvise64 as __NR_fadvise64_64 to > restore posix_fadvise. try this instead (i haven't compiled it, so might have errors :P) -mike # endif #endif diff --git a/libc/sysdeps/linux/common/posix_fadvise.c b/libc/sysdeps/linux/common/posix_fadvise.c index e102ce7..c84c387 100644 --- a/libc/sysdeps/linux/common/posix_fadvise.c +++ b/libc/sysdeps/linux/common/posix_fadvise.c @@ -10,18 +10,25 @@ #include -#if defined(__NR_fadvise64) || defined(__NR_arm_fadvise64_64) +#ifdef __NR_arm_fadvise64_64 +/* We handle the 64bit alignment issue which is why the arm guys renamed their + * syscall in the first place. So rename it back. + */ +# define __NR_fadvise64_64 __NR_arm_fadvise64_64 +#endif + +#if defined(__NR_fadvise64) || defined(__NR_fadvise64_64) # include # include # include -# ifdef __NR_arm_fadvise64_64 +# ifdef __NR_fadvise64_64 int posix_fadvise64(int fd, off64_t offset, off64_t len, int advice); # endif int posix_fadvise(int fd, off_t offset, off_t len, int advice) { -# ifdef __NR_arm_fadvise64_64 +# ifdef __NR_fadvise64_64 return posix_fadvise64(fd, offset, len, advice); # else int ret; @@ -41,7 +48,7 @@ int posix_fadvise(int fd, off_t offset, off_t len, int advice) return 0; # endif } -# if defined __UCLIBC_HAS_LFS__ && ((!defined __NR_fadvise64_64 && !defined __NR_arm_fadvise64_64) || __WORDSIZE == 64) +# if defined __UCLIBC_HAS_LFS__ && ((!defined __NR_fadvise64_64 && !defined __NR_fadvise64_64) || __WORDSIZE == 64) strong_alias(posix_fadvise,posix_fadvise64)