From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id 05CD63857C5C for ; Wed, 19 Oct 2022 22:14:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 05CD63857C5C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ot1-x332.google.com with SMTP id t4-20020a9d7f84000000b00661c3d864f9so10340262otp.10 for ; Wed, 19 Oct 2022 15:14:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Gebe1L/WFKS6Jp0uSsDKbZMlQlbCYiaVInK+Iy/++W4=; b=VVbULOXum2RqcfZR36qu9xNd+kOBz0vhiPG8NVWQz9xojhebCF75SJIBr05BxDc6OJ C02jT7iBTfZ5PLabRMDuWePZENSxRegm/5bL+LXoqW9V31KlryAWI0CQ8wfSrdl0JTZf LNMnfzmSl/F98j3tE/uhVhyAfF+eYdM6m6fvgcSRzXvz7e+g6SO2t2V+WJsu6RIQ5j87 R5DRlflIIzxXybqbMTgbv14Chp1lxZ9QDdiyGyxwe1tJvIVNIuuuN+eX4pZs1AnPQ/iJ z7ZKvOKumplYPLsRWujBBYWGyqdps7l/jymBAAdRs1c54yM1vJPEys1+QKr+5E6GBT1u CEkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Gebe1L/WFKS6Jp0uSsDKbZMlQlbCYiaVInK+Iy/++W4=; b=rogEjwgGZQFmvropKwsMN5SKUj18hQ/reggoDsE5Mqk3vXbbaRPLFOo++Y/eCuh5fk jhC9ITz8STpPFGOfhDWu0V/MEmETI1PAvMLqsW3KkPa4yHLussUS/QtBYw8FdhSEZfhX lQ705VIhteMy8XrL+t5XVIGAeGZEyrvUNgGPQEitv93w48AaNVsYo0eVIn1g8zMlQKY7 MgSdl8Od22ZigAR0eaKFW2/r1pEHd0at2GoyRg/qBjyB874ObE5mopID1g+TQ24dYARw /UtVBq5MO5yFnKQUv3lN4NXitrIBMxXW41/B3jJcmsacy85QzCzZvyu+cfBR9Ds9u2W6 lqtA== X-Gm-Message-State: ACrzQf3REAScZJyK5fR/FzCbIvbjVISQ35PqEUiPJPL5aczMrAaIlr47 ar4av9WLYlkAoa6WnRAY5OBBpnYJhYk5s6Qf X-Google-Smtp-Source: AMsMyM41F+TCL2zK0l6pL4AMzbSWD+UO/s0YW8+QrOcAFRxaeugcUuWCvZE0vQfG6/YudvgQw4u4hA== X-Received: by 2002:a9d:5c02:0:b0:65c:20e6:46a with SMTP id o2-20020a9d5c02000000b0065c20e6046amr4911044otk.213.1666217691295; Wed, 19 Oct 2022 15:14:51 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.14.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:14:50 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 10/30] Linux: consolidate mkdir implementation Date: Wed, 19 Oct 2022 19:14:13 -0300 Message-Id: <20221019221433.1082017-11-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Use mkdir syscall if defined, otherwise use mkdirat. Checked on x86_64-linux-gnu. --- sysdeps/unix/sysv/linux/{generic => }/mkdir.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) rename sysdeps/unix/sysv/linux/{generic => }/mkdir.c (79%) diff --git a/sysdeps/unix/sysv/linux/generic/mkdir.c b/sysdeps/unix/sysv/linux/mkdir.c similarity index 79% rename from sysdeps/unix/sysv/linux/generic/mkdir.c rename to sysdeps/unix/sysv/linux/mkdir.c index f64fbd6176..a3653210fb 100644 --- a/sysdeps/unix/sysv/linux/generic/mkdir.c +++ b/sysdeps/unix/sysv/linux/mkdir.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2011-2022 Free Software Foundation, Inc. +/* Create a directory. Linux version. + Copyright (C) 2011-2022 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 @@ -15,19 +16,19 @@ License along with the GNU C Library. If not, see . */ -#include -#include -#include #include #include -#include - +#include /* Create a directory named PATH with protections MODE. */ int __mkdir (const char *path, mode_t mode) { - return INLINE_SYSCALL (mkdirat, 3, AT_FDCWD, path, mode); +#ifdef __NR_mkdir + return INLINE_SYSCALL_CALL (mkdir, path, mode); +#else + return INLINE_SYSCALL_CALL (mkdirat, AT_FDCWD, path, mode); +#endif } libc_hidden_def (__mkdir) -- 2.34.1