From e3fdbe9f39747206b9c3fbb0219f29fd5b35d020 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Thu, 8 Apr 2021 17:36:07 -0300 Subject: support: Add xmkfifo Wrapper support mkfifo. --- support/xmkfifo.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 support/xmkfifo.c (limited to 'support/xmkfifo.c') 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); +} -- cgit 1.4.1