From patchwork Thu Jan 12 02:20:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 714084 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tzTy01bN0z9t1T for ; Thu, 12 Jan 2017 13:20:40 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="LlhZz1Y+"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=hP3p0C2WA2QbGRNjPz4aurvnwwUxR XIwSPMOAiQNltXj+NwnXinUzjERmL2ndu2GppFQk8+6zYgRfuUpvvH5Bf3CQTOlu g5Jb9wdP5MyF32CuRxS/WrA11aGdSdR4x50Rn0G6cHZTgRHkN/p3QWSJey50wHi1 RrVWJAIAPZbIbo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=RaBrLFF5iWkSFK1Z71XJKnmkkFE=; b=Llh Zz1Y+3n+j6oDaXQSwxmpq4l3eL1Y4LK3nUlw3xHaUDxDLSPeOB09ZoqtE4dCUW/s bWEZC1WdmC2dzMl3awhtlL31uAlesFfzCy6Ixy5RkdoTFYcyBkkj9O5JNO4+HRA1 EB1pwxY85ic2vOEhWH8DYHXY9vPUWaizYoeH6Yzo= Received: (qmail 3153 invoked by alias); 12 Jan 2017 02:20:31 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 3124 invoked by uid 89); 12 Jan 2017 02:20:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=Hx-languages-length:1535, consolidation, 2017-01-12, 20170112 X-HELO: relay1.mentorg.com Date: Thu, 12 Jan 2017 02:20:06 +0000 From: Joseph Myers To: Subject: Fix MIPS o32 posix_fadvise [committed] Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) The posix_fadvise consolidation broke posix_fadvise for MIPS o32, so resulting in posix/tst-posix_fadvise failing. MIPS o32 (and the other ABIs) has only the posix_fadvise64 syscall, which acts like posix_fadvise64_64 (in the o32 case, because of the alignment argument it's actually a 7-argument syscall). The generic posix_fadvise implementation presumes that if __NR_fadvise64 is defined, it's for the case where a single len argument is passed to the syscall rather than two syscall arguments in the case of a 32-bit system. The generic posix_fadvise64 works fine for this case (defining __NR_fadvise64_64 to __NR_fadvise64 as needed). ARM has a posix_fadvise.c that uses __posix_fadvise64_l64 in posix_fadvise, and that approach also works for MIPS o32, so this patch makes MIPS o32 include the ARM file. Tested for MIPS o32. Committed. 2017-01-12 Joseph Myers * sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c: New file. diff --git a/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c b/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c new file mode 100644 index 0000000..6e9c3f9 --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c @@ -0,0 +1,4 @@ +/* The o32 MIPS fadvise64 syscall behaves as fadvise64_64. The ARM + implementation of posix_fadvise works correctly for this case; the + generic implementation mishandles it. */ +#include