From patchwork Thu Apr 20 17:56:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 97861 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp914602qgf; Thu, 20 Apr 2017 10:56:35 -0700 (PDT) X-Received: by 10.84.222.12 with SMTP id w12mr11530955pls.115.1492710995001; Thu, 20 Apr 2017 10:56:35 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id u26si7110913pgo.310.2017.04.20.10.56.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Apr 2017 10:56:34 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-78810-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-78810-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-78810-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; q=dns; s= default; b=nls5FdIxpI1bwL8Nw71hvgSUUl6DL/SFLcrf1Hl+Wbhx+pUktXPFE rmK8uHGQTxMwxh/hWSwUjEJT4UqvD8PLd1pFPW7XsN4pjBfl58/QDiMLCrLIiOjx IcfFNiMNQ7KbOYc1iuVMKhdOkdhXNSo1WIFYa/bp8d+vTivXyhlDLM= 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:from:to:subject:date:message-id; s=default; bh=I+CTEWDI0VPVUsrRLoaKXiYBZxY=; b=IwZjkSkNR9QVqvqgBJLYP2pZKEYR NonynfR/XfkxErsr/S0Nya59xb0STcjsHkNUABC2lBkFnYZt9lJCgQ8T6VgTbqzs kq8+5zfyoZj5bPQkGZ3bNLqeK8r4678ve8IYy0Vx2HCRnkDqkauXZtUw+K2nBlo1 FNNqm6Z8ac011OA= Received: (qmail 105339 invoked by alias); 20 Apr 2017 17:56:20 -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 105275 invoked by uid 89); 20 Apr 2017 17:56:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=pii X-HELO: mail-qt0-f181.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=Em5kzddxZ+RxPgfR6TQlgEbhUjLEzAThUGnoR76uikI=; b=EeINEvUYNm3ybVWpKmnYdbcIINtxoQ5rXQB0zahGSVU96lUzlPXs/RbSOr4VAI3QL7 ++klH3XrgS/w/pV64ztOvOa5QSBYC8Pj8Z/nIFXh1TVOuRJ915ALbjZIwGNcPDfthb/A NanNFDjQEeB6p5C+/x0vvHE6xcVd15mxXPf59SZjAQeZAIAH0tsh+3EhzJqTulJeCvK+ CD7F2GfBDyB4mJ8BjZFXEII7UIglSh73PZ79srXfSBNJH8FJIy3Hv+AT66aIhe+YZRqp OsM9Dqn/+82WfSGyXjHSKZBBJBHU1AqUhYARYPaMuEO5IXVK4hZsiOFjXC4syyI7SWF5 9wtA== X-Gm-Message-State: AN3rC/6cuMNK/nxBNJnGi9WHqkFNOJoIua5Y1LNazUUsUpSgHF2LU0Bo mHLZ5TLfqrkb/wBC4XczmA== X-Received: by 10.237.36.211 with SMTP id u19mr8872620qtc.187.1492710975304; Thu, 20 Apr 2017 10:56:15 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 1/3] Consolidate Linux poll implementation Date: Thu, 20 Apr 2017 14:56:06 -0300 Message-Id: <1492710968-7699-1-git-send-email-adhemerval.zanella@linaro.org> This patch consolidates the poll Linux syscall implementation on sysdeps/unix/sysv/linux/poll.c. It basically removes poll from auto-generation list and add a default implementation that either call __NR_poll directly (if the kernel headers defines it) or ppoll adjusting the timeout argument (as the generic implementation). Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32, aarch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu. * sysdeps/unix/sysv/linux/generic/poll.c: Remove file. * sysdeps/unix/sysv/linux/poll.c: New file. * sysdeps/unix/sysv/linux/syscalls.list: Remove poll from auto-generation list. --- ChangeLog | 7 +++++++ sysdeps/unix/sysv/linux/{generic => }/poll.c | 8 ++++++-- sysdeps/unix/sysv/linux/syscalls.list | 1 - 3 files changed, 13 insertions(+), 3 deletions(-) rename sysdeps/unix/sysv/linux/{generic => }/poll.c (88%) -- 2.7.4 diff --git a/sysdeps/unix/sysv/linux/generic/poll.c b/sysdeps/unix/sysv/linux/poll.c similarity index 88% rename from sysdeps/unix/sysv/linux/generic/poll.c rename to sysdeps/unix/sysv/linux/poll.c index c06d383..5a781dd 100644 --- a/sysdeps/unix/sysv/linux/generic/poll.c +++ b/sysdeps/unix/sysv/linux/poll.c @@ -1,6 +1,6 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. +/* Linux poll implementation. + Copyright (C) 2017 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Chris Metcalf , 2011. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -25,6 +25,9 @@ int __poll (struct pollfd *fds, nfds_t nfds, int timeout) { +#ifdef __NR_poll + return SYSCALL_CANCEL (poll, fds, nfds, timeout); +#else struct timespec timeout_ts; struct timespec *timeout_ts_p = NULL; @@ -36,6 +39,7 @@ __poll (struct pollfd *fds, nfds_t nfds, int timeout) } return SYSCALL_CANCEL (ppoll, fds, nfds, timeout_ts_p, NULL, 0); +#endif } libc_hidden_def (__poll) weak_alias (__poll, poll) diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list index 5d3c417..fcefefc 100644 --- a/sysdeps/unix/sysv/linux/syscalls.list +++ b/sysdeps/unix/sysv/linux/syscalls.list @@ -50,7 +50,6 @@ pause - pause Ci: __libc_pause pause pipe - pipe i:f __pipe pipe pipe2 - pipe2 i:fi __pipe2 pipe2 pivot_root EXTRA pivot_root i:ss pivot_root -poll - poll Ci:pii __libc_poll __poll poll prctl EXTRA prctl i:iiiii __prctl prctl putpmsg - putpmsg i:ippii putpmsg query_module EXTRA query_module i:sipip __compat_query_module query_module@GLIBC_2.0:GLIBC_2.23