Linux: Remove generic Implies
[glibc.git] / sysdeps / unix / sysv / linux / tst-personality.c
blobe730650e5b697d1e59d94d7444e3cae6cda370cb
1 /* BZ #19408 linux personality syscall wrapper test.
3 Copyright (C) 2015-2023 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, see
18 <https://www.gnu.org/licenses/>. */
20 #include <errno.h>
21 #include <sys/personality.h>
23 static int
24 do_test (void)
26 int rc = 0;
27 unsigned int test_persona = -EINVAL;
28 unsigned int saved_persona;
30 errno = 0xdefaced;
31 saved_persona = personality (0xffffffff);
33 if (personality (test_persona) != saved_persona
34 || personality (0xffffffff) == -1
35 || personality (PER_LINUX) == -1
36 || personality (0xffffffff) != PER_LINUX
37 || 0xdefaced != errno)
38 rc = 1;
40 (void) personality (saved_persona);
41 return rc;
44 #define TEST_FUNCTION do_test ()
45 #include "../test-skeleton.c"