From patchwork Tue Oct 5 13:56:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 45888 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3856F385AC19 for ; Tue, 5 Oct 2021 13:57:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3856F385AC19 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1633442259; bh=XqccszOtdcPIMNfFfwDVhubNdqMYmg0zX492kmrBJMk=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=SeiJzHc7GxipTSDM0DK5CYMZm6B8OCbe3J2PfUU7ZpSXrwtGt4YMpS1u+eMfd/Lx/ GiGJCI0/AGETiWZAnTF9RrfqLIJqQFyw8iv3jp8Zklkzl/cFU3AtQOj7ao+ST8WXs4 Q5gOtuGt41iIs0VUjbIKaSdc5rFtV8etmV36LcUQ= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-vs1-xe2a.google.com (mail-vs1-xe2a.google.com [IPv6:2607:f8b0:4864:20::e2a]) by sourceware.org (Postfix) with ESMTPS id A5812385840B for ; Tue, 5 Oct 2021 13:56:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A5812385840B Received: by mail-vs1-xe2a.google.com with SMTP id y28so9963843vsd.3 for ; Tue, 05 Oct 2021 06:56:37 -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=XqccszOtdcPIMNfFfwDVhubNdqMYmg0zX492kmrBJMk=; b=TOhZNXEdCs9TLnjspRZn55j3skToNIS5SB7GkiLWDBtqfwkYfbM33J4thpbeaJ/NzE Bnu3hFzQgT9JT+lo8/tjjtw4i5huxQgAgDo/ak1SbhYYz7fMdnqmou2afal4JdRjF8XP ucehPq/bwB3LH+inejwx6CL+CmwrSVeY/HMT6pyo9f9ej1oEtigcM7JGnKPhDLM+7g4j EjmLim6OwrLDeJMpsXdw4BCpfc2qM7k5R9q5xLGmabKwyXu6bI1vZWpEjqix/f98S04U ork0KOI3MGRmvwGjIRIGIgBsYqeTW3I1SyZNoP+CQUT4aJwY3TAh20aEU/xjP9tYo0fD qqTw== X-Gm-Message-State: AOAM530kAgaaEXoa0KSPiUjY8dvr1XmVOuA0/L5IXKcMaaSJFWDgz01X BQoAIvYo7wuCLgWDMeZe6CziSo3qMIHNJQ== X-Google-Smtp-Source: ABdhPJyz/C24gU56N+KbhOAxQEoVjUn0ejGQZF4Zu+zmnR9puBMPWCGIQHMLsrWQ7GvrDzUH2WYBPw== X-Received: by 2002:a67:fa9a:: with SMTP id f26mr18453128vsq.53.1633442196042; Tue, 05 Oct 2021 06:56:36 -0700 (PDT) Received: from birita.. ([2804:431:c7cb:807a:9735:fcf:f170:1c20]) by smtp.gmail.com with ESMTPSA id g204sm3204902vkg.1.2021.10.05.06.56.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 06:56:35 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 1/7] support: Add xmkfifo Date: Tue, 5 Oct 2021 10:56:25 -0300 Message-Id: <20211005135631.3209020-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211005135631.3209020-1-adhemerval.zanella@linaro.org> References: <20211005135631.3209020-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 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.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-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" 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 fd27c8451e..3c59c086db 100644 --- a/support/Makefile +++ b/support/Makefile @@ -130,6 +130,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..d9f3e9fde7 --- /dev/null +++ b/support/xmkfifo.c @@ -0,0 +1,29 @@ +/* mkfifo with error checking. + Copyright (C) 2021 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, %d): %m", pathname, mode); +} diff --git a/support/xunistd.h b/support/xunistd.h index e4ade65c85..d2f66c7873 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 *pathtname, mode_t mode); /* Equivalent of "mkdir -p". */ void xmkdirp (const char *, mode_t);