From patchwork Fri May 12 17:58:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 99719 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp431447qge; Fri, 12 May 2017 11:00:04 -0700 (PDT) X-Received: by 10.99.107.201 with SMTP id g192mr5728703pgc.149.1494612004594; Fri, 12 May 2017 11:00:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494612004; cv=none; d=google.com; s=arc-20160816; b=uDTOkeeCJH4PafxclQjdFWHV2Mle1b/bl4bMXhGNWv6L0dhKwE1f30+f6P0vHp8GCB YGdnHhQNVLqrJZV00Gl13R4nn0Dcj+eq9LQF64GDAeAxoFjEOzPs6yQCc8TLxpjWRTqR cUgsJ93xbZj7hLOdv/wz2O6oA45bI4ISzz/wgjO8oh/cwMYTEJrsecxkwJzA/iCUtqyk QwUaeak1vh5tLS3NI00vIODSnjuv3jW3NugsXxczbeRmQR/semCvvwRtW4ceuFcSHX6F TTXWCV5upc+e1s2yyL77w0MMXapuot4X3PQUGusgi30yxS+08iWNKtqBXoseb6MKqUNl iakQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from:delivered-to :sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=/EjH1YMwJnBgbYGw6RWcbyOlXMhHZgII3SqZEkuskS0=; b=wcTRBURwKiIlUKw6Qzam3NN7n3DZTdTmsQmqtd979r6YWzGtu3CtIZUNL5YFW873kq hp4xNYKemNYwVY6OFt4uWlm6DNeos2hbYf2oPsvCLjFa8IbmB9bReeSO/26rXUgJ/Kk7 gz1XxBmmxlPxbR/NDBOlRor0iLUmD4klwPdDV85OX+TWQokQ34pe7HEAxwP0qAoSMpy7 cbHkpMzhs/+2eyZMxPkbMiLk5l+pQYoHJMMF2312eSifYZw2Zw+FEoSp0XAg0EcDyTIN BYmPrs3xnGFikSdcmK6l/idk09i/GCc8ZRbO/w96l1IHcieyTSSqrdQvpEeqSqBCJlNy z2sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-79382-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-79382-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id z84si3981295pfk.178.2017.05.12.11.00.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 May 2017 11:00:04 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-79382-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-79382-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-79382-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:in-reply-to :references; q=dns; s=default; b=X6Ddd/DBFKPo6gkFnzszn/h8fZxLoMQ Zg5hlVZuO8WAorcL98eQMw6+ofE+XVHRtuKtefvAEU77BzTwrB/VduAG13ovhq11 YR3BjHtkZC0XhByVWl3jPaE5htFNHP9gLUiNx0kuZSneJSM+lTBCCqm9b1BuU42A rTYo+lqgKELY= 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:in-reply-to :references; s=default; bh=VjfOf1YNtbNDqNbdNs5EsCDW4kw=; b=ccjXl 1NhuY1FwOEwPrQ+YdNdRN7RvaJfxU1fUYx1+p5bCh9VXYlp4vUNdpyTRhxog3+GV pDIPkDBnMwqrGUcsmgLLZpOYF8GDax/JU0rBeIa+gRcTJGEki4wi2U98KGuxfF+W UyqCVHNMCvnkNEpasddQauW1r4Ij1WpJLobedw= Received: (qmail 43012 invoked by alias); 12 May 2017 17:58:33 -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 42718 invoked by uid 89); 12 May 2017 17:58:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qk0-f171.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:in-reply-to :references; bh=/EjH1YMwJnBgbYGw6RWcbyOlXMhHZgII3SqZEkuskS0=; b=pTX7/vZAqML9PtVz5FaH07Oin/13XGi+gnq23i36+h6EoCcyHpcrqbpmufWzKtOmEP DC5u+oUvJaIisYw9wAsdGPnE6y9DwprNa9x5E1TVzSAvR2ygR6fBDkxXNgYXfK1ogmbb zWasFeqD9fwksVvTS/EnRv2tkEpiUl+5qxerwB3k3EkUmlo71J1gNBeCQoyaAyJlEyQx Nz5TwgN6tAXOyW8s4DI47/8h02QefiEbenumONgxJQbULGOWyY2x6wH6QKCmyQURik29 YqXDLp+8wI46HgwODyo0lJXb1eXk3HgVAI1ZC690WzzvgSfzYnilocR6bSjvto/SAV0Q QnVg== X-Gm-Message-State: AODbwcCXapckS2huDvKZWg+veV8Wp0DMWIeraQsnioyE6WydBbLRgox7 +Q5j7s2BvmuIQqDEKQPDxw== X-Received: by 10.55.49.11 with SMTP id x11mr5293710qkx.12.1494611910860; Fri, 12 May 2017 10:58:30 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 08/13] posix: Consolidate Linux fsync syscall Date: Fri, 12 May 2017 14:58:09 -0300 Message-Id: <1494611894-9282-8-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1494611894-9282-1-git-send-email-adhemerval.zanella@linaro.org> References: <1494611894-9282-1-git-send-email-adhemerval.zanella@linaro.org> This patch consolidates the fsync Linux syscall generation on sysdeps/unix/sysv/linux/fsync.c. It basically removes it from architectures auto-generation list. For arm it also removes the __errno_location call since fsync is not called with SYSCALL_CANCEL with call arch-specific INLINE_SYSCALL macro which in turn will call __set_errno macro (and setting errno directly). Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32, arch64-linux-gnu, arm-linux-gnueabihf, powerpc64le-linux-gnu, sparc64-linux-gnu, and sparcv9-linux-gnu. * misc/Makefile (CFLAGS-fsync.c): New flag. * nptl/Makefile (CFLAGS-fsync.c): Likewise. * sysdeps/unix/syscalls.list (fsync): Remove from auto-generation syscall list. * sysdeps/unix/sysv/linux/fsync.c: New file. * sysdeps/unix/sysv/linux/arm/localplt.data [libpthread.so] (__errno_location): Remove. --- ChangeLog | 8 ++++++++ misc/Makefile | 1 + nptl/Makefile | 1 + sysdeps/unix/syscalls.list | 1 - sysdeps/unix/sysv/linux/arm/localplt.data | 1 - sysdeps/unix/sysv/linux/fsync.c | 28 ++++++++++++++++++++++++++++ 6 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/fsync.c -- 2.7.4 diff --git a/misc/Makefile b/misc/Makefile index 2f1ddef..d58ff5c 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -110,6 +110,7 @@ CFLAGS-err.c = -fexceptions CFLAGS-tst-tsearch.c = $(stack-align-test-flags) CFLAGS-msync.c = -fexceptions CFLAGS-fdatasync.c = -fexceptions +CFLAGS-fsync.c = -fexceptions # Called during static library initialization, so turn stack-protection # off for non-shared builds. diff --git a/nptl/Makefile b/nptl/Makefile index 879efbb..9eedce2 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -219,6 +219,7 @@ CFLAGS-write.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-nanosleep.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-msync.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-fdatasync.c = -fexceptions -fasynchronous-unwind-tables +CFLAGS-fsync.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-pt-system.c = -fexceptions diff --git a/sysdeps/unix/syscalls.list b/sysdeps/unix/syscalls.list index c4135d8..61e5360 100644 --- a/sysdeps/unix/syscalls.list +++ b/sysdeps/unix/syscalls.list @@ -19,7 +19,6 @@ fchmod - fchmod i:ii __fchmod fchmod fchown - fchown i:iii __fchown fchown fcntl - fcntl Ci:iiF __libc_fcntl __fcntl fcntl fstatfs - fstatfs i:ip __fstatfs fstatfs -fsync - fsync Ci:i __libc_fsync fsync ftruncate - ftruncate i:ii __ftruncate ftruncate getdomain - getdomainname i:si getdomainname getgid - getgid Ei: __getgid getgid diff --git a/sysdeps/unix/sysv/linux/arm/localplt.data b/sysdeps/unix/sysv/linux/arm/localplt.data index 8bc876d..19d3299 100644 --- a/sysdeps/unix/sysv/linux/arm/localplt.data +++ b/sysdeps/unix/sysv/linux/arm/localplt.data @@ -5,7 +5,6 @@ libc.so: memalign libc.so: raise libc.so: realloc libm.so: matherr -libpthread.so: __errno_location libpthread.so: raise # The dynamic loader needs __tls_get_addr for TLS. ld.so: __tls_get_addr diff --git a/sysdeps/unix/sysv/linux/fsync.c b/sysdeps/unix/sysv/linux/fsync.c new file mode 100644 index 0000000..ac4827b --- /dev/null +++ b/sysdeps/unix/sysv/linux/fsync.c @@ -0,0 +1,28 @@ +/* Synchronize a file's in-core state with storage device Linux + implementation. + Copyright (C) 2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + +/* Make all changes done to FD actually appear on disk. */ +int +fsync (int fd) +{ + return SYSCALL_CANCEL (fsync, fd); +}