From patchwork Tue Sep 24 00:58:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 277331 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 1ED292C0091 for ; Tue, 24 Sep 2013 10:58:25 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id DE35C32991; Tue, 24 Sep 2013 00:58:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6wxCZI4nhJ1n; Tue, 24 Sep 2013 00:58:02 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 96DBC32967; Tue, 24 Sep 2013 00:58:02 +0000 (UTC) X-Original-To: uclibc@lists.busybox.net Delivered-To: uclibc@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 359AC1C29F9 for ; Tue, 24 Sep 2013 00:58:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 12C6593A14 for ; Tue, 24 Sep 2013 00:58:26 +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 2KneLiYGMP0U for ; Tue, 24 Sep 2013 00:58:25 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pa0-f48.google.com (mail-pa0-f48.google.com [209.85.220.48]) by hemlock.osuosl.org (Postfix) with ESMTPS id B111C9371D for ; Tue, 24 Sep 2013 00:58:25 +0000 (UTC) Received: by mail-pa0-f48.google.com with SMTP id bj1so2972617pad.35 for ; Mon, 23 Sep 2013 17:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=paDzFdirxD7YHT655V5atCW4CAXKKFYC02+l62lwVFk=; b=jV5o8MbJZujN33EOg5WlMgaJZT/tihrT7mncWnlHw09Hn5XP/Om0228hp7/lFw03wM zNd5x66kfXSz8ny2a2P5ebi/fW9BQIs8tHvhrz4AQ1i/Yxkj68Clqi39pi/yD77dF0lC 1XyriX0QkTNHg4llzSwKvnFRVgOHEuPBo8Qa+eNLsNl4zu/ZcD7s1K5rjIYXOyzwVnSj 7xksL1+PvOLb7NnMOVSm3PXM4/J17WanNIrRazwOIHBdO6Oc+m+rcczZJI1tZyUZnTIy DjEpmh6r4fBK+51pR/fDheSGT1P9GTSPloNeAZysQ+Vc+MvgEOvbDi+D8rVRAuuzW3j4 V94A== X-Received: by 10.68.236.103 with SMTP id ut7mr11530172pbc.118.1379984300643; Mon, 23 Sep 2013 17:58:20 -0700 (PDT) Received: from haswell.gateway.2wire.net (99-57-140-209.lightspeed.sntcca.sbcglobal.net. [99.57.140.209]) by mx.google.com with ESMTPSA id ta10sm41262975pab.5.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Sep 2013 17:58:20 -0700 (PDT) From: Khem Raj To: uclibc@uclibc.org Subject: [PATCH] add posix_fadvise() for arm Date: Mon, 23 Sep 2013 17:58:11 -0700 Message-Id: <1379984291-11431-1-git-send-email-raj.khem@gmail.com> X-Mailer: git-send-email 1.8.3.2 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: , MIME-Version: 1.0 Errors-To: uclibc-bounces@uclibc.org Sender: uclibc-bounces@uclibc.org arm call to posix_fadvise simply calls posix_fadvise64 Signed-off-by: Khem Raj --- libc/sysdeps/linux/common/posix_fadvise.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) Upstream-Status: Pending diff --git a/libc/sysdeps/linux/common/posix_fadvise.c b/libc/sysdeps/linux/common/posix_fadvise.c index d3e1bd4..e102ce7 100644 --- a/libc/sysdeps/linux/common/posix_fadvise.c +++ b/libc/sysdeps/linux/common/posix_fadvise.c @@ -10,30 +10,38 @@ #include -#ifdef __NR_fadvise64 +#if defined(__NR_fadvise64) || defined(__NR_arm_fadvise64_64) # include # include # include +# ifdef __NR_arm_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 + return posix_fadvise64(fd, offset, len, advice); +# else int ret; INTERNAL_SYSCALL_DECL(err); -# if __WORDSIZE == 64 +# if __WORDSIZE == 64 ret = INTERNAL_SYSCALL(fadvise64, err, 4, fd, offset, len, advice); -# else -# if defined(__UCLIBC_SYSCALL_ALIGN_64BIT__) - ret = INTERNAL_SYSCALL(fadvise64, err, 6, fd, /*unused*/0, # else +# if defined(__UCLIBC_SYSCALL_ALIGN_64BIT__) + ret = INTERNAL_SYSCALL(fadvise64, err, 6, fd, /*unused*/0, +# else ret = INTERNAL_SYSCALL(fadvise64, err, 5, fd, -# endif +# endif OFF_HI_LO (offset), len, advice); -# endif +# endif if (INTERNAL_SYSCALL_ERROR_P (ret, err)) return INTERNAL_SYSCALL_ERRNO (ret, err); return 0; +# endif } -# if defined __UCLIBC_HAS_LFS__ && (!defined __NR_fadvise64_64 || __WORDSIZE == 64) +# if defined __UCLIBC_HAS_LFS__ && ((!defined __NR_fadvise64_64 && !defined __NR_arm_fadvise64_64) || __WORDSIZE == 64) strong_alias(posix_fadvise,posix_fadvise64) # endif #endif