From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 5CF541F5AE for ; Fri, 24 Jul 2020 09:14:57 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 84F77388E824; Fri, 24 Jul 2020 09:14:56 +0000 (GMT) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by sourceware.org (Postfix) with ESMTPS id 2F1CE385DC0A for ; Fri, 24 Jul 2020 09:14:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2F1CE385DC0A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=lukma@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4BCk701cnVz1qs06; Fri, 24 Jul 2020 11:14:52 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4BCk701Br2z1qy6G; Fri, 24 Jul 2020 11:14:52 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id WOSZBKXjqcnu; Fri, 24 Jul 2020 11:14:50 +0200 (CEST) X-Auth-Info: WFf4GlzSOWQcY/LfJFC1+4GxuXo87eYe9Oxuuc4sEzQ= Received: from jawa (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Fri, 24 Jul 2020 11:14:50 +0200 (CEST) Date: Fri, 24 Jul 2020 11:14:49 +0200 From: Lukasz Majewski To: Adhemerval Zanella Subject: Re: [PATCH 07/16] Linux: Consolidate xmknod Message-ID: <20200724111449.52c165d6@jawa> In-Reply-To: <20200723194641.1949404-8-adhemerval.zanella@linaro.org> References: <20200723194641.1949404-1-adhemerval.zanella@linaro.org> <20200723194641.1949404-8-adhemerval.zanella@linaro.org> Organization: denx.de X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/H8qOU.J4iwsF2qXqmrMEHbs"; protocol="application/pgp-signature" X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , libc-alpha@sourceware.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" --Sig_/H8qOU.J4iwsF2qXqmrMEHbs Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Thu, 23 Jul 2020 16:46:32 -0300 Adhemerval Zanella wrote: > The __NR_mknodat syscall is supported on all kernels, so the generic > implementation is used as default. >=20 > Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Lukasz Majewski > --- > sysdeps/unix/sysv/linux/generic/xmknod.c | 54 > ------------------------ sysdeps/unix/sysv/linux/xmknod.c | > 8 ++-- 2 files changed, 3 insertions(+), 59 deletions(-) > delete mode 100644 sysdeps/unix/sysv/linux/generic/xmknod.c >=20 > diff --git a/sysdeps/unix/sysv/linux/generic/xmknod.c > b/sysdeps/unix/sysv/linux/generic/xmknod.c deleted file mode 100644 > index a51fcbee22..0000000000 > --- a/sysdeps/unix/sysv/linux/generic/xmknod.c > +++ /dev/null > @@ -1,54 +0,0 @@ > -/* Copyright (C) 2011-2020 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 > - 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 > -#include > -#include > -#include > - > -#include > -#include > - > -/* Create a device file named PATH, with permission and special bits > MODE > - and device number DEV (which can be constructed from major and > minor > - device numbers with the `makedev' macro above). */ > -int > -__xmknod (int vers, const char *path, mode_t mode, dev_t *dev) > -{ > - unsigned long long int k_dev; > - > - if (vers !=3D _MKNOD_VER) > - { > - __set_errno (EINVAL); > - return -1; > - } > - > - /* We must convert the value to dev_t type used by the kernel. */ > - k_dev =3D (*dev) & ((1ULL << 32) - 1); > - if (k_dev !=3D *dev) > - { > - __set_errno (EINVAL); > - return -1; > - } > - > - return INLINE_SYSCALL (mknodat, 4, AT_FDCWD, path, mode, > - (unsigned int) k_dev); > -} > -weak_alias (__xmknod, _xmknod) > -libc_hidden_def (__xmknod) > diff --git a/sysdeps/unix/sysv/linux/xmknod.c > b/sysdeps/unix/sysv/linux/xmknod.c index 5d0ae97c34..42809d4c57 100644 > --- a/sysdeps/unix/sysv/linux/xmknod.c > +++ b/sysdeps/unix/sysv/linux/xmknod.c > @@ -16,13 +16,10 @@ > License along with the GNU C Library; if not, see > . */ > =20 > -#include > -#include > #include > #include > - > +#include > #include > -#include > =20 > /* Create a device file named PATH, with permission and special bits > MODE and device number DEV (which can be constructed from major and > minor @@ -40,7 +37,8 @@ __xmknod (int vers, const char *path, mode_t > mode, dev_t *dev) if (k_dev !=3D *dev) > return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); > =20 > - return INLINE_SYSCALL (mknod, 3, path, mode, (unsigned int) k_dev); > + return INLINE_SYSCALL_CALL (mknodat, AT_FDCWD, path, mode, > + (unsigned int) k_dev); > } > =20 > weak_alias (__xmknod, _xmknod) Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de --Sig_/H8qOU.J4iwsF2qXqmrMEHbs Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAl8apokACgkQAR8vZIA0 zr1C3ggA0wPjg4ET7YE5izpsYowiDLNqdA9vnHAgPKu02yDhitbhVdFzJD6d8Oes MV3QIK3lFADasTU0Ohw+wGoUOrsNyNPFdziz5AA0E0aos8g957sPfvlUE1MhEfCu QNbV8NayL2j4qP99j61cjoeDoxXXEAa0OsS/qV7itgv8V9k3aaDwVuF5tqvtHm9I TMGyHnlH09fMXdDR/cJoVP+aU8UnPm0kSuEMjlKA/OAOmXmKnC3f2kTRODS0A1Nv k2++EDdpcV/5Kh3b80Yyi9ZsMulpqkRgaeHAyIW6W119PIF6ip4I6x/EdXE+FlTB uH2o8YgjRYezs+tngWjkqeBIh9m9lA== =YHn/ -----END PGP SIGNATURE----- --Sig_/H8qOU.J4iwsF2qXqmrMEHbs--