From patchwork Fri Oct 4 19:41:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Korsgaard X-Patchwork-Id: 280721 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 9E19C2C00C8 for ; Sat, 5 Oct 2013 05:41:45 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 645968D6F4; Fri, 4 Oct 2013 19:41:44 +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 XsrhzFN3p2CK; Fri, 4 Oct 2013 19:41:43 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 2A0168D6F1; Fri, 4 Oct 2013 19:41:43 +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 D7E5D1C1E95 for ; Fri, 4 Oct 2013 19:41:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D1D498D6E5 for ; Fri, 4 Oct 2013 19:41:41 +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 cwzy2z1BY7OB for ; Fri, 4 Oct 2013 19:41:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ea0-f177.google.com (mail-ea0-f177.google.com [209.85.215.177]) by whitealder.osuosl.org (Postfix) with ESMTPS id 3F4408D6CC for ; Fri, 4 Oct 2013 19:41:40 +0000 (UTC) Received: by mail-ea0-f177.google.com with SMTP id f15so2010312eak.36 for ; Fri, 04 Oct 2013 12:41:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=PUU2VKPFC6vq6SO68BdKiGlF5aEU4QsaX0AQb0KSyBY=; b=xYeMs5fAC2nSGI50xgyWke7j85B/aLZ6zOhJ7H1DZ7UEVDahFjBDeIeSwtVtCOb3Fv WNsck6QBJw3PkydJzUPfqhEVxcTxR9pAaHkVMvM7/Wo8kh73jbCusf3FEqPyh4Z20VX/ u8LnyVM9aVaUv2GMyl9ZRSlrRh2hCtOPzkdJ/NqdeHY0uJEkt5eUkutmSFWXnIj9ge92 PQUS6fCRID3aB8JeD2o6cvidR8e7XT/M5KV5HkPAaI6WRRchXFzgV3qboovkPUQIiJs5 e5ttqMiZ8ckvVgXdqwOrqHPfD8dX31NWKkC1wRiUYW+CMmgAaVJUGqdPCwu5URq9lv4m AQ9w== X-Received: by 10.14.8.72 with SMTP id 48mr24260423eeq.25.1380915698425; Fri, 04 Oct 2013 12:41:38 -0700 (PDT) Received: from dell.be.48ers.dk ([2001:6f8:1434:0:6267:20ff:fe4e:21b6]) by mx.google.com with ESMTPSA id a43sm31365883eep.9.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 04 Oct 2013 12:41:37 -0700 (PDT) Received: from peko by dell.be.48ers.dk with local (Exim 4.80) (envelope-from ) id 1VSBFl-000764-Ts; Fri, 04 Oct 2013 21:41:33 +0200 From: Peter Korsgaard To: uclibc@uclibc.org, vapier@gentoo.org, natanael.copa@gmail.com Subject: [PATCH-0.9.33] common/pread_write.c: unbreak on archs without __NR_pread64 Date: Fri, 4 Oct 2013 21:41:20 +0200 Message-Id: <1380915680-27206-1-git-send-email-peter@korsgaard.com> X-Mailer: git-send-email 1.7.10.4 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 Some archs (avr32 in particular) still doesn't define __NR_pread64, so we should fall back to __NR_pread if it isn't available. The code nicely checks for it, but then ends up hard coding the syscall to use __NR_pread64 afterwards, rendering the check useless. Fix it by using the result of the test instead. Signed-off-by: Peter Korsgaard --- Noticed when adding the pending patches for 0.9.33.3 to Buildroot: http://jenkins.free-electrons.com/job/buildroot/config=atstk100x_defconfig/116/console libc/sysdeps/linux/common/pread_write.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c index b13de66..8562ab4 100644 --- a/libc/sysdeps/linux/common/pread_write.c +++ b/libc/sysdeps/linux/common/pread_write.c @@ -42,7 +42,7 @@ extern __typeof(pwrite64) __libc_pwrite64; #include -# define __NR___syscall_pread __NR_pread64 +# define __NR___syscall_pread __NR_pread static __inline__ _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf, size_t, count, off_t, offset_hi, off_t, offset_lo)