From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id 5F9A3385E83F for ; Mon, 21 Mar 2022 15:08:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5F9A3385E83F Received: by mail-oi1-x232.google.com with SMTP id b188so16492248oia.13 for ; Mon, 21 Mar 2022 08:08:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yLtoGvS6xckQHPl0gjw6Ytmpjx0eAYqmfl2aBNnEpXg=; b=QKTx63YjDBhL+6XFbsaOYCfBFxTkJW9bStllsEVtLoTCw51suJxJLI8QIfU08Yhtnm SfkBONjsNyFIQv6RJiCOZdITySH2YE/MagNbNI4j3juMMtiApUs0eOJb5UbP3C5g6JwS K1kWbeMO6144biVNu25T/fvC0XZky4ei3jO1WL5bD/5C/ZyJmn3Q7Uouh64QW1uHS9c2 50Uk9ZSmRxezOuXQknaZh5AaaYE10ogIZmzBHYUZeriVubNSlMZ9Hn2KJro74T4lcGsV t9qiBVbntfDQ6ww8htmI2LDu4hakBXYdXppLva03nrjFV/7lWrvnylkiE4vcNK/V3k5a bnaQ== X-Gm-Message-State: AOAM533w0n+G/dk5cgxBtLqNBk4dqNbk7iDlND+2mf2+sm6Xe+O1FGRC uq2nTEWqfIMkinRoPNIkbeICGJhF886MTg== X-Google-Smtp-Source: ABdhPJyxThmeQxeIi72oylE9u3X3icbkO1Q3B9/34Bba1YevpwxjoXjFY+QXJtSuZUsj3jMYkZSzJg== X-Received: by 2002:a05:6808:124d:b0:2d7:f6e:74b0 with SMTP id o13-20020a056808124d00b002d70f6e74b0mr14434360oiv.141.1647875324894; Mon, 21 Mar 2022 08:08:44 -0700 (PDT) Received: from birita.. ([2804:431:c7ca:2d55:f04a:67c7:cbf3:571d]) by smtp.gmail.com with ESMTPSA id o64-20020acad743000000b002ef3b249b9esm3859458oig.58.2022.03.21.08.08.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 08:08:44 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org, Paul Eggert Subject: [PATCH v4 1/7] support: Add xmkfifo Date: Mon, 21 Mar 2022 12:08:32 -0300 Message-Id: <20220321150838.898597-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220321150838.898597-1-adhemerval.zanella@linaro.org> References: <20220321150838.898597-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.4 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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Mon, 21 Mar 2022 15:08:51 -0000 Wrapper support mkfifo. --- support/Makefile | 1 + support/xmkfifo.c | 29 +++++++++++++++++++++++++++++ support/xunistd.h | 1 + 3 files changed, 31 insertions(+) create mode 100644 support/xmkfifo.c diff --git a/support/Makefile b/support/Makefile index 5ddcb8d158..c3609e211b 100644 --- a/support/Makefile +++ b/support/Makefile @@ -133,6 +133,7 @@ libsupport-routines = \ xmemstream \ xmkdir \ xmkdirp \ + xmkfifo \ xmmap \ xmprotect \ xmunmap \ diff --git a/support/xmkfifo.c b/support/xmkfifo.c new file mode 100644 index 0000000000..a8e196dbc2 --- /dev/null +++ b/support/xmkfifo.c @@ -0,0 +1,29 @@ +/* mkfifo with error checking. + Copyright (C) 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 + 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 + +void +xmkfifo (const char *pathname, mode_t mode) +{ + int r = mkfifo (pathname, mode); + if (r < 0) + FAIL_EXIT1 ("mkfifo (%s, 0%o): %m", pathname, mode); +} diff --git a/support/xunistd.h b/support/xunistd.h index 0454d83cf1..960a62d412 100644 --- a/support/xunistd.h +++ b/support/xunistd.h @@ -61,6 +61,7 @@ void xsymlink (const char *target, const char *linkpath); void xchdir (const char *path); void xfchmod (int fd, mode_t mode); void xchmod (const char *pathname, mode_t mode); +void xmkfifo (const char *pathname, mode_t mode); /* Equivalent of "mkdir -p". */ void xmkdirp (const char *, mode_t); -- 2.32.0