diff options
author | Florian Weimer <fweimer@redhat.com> | 2021-07-21 11:42:31 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2021-07-21 11:58:16 +0200 |
commit | b39ffab860cd743a82c91946619f1b8158b0b65e (patch) | |
tree | fa25c15ecf6932037425ce6b1db67e94880eeb09 /sysdeps/unix/sysv/linux/tst-prctl.c | |
parent | 8a40aff86ba5f64a3a84883e539cb67bd48db030 (diff) | |
download | glibc-b39ffab860cd743a82c91946619f1b8158b0b65e.tar.gz glibc-b39ffab860cd743a82c91946619f1b8158b0b65e.tar.xz glibc-b39ffab860cd743a82c91946619f1b8158b0b65e.zip |
Linux: Add time64 alias for prctl
Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/unix/sysv/linux/tst-prctl.c')
-rw-r--r-- | sysdeps/unix/sysv/linux/tst-prctl.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/tst-prctl.c b/sysdeps/unix/sysv/linux/tst-prctl.c new file mode 100644 index 0000000000..a9dd1dcd85 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-prctl.c @@ -0,0 +1,33 @@ +/* Smoke test for prctl. + 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 + <https://www.gnu.org/licenses/>. */ + +#include <sys/prctl.h> +#include <support/check.h> + +static int +do_test (void) +{ + TEST_COMPARE (prctl (PR_SET_NAME, "thread name", 0, 0, 0), 0); + char buffer[16] = { 0, }; + TEST_COMPARE (prctl (PR_GET_NAME, buffer, 0, 0, 0), 0); + char expected[16] = "thread name"; + TEST_COMPARE_BLOB (buffer, sizeof (buffer), expected, sizeof (expected)); + return 0; +} + +#include <support/test-driver.c> |