From faf0e9c84119742dd9ebb79060faa22c52ae80a1 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 27 Jan 2017 06:53:19 +0100 Subject: nptl: Add tst-robust-fork --- support/xmunmap.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 support/xmunmap.c (limited to 'support/xmunmap.c') diff --git a/support/xmunmap.c b/support/xmunmap.c new file mode 100644 index 0000000000..6ef5a4a468 --- /dev/null +++ b/support/xmunmap.c @@ -0,0 +1,28 @@ +/* munmap with error checking. + Copyright (C) 2016-2017 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 +xmunmap (void *addr, size_t length) +{ + if (munmap (addr, length) != 0) + FAIL_EXIT1 ("munmap of %zu bytes: %m", length); +} -- cgit v1.2.3