You can subscribe to this list here.
2010 |
Jan
|
Feb
|
Mar
(16) |
Apr
(25) |
May
(8) |
Jun
(22) |
Jul
(71) |
Aug
(36) |
Sep
(22) |
Oct
(31) |
Nov
(88) |
Dec
(40) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(128) |
Feb
(35) |
Mar
(28) |
Apr
(33) |
May
(18) |
Jun
(8) |
Jul
(21) |
Aug
(18) |
Sep
(6) |
Oct
(19) |
Nov
(12) |
Dec
(44) |
2012 |
Jan
(31) |
Feb
(48) |
Mar
(31) |
Apr
(11) |
May
(13) |
Jun
(15) |
Jul
(13) |
Aug
(18) |
Sep
(7) |
Oct
(25) |
Nov
(21) |
Dec
(13) |
2013 |
Jan
(17) |
Feb
(18) |
Mar
(21) |
Apr
(35) |
May
(30) |
Jun
(4) |
Jul
|
Aug
(1) |
Sep
(8) |
Oct
(30) |
Nov
(13) |
Dec
|
From: Cyril H. <su...@li...> - 2013-05-13 13:21:17
|
The branch, master, has been updated via 381456d98abb05b4354de20d9a056d444dce6834 (commit) from bf812bd9f8347b1a89326f42c493f8e2f48c5d44 (commit) - Log ----------------------------------------------------------------- commit 381456d98abb05b4354de20d9a056d444dce6834 Author: Cyril Hrubis <ch...@su...> Date: Mon May 13 15:02:45 2013 +0200 Remove obsolete result file. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: result | 96 ---------------------------------------------------------------- 1 files changed, 0 insertions(+), 96 deletions(-) delete mode 100644 result diff --git a/result b/result deleted file mode 100644 index 47efe10..0000000 --- a/result +++ /dev/null @@ -1,96 +0,0 @@ -This file contains for corresponding monthly release results. it will alwats help to refer this file and come to know about known failures. - - -ltp-full-20100331 Result pon various Arch: - -On x86_64 machine with RHEL5.4(2.6.18-164.el5): -***************************************************** - -Result Log file: -=============== -eventfd01 FAIL 4 -syslog07 FAIL 1 -syslog08 FAIL 1 -mtest06 FAIL 255 -su01 FAIL 1 -hugemmap04 FAIL 2 -hugeshmat01 FAIL 6 -hugeshmat02 FAIL 6 -hugeshmat03 FAIL 2 -hugeshmctl01 FAIL 6 -hugeshmctl02 FAIL 6 -hugeshmctl03 FAIL 2 -hugeshmdt01 FAIL 6 -hugeshmget01 FAIL 2 -hugeshmget02 FAIL 6 -hugeshmget03 FAIL 6 -hugeshmget05 FAIL 2 -mail FAIL 2 - - -Result Output file: -================== -syslog07 1 TFAIL : Higher level messages are not logged. -check_netns_enabled 1 TFAIL : unshare syscall smoke test failed: errno=EINVAL(22): Invalid argument -mail_tests::mail02 2 TFAIL : Test #2: Mailer-Deamon failed to report delivery failure. Reason: -mail_tests::mail05 5 TFAIL : Test #5: mail failed to carbon copy user mail_test. Reason: - - -On ppc64 machine with RHEL5.4(2.6.18-164.el5): -***************************************************** - -Result Log file: -=============== -cct01 FAIL 1 -eventfd01 FAIL 4 -fdatasync02 FAIL 1 -syslog07 FAIL 1 -syslog08 FAIL 1 -mtest06 FAIL 255 -mmapstress03 FAIL 1 -su01 FAIL 1 -cron_deny01 FAIL 1 - - -Result Output file: -================== -acct01 1 TFAIL : attempting to assign acct file to device: expected failure but got okay return -fdatasync02 2 TFAIL : Unexpected results for file descriptor to a special file ; returned 0 (expected -1), errno 0 (expected 22) -syslog07 1 TFAIL : Higher level messages are not logged. -mmapstress03 1 TFAIL : Test failed -check_netns_enabled 1 TFAIL : unshare syscall smoke test failed: errno=EINVAL(22): Invalid argument - - - -On s390x machine with RHEL5.4(2.6.18-164.el5): -***************************************************** - -Result Log file: -=============== -eventfd01 FAIL 4 -keyctl01 FAIL 1 -rt_sigsuspend01 FAIL 11 -timer_getoverrun01 FAIL 1 -timer_gettime01 FAIL 1 -su01 FAIL 1 -cron_allow01 FAIL 1 - - - -Result Output file: -================== -keyctl01 2 TFAIL : KEYCTL_REVOKE got unexpected errno: errno=EINVAL(22): Invalid argument -timer_getoverrun01 1 TFAIL : Block 1: test 0 FAILED... errno = 22 : Invalid argument -timer_gettime01 1 TFAIL : Block 1: test 0 FAILED... errno = 22 : Invalid argument -check_netns_enabled 1 TFAIL : unshare syscall smoke test failed: errno=EINVAL(22): Invalid argument - - - -On x86_64 machine with SLES11GA(2.6.27.19-5-default): -***************************************************** - -Result Log file: -=============== -eventfd2_03 FAIL 1 -utimensat01 FAIL 1 -ftest04 FAIL 1 hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-05-10 08:22:08
|
The branch, master, has been updated via bf812bd9f8347b1a89326f42c493f8e2f48c5d44 (commit) via d3373fc804184af460bc5ae6a44e67d1388aeed5 (commit) from 18f6767215c974d7b25edbc9c769c87e811b8d94 (commit) - Log ----------------------------------------------------------------- commit bf812bd9f8347b1a89326f42c493f8e2f48c5d44 Author: Wanlong Gao <gao...@cn...> Date: Fri May 10 16:17:31 2013 +0800 gitignore: add binaries from lib/tests/ Signed-off-by: Wanlong Gao <gao...@cn...> commit d3373fc804184af460bc5ae6a44e67d1388aeed5 Author: Wanlong Gao <gao...@cn...> Date: Fri May 10 16:14:59 2013 +0800 gitignore: add oom05, thp0{3,4,5} Signed-off-by: Wanlong Gao <gao...@cn...> ----------------------------------------------------------------------- Summary of changes: .gitignore | 5 +++++ testcases/kernel/mem/.gitignore | 4 ++++ 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/.gitignore b/.gitignore index d202037..140f5f4 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,8 @@ logfile.* /utils/benchmark/ebizzy-0.3/ebizzy /lib/tests/bytes_by_prefix_test /lib/tests/tst_tmpdir_test +/lib/tests/tst_checkpoint_child +/lib/tests/tst_checkpoint_child_exits +/lib/tests/tst_checkpoint_parent +/lib/tests/tst_checkpoint_parent_exits +/lib/tests/tst_process_state diff --git a/testcases/kernel/mem/.gitignore b/testcases/kernel/mem/.gitignore index e60e458..532c87a 100644 --- a/testcases/kernel/mem/.gitignore +++ b/testcases/kernel/mem/.gitignore @@ -46,6 +46,7 @@ /oom/oom02 /oom/oom03 /oom/oom04 +/oom/oom05 /page/page01 /page/page02 /shmt/shmt02 @@ -60,6 +61,9 @@ /swapping/swapping01 /thp/thp01 /thp/thp02 +/thp/thp03 +/thp/thp04 +/thp/thp05 /tunable/max_map_count /tunable/min_free_kbytes /tunable/overcommit_memory hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-05-09 14:23:05
|
The branch, master, has been updated via 18f6767215c974d7b25edbc9c769c87e811b8d94 (commit) from 630f90dab055df23a31e6c7585b944af2383de17 (commit) - Log ----------------------------------------------------------------- commit 18f6767215c974d7b25edbc9c769c87e811b8d94 Author: Alexey Kodanev <ale...@or...> Date: Tue May 7 20:07:32 2013 +0400 New core test of hardlinks and symlinks restrictions This restrictions added in Linux 3.6 and disabled by default in Linux 3.7. Signed-off-by: Alexey Kodanev <ale...@or...> Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: runtest/syscalls | 2 + .../kernel/security/prot_hsymlinks/.gitignore | 1 + testcases/kernel/security/prot_hsymlinks/Makefile | 19 + testcases/kernel/security/prot_hsymlinks/README | 24 + .../security/prot_hsymlinks/prot_hsymlinks.c | 580 ++++++++++++++++++++ 5 files changed, 626 insertions(+), 0 deletions(-) create mode 100644 testcases/kernel/security/prot_hsymlinks/.gitignore create mode 100644 testcases/kernel/security/prot_hsymlinks/Makefile create mode 100644 testcases/kernel/security/prot_hsymlinks/README create mode 100644 testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c diff --git a/runtest/syscalls b/runtest/syscalls index 90b4542..e6ce29c 100644 --- a/runtest/syscalls +++ b/runtest/syscalls @@ -741,6 +741,8 @@ process_vm_readv03 process_vm_readv03 process_vm_writev01 process_vm01 -w process_vm_writev02 process_vm_writev02 +prot_hsymlinks prot_hsymlinks + pselect01 pselect01 pselect01_64 pselect01_64 diff --git a/testcases/kernel/security/prot_hsymlinks/.gitignore b/testcases/kernel/security/prot_hsymlinks/.gitignore new file mode 100644 index 0000000..68e41da --- /dev/null +++ b/testcases/kernel/security/prot_hsymlinks/.gitignore @@ -0,0 +1 @@ +/prot_hsymlinks diff --git a/testcases/kernel/security/prot_hsymlinks/Makefile b/testcases/kernel/security/prot_hsymlinks/Makefile new file mode 100644 index 0000000..cd49588 --- /dev/null +++ b/testcases/kernel/security/prot_hsymlinks/Makefile @@ -0,0 +1,19 @@ +# Copyright (c) 2013 Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +top_srcdir ?= ../../../.. + +include $(top_srcdir)/include/mk/testcases.mk +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/security/prot_hsymlinks/README b/testcases/kernel/security/prot_hsymlinks/README new file mode 100644 index 0000000..a745c8b --- /dev/null +++ b/testcases/kernel/security/prot_hsymlinks/README @@ -0,0 +1,24 @@ +TEST SUITE: + +The directory prot_hsymlinks contains the tests related to harlinks and +symlinks restrictions. + +TESTS AIM: + +The aim of the tests is to check the restrictions +for hardlinks and symlinks. + +This security restrictions were added in Linux 3.6 and enabled by default, +but it broke some programs. It has been disabled by default in Linux 3.7 and +to control it, special proc parameters added. Distributions and users +can enable it by writing "1" to /proc/sys/fs/protected_symlinks, +/proc/sys/fs/protected_hardlinks. + +This test enables restrictions and checks following preconditions: + +1. Users who own sticky world-writable directory can't follow symlinks +inside that directory if their don't own ones. All other users can follow. + +2. Hard links restriction applies only to non-privileged users. Only +non-privileged user can't create hard links to files if he isn't owner +of the file or he doesn't have write access to the file. diff --git a/testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c b/testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c new file mode 100644 index 0000000..8feef99 --- /dev/null +++ b/testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c @@ -0,0 +1,580 @@ +/* + * Copyright (c) 2013 Oracle and/or its affiliates. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Alexey Kodanev <ale...@or...> + * + * Test checks following preconditions: + * + * Symlinks + * --------- + * Users who own sticky world-writable directory can't follow symlinks + * inside that directory if their don't own ones. All other users can follow. + * + * Hardlinks + * --------- + * Hard links restriction applies only to non-privileged users. Only + * non-privileged user can't create hard links to files if he isn't owner + * of the file or he doesn't have write access to the file. + */ + +#include <sys/types.h> +#include <sys/stat.h> +#include <pwd.h> +#include <unistd.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <signal.h> + +#include "test.h" +#include "usctest.h" +#include "safe_macros.h" + +char *TCID = "prot_hsymlinks"; +int TST_TOTAL = 396; + +/* create 3 files and 1 dir in each base dir */ +#define MAX_FILES_CREATED 4 +#define MAX_PATH 128 +#define MAX_CMD_LEN 64 +#define MAX_USER_NAME 16 + +enum { + ROOT = 0, + TEST_USER, + USERS_NUM +}; + +#define BASE_DIR_NUM (USERS_NUM + 1) +/* + * max test files and directories + * that will be created during the test + * is't not include symlinks and hardlinks + * and base directories + */ +#define MAX_ENTITIES (MAX_FILES_CREATED * BASE_DIR_NUM) + +struct dir_params { + char path[MAX_PATH]; + int world_writable; + int sticky; + int owner; +}; + +static struct dir_params bdirs[BASE_DIR_NUM]; + +static const char file_ext[] = ".hs"; + +enum { + IS_FILE = 0, + IS_DIRECTORY, +}; + +struct user_file { + char path[MAX_PATH]; + int is_dir; +}; + +struct test_user { + char name[MAX_USER_NAME]; + struct user_file file[MAX_ENTITIES]; + int num; +}; + +static struct test_user users[USERS_NUM]; + +struct link_info { + char path[MAX_PATH]; + int owner; + int source_owner; + int in_world_write; + int in_sticky; + int is_dir; + int dir_owner; +}; + +/* test flags */ +enum { + CANNOT_FOLLOW = -1, + CAN_FOLLOW = 0, +}; + +enum { + CANNOT_CREATE = -1, + CAN_CREATE = 0, +}; + +static char *tmp_user_name; +static char *default_user = "hsym"; +static int nflag; +static int skip_cleanup; + +static const option_t options[] = { + {"u:", &nflag, &tmp_user_name}, /* -u #user name */ + {"s", &skip_cleanup, NULL}, + {NULL, NULL, NULL} +}; +/* full length of the test tmpdir path in /tmp */ +static size_t cwd_offset; + +static const char hrdlink_proc_path[] = "/proc/sys/fs/protected_hardlinks"; +static const char symlink_proc_path[] = "/proc/sys/fs/protected_symlinks"; + +static void help(void); +static void setup(int argc, char *argv[]); +static void cleanup(void); + +static void test_user_cmd(const char *user_cmd); + +static int disable_protected_slinks; +static int disable_protected_hlinks; + +/* + * changes links restrictions + * @param value can be: + * 0 - restrictions is off + * 1 - restrictions is on + */ +static void switch_protected_slinks(int value); +static void switch_protected_hlinks(int value); + +static int get_protected_slinks(void); +static int get_protected_hlinks(void); + +static void create_link_path(char *buffer, int size, const char *path); +static int create_check_hlinks(const struct user_file *ufile, int owner); +static int create_check_slinks(const struct user_file *ufile, int owner); +static int check_symlink(const struct link_info *li); +static int try_open(const char *name, int mode); +/* try to open symlink in diff modes */ +static int try_symlink(const char *name); + +static int test_run(void); +static void init_base_dirs(void); +static void init_files_dirs(void); + +/* change effective user id and group id by name + * pass NULL to set root + */ +static void set_user(const char *name); + +/* add new created files to user struct */ +static void ufiles_add(int usr, char *path, int type); + +int main(int argc, char *argv[]) +{ + setup(argc, argv); + + test_run(); + + cleanup(); + + tst_exit(); +} + +static void setup(int argc, char *argv[]) +{ + char *msg; + msg = parse_opts(argc, argv, options, &help); + if (msg != NULL) + tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); + + tst_require_root(NULL); + + if (tst_kvercmp(3, 7, 0) < 0) { + tst_brkm(TCONF, cleanup, + "Test must be run with kernel 3.7 or newer"); + } + + /* initialize user names */ + strcpy(users[ROOT].name, "root"); + + if (tmp_user_name == NULL) + tmp_user_name = default_user; + snprintf(users[TEST_USER].name, MAX_USER_NAME, "%s", tmp_user_name); + + tst_sig(FORK, DEF_HANDLER, cleanup); + + test_user_cmd("useradd"); + /* + * enable hardlinks and symlinks restrictions, + * it's not defualt but have to check + */ + if (!get_protected_hlinks()) { + switch_protected_hlinks(1); + disable_protected_hlinks = 1; + } + if (!get_protected_slinks()) { + switch_protected_slinks(1); + disable_protected_slinks = 1; + } + + tst_tmpdir(); + + init_base_dirs(); + + init_files_dirs(); +} + +static int test_run(void) +{ + tst_resm(TINFO, " --- HARDLINKS AND SYMLINKS RESTRICTIONS TEST ---\n"); + + int result_slink = 0, + result_hlink = 0, + usr, + file; + + const struct user_file *ufile; + /* + * create symlinks and hardlinks from each user's files + * to each world writable directory + */ + for (usr = 0; usr < USERS_NUM; ++usr) { + /* get all users files and directories */ + for (file = 0; file < users[usr].num; ++file) { + ufile = &users[usr].file[file]; + result_slink |= create_check_slinks(ufile, usr); + result_hlink |= create_check_hlinks(ufile, usr); + } + } + + /* final results */ + tst_resm(TINFO, "All test-cases have been completed, summary:\n" + " - symlinks test:\t%s\n" + " - hardlinks test:\t%s", + (result_slink == 1) ? "FAIL" : "PASS", + (result_hlink == 1) ? "FAIL" : "PASS"); + + return result_slink | result_hlink; +} + +static void cleanup(void) +{ + /* call cleanup function only once */ + static int first_call = 1; + if (!first_call) + return; + first_call = 0; + + set_user(NULL); + + if (skip_cleanup) + return; + + test_user_cmd("userdel -r"); + + if (disable_protected_hlinks) { + tst_resm(TINFO, "Disable protected hardlinks mode back"); + switch_protected_hlinks(0); + } + if (disable_protected_slinks) { + tst_resm(TINFO, "Disable protected symlinks mode back"); + switch_protected_slinks(0); + } + + tst_rmdir(); + TEST_CLEANUP; +} + +static int get_protected_hlinks(void) +{ + int value = 0; + SAFE_FILE_SCANF(cleanup, hrdlink_proc_path, "%d", &value); + return value; +} + +static int get_protected_slinks(void) +{ + int value = 0; + SAFE_FILE_SCANF(cleanup, symlink_proc_path, "%d", &value); + return value; +} + +static void switch_protected_hlinks(int value) +{ + SAFE_FILE_PRINTF(cleanup, hrdlink_proc_path, "%d", value == 1); +} + +static void switch_protected_slinks(int value) +{ + SAFE_FILE_PRINTF(cleanup, symlink_proc_path, "%d", value == 1); +} + +static void test_user_cmd(const char *user_cmd) +{ + char cmd[MAX_CMD_LEN]; + snprintf(cmd, MAX_CMD_LEN, "%s %s", user_cmd, users[TEST_USER].name); + if (system(cmd) != 0) { + tst_brkm(TBROK, cleanup, "Failed to run cmd: %s %s", + user_cmd, users[TEST_USER].name); + } +} + +static void help(void) +{ + printf(" -s Skip cleanup.\n"); + printf(" -u #user name : Define test user\n"); +} + +static void create_sub_dir(const char *path, + struct dir_params *bdir, mode_t mode) +{ + snprintf(bdir->path, MAX_PATH, "%s/tmp_%s", + path, users[bdir->owner].name); + SAFE_MKDIR(cleanup, bdir->path, mode); + + if (bdir->sticky) + mode |= S_ISVTX; + chmod(bdir->path, mode); +} + +static void init_base_dirs(void) +{ + char *cwd = get_tst_tmpdir(); + cwd_offset = strlen(cwd); + + mode_t mode = S_IRWXU | S_IRWXG | S_IRWXO; + chmod(cwd, mode); + + strcpy(bdirs[0].path, cwd); + free(cwd); + + bdirs[0].sticky = 0; + bdirs[0].world_writable = 1; + + /* create subdir for each user */ + int dir, usr; + for (usr = 0; usr < USERS_NUM; ++usr) { + set_user(users[usr].name); + dir = usr + 1; + bdirs[dir].sticky = 1; + bdirs[dir].world_writable = 1; + bdirs[dir].owner = usr; + + create_sub_dir(bdirs[0].path, &bdirs[dir], mode); + } +} + +static void init_files_dirs(void) +{ + int dir, usr; + /* create all other dirs and files */ + for (dir = 0; dir < ARRAY_SIZE(bdirs); ++dir) { + for (usr = 0; usr < USERS_NUM; ++usr) { + set_user(users[usr].name); + char path[MAX_PATH]; + + /* create file in the main directory */ + snprintf(path, MAX_PATH, "%s/%s%s", + bdirs[dir].path, users[usr].name, file_ext); + ufiles_add(usr, path, IS_FILE); + + /* create file with S_IWOTH bit set */ + strcat(path, "_w"); + ufiles_add(usr, path, IS_FILE); + + chmod(path, S_IRUSR | S_IRGRP | S_IWOTH | S_IROTH); + + /* create sub directory */ + snprintf(path, MAX_PATH, "%s/%s", bdirs[dir].path, + users[usr].name); + ufiles_add(usr, path, IS_DIRECTORY); + + /* create local file inside sub directory */ + snprintf(path + strlen(path), MAX_PATH - strlen(path), + "/local_%s%s", users[usr].name, file_ext); + ufiles_add(usr, path, IS_FILE); + } + } +} + +static void ufiles_add(int usr, char *path, int type) +{ + int file = users[usr].num; + + if (file >= MAX_ENTITIES) + tst_brkm(TBROK, cleanup, "Unexpected number of files"); + + struct user_file *ufile = &users[usr].file[file]; + + if (type == IS_FILE) + SAFE_CREAT(cleanup, path, 0644); + else + SAFE_MKDIR(cleanup, path, 0755); + + strcpy(ufile->path, path); + + ufile->is_dir = (type == IS_DIRECTORY); + ++users[usr].num; +} + +static void create_link_path(char *buffer, int size, const char *path) +{ + /* to make sure name is unique */ + static int count; + ++count; + + /* construct link name */ + snprintf(buffer, size, "%s/link_%d", path, count); +} + +static int create_check_slinks(const struct user_file *ufile, int owner) +{ + int result = 0; + int dir, usr; + for (dir = 0; dir < ARRAY_SIZE(bdirs); ++dir) { + for (usr = 0; usr < USERS_NUM; ++usr) { + /* set user who will create symlink */ + set_user(users[usr].name); + + struct link_info slink_info; + create_link_path(slink_info.path, MAX_PATH, + bdirs[dir].path); + + slink_info.owner = usr; + slink_info.source_owner = owner; + slink_info.in_world_write = bdirs[dir].world_writable; + slink_info.in_sticky = bdirs[dir].sticky; + slink_info.dir_owner = bdirs[dir].owner; + + if (symlink(ufile->path, slink_info.path) == -1) { + tst_brkm(TBROK, cleanup, + "Can't create symlink: %s", + slink_info.path); + } + result |= check_symlink(&slink_info); + } + } + return result; +} + +static int create_check_hlinks(const struct user_file *ufile, int owner) +{ + int result = 0; + int dir, usr; + for (dir = 0; dir < ARRAY_SIZE(bdirs); ++dir) { + for (usr = 0; usr < USERS_NUM; ++usr) { + /* can't create hardlink to directory */ + if (ufile->is_dir) + continue; + /* set user who will create hardlink */ + set_user(users[usr].name); + + struct link_info hlink_info; + create_link_path(hlink_info.path, MAX_PATH, + bdirs[dir].path); + + int can_write = try_open(ufile->path, O_WRONLY) == 0; + + int tst_flag = (can_write || usr == owner || + usr == ROOT) ? CAN_CREATE : CANNOT_CREATE; + + int fail; + fail = tst_flag != link(ufile->path, hlink_info.path); + + result |= fail; + tst_resm((fail) ? TFAIL : TPASS, + "Expect: %s create hardlink '...%s' to '...%s', " + "owner '%s', curr.user '%s', w(%d)", + (tst_flag == CAN_CREATE) ? "can" : "can't", + ufile->path + cwd_offset, + hlink_info.path + cwd_offset, + users[owner].name, users[usr].name, + can_write); + } + } + return result; +} + +static int check_symlink(const struct link_info *li) +{ + int symlink_result = 0; + int usr; + for (usr = 0; usr < USERS_NUM; ++usr) { + set_user(users[usr].name); + int tst_flag = (usr == li->dir_owner && + li->in_world_write && li->in_sticky && + usr != li->owner) ? CANNOT_FOLLOW : CAN_FOLLOW; + + int fail = tst_flag != try_symlink(li->path); + + symlink_result |= fail; + + tst_resm((fail) ? TFAIL : TPASS, + "Expect: %s follow symlink '...%s', " + "owner '%s', src.owner '%s', " + "curr.user '%s', dir.owner '%s'", + (tst_flag == CAN_FOLLOW) ? "can" : "can't", + li->path + cwd_offset, users[li->owner].name, + users[li->source_owner].name, users[usr].name, + users[li->dir_owner].name); + } + return symlink_result; +} + +/* differenet modes to try in the test */ +static const int o_modes[] = { + O_RDONLY, + O_WRONLY, + O_RDWR, + O_RDONLY | O_NONBLOCK | O_DIRECTORY, +}; + +static int try_symlink(const char *name) +{ + int mode; + for (mode = 0; mode < ARRAY_SIZE(o_modes); ++mode) { + if (try_open(name, o_modes[mode]) != -1) + return CAN_FOLLOW; + } + + return CANNOT_FOLLOW; +} + +static int try_open(const char *name, int mode) +{ + int fd = open(name, mode); + + if (fd == -1) + return fd; + + if (close(fd) == -1) + tst_brkm(TBROK, cleanup, "Can't close file: %s", name); + + return 0; +} + +static void set_user(const char *name) +{ + uid_t user_id = 0; + gid_t user_gr = 0; + + if (name != NULL) { + struct passwd *pswd = getpwnam(name); + + if (pswd == 0) { + tst_brkm(TBROK, cleanup, + "Failed to find user '%s'", name); + } + user_id = pswd->pw_uid; + user_gr = pswd->pw_gid; + } + + SAFE_SETEGID(cleanup, user_gr); + SAFE_SETEUID(cleanup, user_id); +} hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-05-08 08:22:05
|
The branch, master, has been updated via 630f90dab055df23a31e6c7585b944af2383de17 (commit) from 981d33aad3b33c4625b88990fbf2fad5470d47e0 (commit) - Log ----------------------------------------------------------------- commit 630f90dab055df23a31e6c7585b944af2383de17 Author: Zhouping Liu <zl...@re...> Date: Mon Apr 29 14:07:17 2013 +0800 mem/oom: fixed a cpuset error For the below special NUMA system, oom0[4|5] failed: # numactl -H available: 2 nodes (0-1) node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 node 0 size: 0 MB node 0 free: 0 MB node 1 cpus: node 1 size: 16384 MB node 1 free: 14173 MB node distances: node 0 1 0: 10 40 1: 40 10 failed log: oom04 1 TBROK : write /dev/cpuset/1/cpuset.mems: errno=EINVAL(22): Invalid argument The reason is that node0 only contains all CPUs, no any memory, and node1 contains all memory, but no CPUs. In the previous codes, we only do cpuset testing on an independent node, which caused the sub-cpuset cgroup to only contain CPUs or memory in one node, but that's not permitted in the scenario described above. Signed-off-by: Zhouping Liu <zl...@re...> Reviewed-by: Caspar Zhang <ca...@ca...> Acked-by: Wanlong Gao <gao...@cn...> Signed-off-by: Wanlong Gao <gao...@cn...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/mem/lib/mem.c | 13 ++++++++++++- testcases/kernel/mem/oom/oom04.c | 20 ++++++++++++++------ testcases/kernel/mem/oom/oom05.c | 26 ++++++++++++++++---------- 3 files changed, 42 insertions(+), 17 deletions(-) diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c index 5397177..1232b4f 100644 --- a/testcases/kernel/mem/lib/mem.c +++ b/testcases/kernel/mem/lib/mem.c @@ -792,7 +792,18 @@ void write_cpusets(long nd) write_cpuset_files(CPATH_NEW, "mems", buf); gather_node_cpus(cpus, nd); - write_cpuset_files(CPATH_NEW, "cpus", cpus); + /* + * If the 'nd' node doesn't contain any CPUs, + * the first ID of CPU '0' will be used as + * the value of cpuset.cpus. + */ + if (strlen(cpus) != 0) { + write_cpuset_files(CPATH_NEW, "cpus", cpus); + } else { + tst_resm(TINFO, "No CPUs in the node%ld; " + "using only CPU0", nd); + write_cpuset_files(CPATH_NEW, "cpus", "0"); + } SAFE_FILE_PRINTF(NULL, CPATH_NEW "/tasks", "%d", getpid()); } diff --git a/testcases/kernel/mem/oom/oom04.c b/testcases/kernel/mem/oom/oom04.c index 4d3f2f4..ac48c36 100644 --- a/testcases/kernel/mem/oom/oom04.c +++ b/testcases/kernel/mem/oom/oom04.c @@ -85,6 +85,8 @@ int main(int argc, char *argv[]) void setup(void) { + int memnode, ret; + tst_require_root(NULL); tst_sig(FORK, DEF_HANDLER, cleanup); TEST_PAUSE; @@ -93,12 +95,18 @@ void setup(void) set_sys_tune("overcommit_memory", 1, 1); mount_mem("cpuset", "cpuset", NULL, CPATH, CPATH_NEW); - if (is_numa(cleanup) > 0) - /* For NUMA system, using the first node for cpuset.mems */ - write_cpusets(get_a_numa_node(cleanup)); - else - /* For nonNUMA system, using node0 for cpuset.mems */ - write_cpusets(0); + + /* + * Some nodes do not contain memory, so use + * get_allowed_nodes(NH_MEMS) to get a memory + * node. This operation also applies to Non-NUMA + * systems. + */ + ret = get_allowed_nodes(NH_MEMS, 1, &memnode); + if (ret < 0) + tst_brkm(TBROK, NULL, "Failed to get a memory node " + "using get_allowed_nodes()"); + write_cpusets(memnode); } void cleanup(void) diff --git a/testcases/kernel/mem/oom/oom05.c b/testcases/kernel/mem/oom/oom05.c index 15feba5..545b5f0 100644 --- a/testcases/kernel/mem/oom/oom05.c +++ b/testcases/kernel/mem/oom/oom05.c @@ -108,24 +108,30 @@ int main(int argc, char *argv[]) void setup(void) { + int ret, memnode; + tst_require_root(NULL); tst_sig(FORK, DEF_HANDLER, cleanup); TEST_PAUSE; + overcommit = get_sys_tune("overcommit_memory"); + set_sys_tune("overcommit_memory", 1, 1); + mount_mem("memcg", "cgroup", "memory", MEMCG_PATH, MEMCG_PATH_NEW); mount_mem("cpuset", "cpuset", NULL, CPATH, CPATH_NEW); write_memcg(); - set_sys_tune("overcommit_memory", 1, 1); - - if (is_numa(cleanup)) - /* For NUMA system, using the first node for cpuset.mems */ - write_cpusets(get_a_numa_node(cleanup)); - else - /* For nonNUMA system, using node0 for cpuset.mems */ - write_cpusets(0); - - overcommit = get_sys_tune("overcommit_memory"); + /* + * Some nodes do not contain memory, so use + * get_allowed_nodes(NH_MEMS) to get a memory + * node. This operation also applies to Non-NUMA + * systems. + */ + ret = get_allowed_nodes(NH_MEMS, 1, &memnode); + if (ret < 0) + tst_brkm(TBROK, NULL, "Failed to get a memory node " + "using get_allowed_nodes()"); + write_cpusets(memnode); } void cleanup(void) hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-05-07 13:21:26
|
The branch, master, has been updated via 981d33aad3b33c4625b88990fbf2fad5470d47e0 (commit) from 00ca3f69134db1fee11bcc8ce2b67757ad012e9f (commit) - Log ----------------------------------------------------------------- commit 981d33aad3b33c4625b88990fbf2fad5470d47e0 Author: Dave Kleikamp <dav...@or...> Date: Mon May 6 11:47:30 2013 -0500 Fix retval parameter to pthread_join() The retval parameter to pthread_join() is a pointer to a pointer. There are several instances where a pointer to int is being passed instead. This can result in a bus error on sparc64 when the pointer is not aligned on a 64-bit boundary. Of course, it's a potential problem on any 64-bit platform. Also removed an unnecessary malloc & free from mmstress.c Signed-off-by: Dave Kleikamp <dav...@or...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/io/ltp-aiodio/aio-stress.c | 3 +-- testcases/kernel/io/stress_cd/stress_cd.c | 9 +++++---- testcases/kernel/mem/mtest05/mmstress.c | 9 +++------ testcases/kernel/mem/mtest06/mmap1.c | 8 ++++---- testcases/kernel/mem/mtest06/mmap3.c | 9 +++++---- testcases/kernel/mem/mtest06/shmat1.c | 10 +++++----- testcases/kernel/mem/mtest07/shm_test.c | 6 +++--- testcases/network/nfs/nfsstress/make_tree.c | 6 +++--- .../interfaces/pthread_cond_timedwait/4-1.c | 6 +++--- 9 files changed, 32 insertions(+), 34 deletions(-) diff --git a/testcases/kernel/io/ltp-aiodio/aio-stress.c b/testcases/kernel/io/ltp-aiodio/aio-stress.c index 710ef3d..0b7148c 100644 --- a/testcases/kernel/io/ltp-aiodio/aio-stress.c +++ b/testcases/kernel/io/ltp-aiodio/aio-stress.c @@ -1233,7 +1233,6 @@ typedef void *(*start_routine) (void *); int run_workers(struct thread_info *t, int num_threads) { int ret; - int thread_ret; int i; for (i = 0; i < num_threads; i++) { @@ -1246,7 +1245,7 @@ int run_workers(struct thread_info *t, int num_threads) } } for (i = 0; i < num_threads; i++) { - ret = pthread_join(t[i].tid, (void *)&thread_ret); + ret = pthread_join(t[i].tid, NULL); if (ret) { perror("pthread_join"); exit(1); diff --git a/testcases/kernel/io/stress_cd/stress_cd.c b/testcases/kernel/io/stress_cd/stress_cd.c index 1048b62..3e1e697 100644 --- a/testcases/kernel/io/stress_cd/stress_cd.c +++ b/testcases/kernel/io/stress_cd/stress_cd.c @@ -143,15 +143,16 @@ int main(int argc, char **argv) sys_error("pthread_attr_destroy failed", __LINE__); for (i = 0; i < num_threads; i++) { - int exit_value; + void *exit_value; printf("\tThread [main]: waiting for thread: %d\n", i + 1); /*if (pthread_join ((pthread_t*) array [i], (void **) &exit_value)) */ - if (pthread_join((pthread_t) array[i], (void **)&exit_value)) + if (pthread_join(array[i], &exit_value)) sys_error("pthread_join failed", __LINE__); if (debug) - printf("\tThread [%d]: return %d\n", i + 1, exit_value); - rc += exit_value; + printf("\tThread [%d]: return %ld\n", i + 1, + (long)exit_value); + rc += (long)exit_value; } free(array); free(arg); diff --git a/testcases/kernel/mem/mtest05/mmstress.c b/testcases/kernel/mem/mtest05/mmstress.c index f845290..bb746ec 100644 --- a/testcases/kernel/mem/mtest05/mmstress.c +++ b/testcases/kernel/mem/mtest05/mmstress.c @@ -361,7 +361,7 @@ RETINFO_t *map_and_thread(char *tmpfile, /* name of temporary file to be created int fd = 0; /* file descriptor of the file created */ int thrd_ndx = 0; /* index to the number of threads created */ int map_type = 0; /* specifies the type of the mapped object */ - int *th_status = 0; /* status of the thread when it is finished */ + void *th_status; /* status of the thread when it is finished */ long th_args[5]; /* argument list passed to thread_fault() */ char *empty_buf = NULL; /* empty buffer used to fill temp file */ long pagesize /* contains page size at runtime */ @@ -474,13 +474,12 @@ RETINFO_t *map_and_thread(char *tmpfile, /* name of temporary file to be created if (verbose_print) tst_resm(TINFO, "map_and_thread(): pthread_create() success"); wait_thread = FALSE; - th_status = malloc(sizeof(int *)); /* suspend the execution of the calling thread till the execution of the */ /* other thread has been terminated. */ for (thrd_ndx = 0; thrd_ndx < NUMTHREAD; thrd_ndx++) { - if (pthread_join(pthread_ids[thrd_ndx], (void **)th_status)) { + if (pthread_join(pthread_ids[thrd_ndx], &th_status)) { perror("map_and_thread(): pthread_join()"); free(empty_buf); fflush(NULL); @@ -489,7 +488,7 @@ RETINFO_t *map_and_thread(char *tmpfile, /* name of temporary file to be created retinfo->status = FAILED; return retinfo; } else { - if ((int)*th_status == 1) { + if ((long)th_status == 1) { tst_resm(TINFO, "thread [%ld] - process exited with errors", (long)pthread_ids[thrd_ndx]); @@ -513,13 +512,11 @@ RETINFO_t *map_and_thread(char *tmpfile, /* name of temporary file to be created */ if (remove_files(tmpfile, map_addr) == FAILED) { free(empty_buf); - free(th_status); retinfo->status = FAILED; return retinfo; } free(empty_buf); - free(th_status); close(fd); retinfo->status = SUCCESS; return retinfo; diff --git a/testcases/kernel/mem/mtest06/mmap1.c b/testcases/kernel/mem/mtest06/mmap1.c index 61d5369..7c80bb4 100644 --- a/testcases/kernel/mem/mtest06/mmap1.c +++ b/testcases/kernel/mem/mtest06/mmap1.c @@ -285,7 +285,7 @@ int main(int argc, char **argv) int num_iter; double exec_time; int fd; - int status[2]; + void *status; pthread_t thid[2]; long chld_args[3]; extern char *optarg; @@ -387,15 +387,15 @@ int main(int argc, char **argv) tst_resm(TINFO, "created reading thread[%lu]", thid[1]); for (i = 0; i < 2; i++) { - if ((ret = pthread_join(thid[i], (void *)&status[i]))) + if ((ret = pthread_join(thid[i], &status))) tst_brkm(TBROK, NULL, "main(): pthread_join(): %s", strerror(ret)); - if (status[i]) + if (status) tst_brkm(TFAIL, NULL, "thread [%lu] - process exited " - "with %d", thid[i], status[i]); + "with %ld", thid[i], (long)status); } close(fd); diff --git a/testcases/kernel/mem/mtest06/mmap3.c b/testcases/kernel/mem/mtest06/mmap3.c index ec4de47..e758314 100644 --- a/testcases/kernel/mem/mtest06/mmap3.c +++ b/testcases/kernel/mem/mtest06/mmap3.c @@ -264,7 +264,7 @@ int main(int argc, /* number of input parameters. */ int num_thrd; /* number of threads to create */ int thrd_ndx; /* index into the array of threads. */ float exec_time; /* period for which the test is executed */ - int status; /* exit status for light weight process */ + void *status; /* exit status for light weight process */ int sig_ndx; /* index into signal handler structure. */ pthread_t thid[1000]; /* pids of process that will map/write/unmap */ long chld_args[3]; /* arguments to funcs execed by child process */ @@ -362,14 +362,15 @@ int main(int argc, /* number of input parameters. */ /* wait for the children to terminate */ for (thrd_ndx = 0; thrd_ndx < num_thrd; thrd_ndx++) { - if (pthread_join(thid[thrd_ndx], (void *)&status)) { + if (pthread_join(thid[thrd_ndx], &status)) { perror("main(): pthread_create()"); exit(-1); } else { if (status) { fprintf(stderr, - "thread [%d] - process exited with errors %d\n", - WEXITSTATUS(status), status); + "thread [%d] - process exited with errors %ld\n", + WEXITSTATUS((long)status), + (long)status); exit(-1); } } diff --git a/testcases/kernel/mem/mtest06/shmat1.c b/testcases/kernel/mem/mtest06/shmat1.c index ddaa49e..db37eca 100644 --- a/testcases/kernel/mem/mtest06/shmat1.c +++ b/testcases/kernel/mem/mtest06/shmat1.c @@ -392,7 +392,7 @@ int main(int argc, /* number of input parameters. */ int num_iter; /* number of iteration to perform */ int thrd_ndx; /* index into the array of threads. */ double exec_time; /* period for which the test is executed */ - int status[1]; /* exit status for light weight process */ + void *status; /* exit status for light weight process */ int sig_ndx; /* index into signal handler structure. */ pthread_t thid[1000]; /* pids of process that will map/write/unmap */ long chld_args[3]; /* arguments to funcs execed by child process */ @@ -497,14 +497,14 @@ int main(int argc, /* number of input parameters. */ /* wait for the children to terminate */ for (thrd_ndx = 0; thrd_ndx < 3; thrd_ndx++) { - if (pthread_join(thid[thrd_ndx], (void *)status)) { + if (pthread_join(thid[thrd_ndx], &status)) { perror("main(): pthread_create()"); exit(-1); } - if (*status == -1) { + if (status == (void *)-1) { fprintf(stderr, - "thread [%#lx] - process exited with errors %d\n", - thid[thrd_ndx], *status); + "thread [%#lx] - process exited with errors %ld\n", + thid[thrd_ndx], (long)status); exit(-1); } } diff --git a/testcases/kernel/mem/mtest07/shm_test.c b/testcases/kernel/mem/mtest07/shm_test.c index 2f2c9f1..b3d6aaf 100644 --- a/testcases/kernel/mem/mtest07/shm_test.c +++ b/testcases/kernel/mem/mtest07/shm_test.c @@ -273,7 +273,7 @@ int main(int argc, /* number of input parameters */ int num_thrd = MAXT; /* number of threads to create */ int num_reps = MAXR; /* number of repatitions the test is run */ int thrd_ndx; /* index into the array of thread ids */ - int th_status; /* exit status of LWP's */ + void *th_status; /* exit status of LWP's */ int map_size; /* size of the file mapped. */ int shmkey = 1969; /* key used to generate shmid by shmget() */ pthread_t thrdid[30]; /* maxinum of 30 threads allowed */ @@ -344,12 +344,12 @@ int main(int argc, /* number of input parameters */ sync(); for (thrd_ndx = 0; thrd_ndx < num_thrd; thrd_ndx++) { - if (pthread_join(thrdid[thrd_ndx], (void *)&th_status) != 0) { + if (pthread_join(thrdid[thrd_ndx], &th_status) != 0) { perror("shmat_rd_wr(): pthread_join()"); exit(-1); } else { dprt("WE ARE HERE %d\n", __LINE__); - if (th_status == -1) { + if (th_status == (void *)-1) { fprintf(stderr, "thread [%ld] - process exited with errors\n", (long)thrdid[thrd_ndx]); diff --git a/testcases/network/nfs/nfsstress/make_tree.c b/testcases/network/nfs/nfsstress/make_tree.c index 7df0b8d..7b18da3 100644 --- a/testcases/network/nfs/nfsstress/make_tree.c +++ b/testcases/network/nfs/nfsstress/make_tree.c @@ -721,7 +721,7 @@ int main(int argc, /* number of input parameters */ int num_dirs = MAXD; /* number of subdirectories to create */ int num_files = MAXF; /* number of files in each subdirectory */ int thrd_ndx; /* index into the array of thread ids */ - int th_status[1]; /* exit status of LWP's */ + void *th_status; /* exit status of LWP's */ pthread_t thrdid[30]; /* maxinum of 30 threads allowed */ long chld_args[3]; /* arguments to the thread function */ extern int optopt; /* options to the program */ @@ -778,12 +778,12 @@ int main(int argc, /* number of input parameters */ sync(); for (thrd_ndx = 0; thrd_ndx < num_thrd; thrd_ndx++) { - if (pthread_join(thrdid[thrd_ndx], (void **)&th_status) != 0) { + if (pthread_join(thrdid[thrd_ndx], &th_status) != 0) { perror("crte_mk_rm(): pthread_join()"); exit(-1); } else { dprt("WE ARE HERE %d\n", __LINE__); - if (*th_status == -1) { + if (th_status == (void *)-1) { fprintf(stderr, "thread [%ld] - process exited with errors\n", thrdid[thrd_ndx]); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-1.c index 43cdf3f..6e0724e 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-1.c @@ -67,7 +67,7 @@ void *t1_func(void *arg) int main(void) { pthread_t thread1; - int th_ret; + void *th_ret; if (pthread_mutex_init(&td.mutex, NULL) != 0) { fprintf(stderr, "Fail to initialize mutex\n"); @@ -85,6 +85,6 @@ int main(void) fprintf(stderr, "Main: no condition is going to be met\n"); - pthread_join(thread1, (void *)&th_ret); - return th_ret; + pthread_join(thread1, &th_ret); + return (long)th_ret; } hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-05-06 16:21:38
|
The branch, master, has been updated via 00ca3f69134db1fee11bcc8ce2b67757ad012e9f (commit) via b5d8a7bd0f2ab6cea0de09b88e3e5cee48ca2518 (commit) via 65b629a7d9f26d8a3e02bf924af69079e480d928 (commit) via 41e3ae641f7a261b69e455c1ae8f927d91bf83a2 (commit) from 8c40131496399102fb4decd575e39cbf0968e3dd (commit) - Log ----------------------------------------------------------------- commit 00ca3f69134db1fee11bcc8ce2b67757ad012e9f Author: Riku Voipio <rik...@li...> Date: Mon May 6 16:23:01 2013 +0300 mem: shmt: set 16kb incrediment for Aarch64 Signed-off-by: Riku Voipio <rik...@li...> Signed-off-by: Mike Frysinger <va...@ge...> commit b5d8a7bd0f2ab6cea0de09b88e3e5cee48ca2518 Author: Riku Voipio <rik...@li...> Date: Mon May 6 16:23:00 2013 +0300 kernel: regen linux_syscall_numbers.h Signed-off-by: Riku Voipio <rik...@li...> Signed-off-by: Mike Frysinger <va...@ge...> commit 65b629a7d9f26d8a3e02bf924af69079e480d928 Author: Riku Voipio <rik...@li...> Date: Mon May 6 16:22:59 2013 +0300 kernel: set invalid syscall as -1 instead of 0 System call number 0 might be in use in selected syscalls. Signed-off-by: Riku Voipio <rik...@li...> Signed-off-by: Mike Frysinger <va...@ge...> commit 41e3ae641f7a261b69e455c1ae8f927d91bf83a2 Author: Riku Voipio <rik...@li...> Date: Mon May 6 16:22:58 2013 +0300 kernel: add aarch64 support Basic commit to support Aarch64, 64-bit Arm platform Signed-off-by: Riku Voipio <rik...@li...> Signed-off-by: Mike Frysinger <va...@ge...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/include/aarch64.in | 257 ++++ testcases/kernel/include/linux_syscall_numbers.h | 1608 ++++++++++++++++------ testcases/kernel/include/order | 1 + testcases/kernel/include/regen.sh | 5 +- testcases/kernel/mem/shmt/shmt09.c | 4 +- 5 files changed, 1467 insertions(+), 408 deletions(-) create mode 100644 testcases/kernel/include/aarch64.in diff --git a/testcases/kernel/include/aarch64.in b/testcases/kernel/include/aarch64.in new file mode 100644 index 0000000..a845be0 --- /dev/null +++ b/testcases/kernel/include/aarch64.in @@ -0,0 +1,257 @@ +io_setup 0 +io_destroy 1 +io_submit 2 +io_cancel 3 +io_getevents 4 +setxattr 5 +lsetxattr 6 +fsetxattr 7 +getxattr 8 +lgetxattr 9 +fgetxattr 10 +listxattr 11 +llistxattr 12 +flistxattr 13 +removexattr 14 +lremovexattr 15 +fremovexattr 16 +getcwd 17 +lookup_dcookie 18 +eventfd2 19 +epoll_create1 20 +epoll_ctl 21 +epoll_pwait 22 +dup 23 +dup3 24 +fcntl 25 +inotify_init1 26 +inotify_add_watch 27 +inotify_rm_watch 28 +ioctl 29 +ioprio_set 30 +ioprio_get 31 +flock 32 +mknodat 33 +mkdirat 34 +unlinkat 35 +symlinkat 36 +linkat 37 +renameat 38 +umount2 39 +mount 40 +pivot_root 41 +nfsservctl 42 +statfs 43 +fstatfs 44 +truncate 45 +ftruncate 46 +fallocate 47 +faccessat 48 +chdir 49 +fchdir 50 +chroot 51 +fchmod 52 +fchmodat 53 +fchownat 54 +fchown 55 +openat 56 +close 57 +vhangup 58 +pipe2 59 +quotactl 60 +getdents64 61 +lseek 62 +read 63 +write 64 +readv 65 +writev 66 +pread64 67 +pwrite64 68 +preadv 69 +pwritev 70 +sendfile 71 +pselect6 72 +ppoll 73 +signalfd4 74 +vmsplice 75 +splice 76 +tee 77 +readlinkat 78 +fstatat 79 +fstat 80 +sync 81 +fsync 82 +fdatasync 83 +sync_file_range2 84 +sync_file_range 84 +timerfd_create 85 +timerfd_settime 86 +timerfd_gettime 87 +utimensat 88 +acct 89 +capget 90 +capset 91 +personality 92 +exit 93 +exit_group 94 +waitid 95 +set_tid_address 96 +unshare 97 +futex 98 +set_robust_list 99 +get_robust_list 100 +nanosleep 101 +getitimer 102 +setitimer 103 +kexec_load 104 +init_module 105 +delete_module 106 +timer_create 107 +timer_gettime 108 +timer_getoverrun 109 +timer_settime 110 +timer_delete 111 +clock_settime 112 +clock_gettime 113 +clock_getres 114 +clock_nanosleep 115 +syslog 116 +ptrace 117 +sched_setparam 118 +sched_setscheduler 119 +sched_getscheduler 120 +sched_getparam 121 +sched_setaffinity 122 +sched_getaffinity 123 +sched_yield 124 +sched_get_priority_max 125 +sched_get_priority_min 126 +sched_rr_get_interval 127 +restart_syscall 128 +kill 129 +tkill 130 +tgkill 131 +sigaltstack 132 +rt_sigsuspend 133 +rt_sigaction 134 +rt_sigprocmask 135 +rt_sigpending 136 +rt_sigtimedwait 137 +rt_sigqueueinfo 138 +rt_sigreturn 139 +setpriority 140 +getpriority 141 +reboot 142 +setregid 143 +setgid 144 +setreuid 145 +setuid 146 +setresuid 147 +getresuid 148 +setresgid 149 +getresgid 150 +setfsuid 151 +setfsgid 152 +times 153 +setpgid 154 +getpgid 155 +getsid 156 +setsid 157 +getgroups 158 +setgroups 159 +uname 160 +sethostname 161 +setdomainname 162 +getrlimit 163 +setrlimit 164 +getrusage 165 +umask 166 +prctl 167 +getcpu 168 +gettimeofday 169 +settimeofday 170 +adjtimex 171 +getpid 172 +getppid 173 +getuid 174 +geteuid 175 +getgid 176 +getegid 177 +gettid 178 +sysinfo 179 +mq_open 180 +mq_unlink 181 +mq_timedsend 182 +mq_timedreceive 183 +mq_notify 184 +mq_getsetattr 185 +msgget 186 +msgctl 187 +msgrcv 188 +msgsnd 189 +semget 190 +semctl 191 +semtimedop 192 +semop 193 +shmget 194 +shmctl 195 +shmat 196 +shmdt 197 +socket 198 +socketpair 199 +bind 200 +listen 201 +accept 202 +connect 203 +getsockname 204 +getpeername 205 +sendto 206 +recvfrom 207 +setsockopt 208 +getsockopt 209 +shutdown 210 +sendmsg 211 +recvmsg 212 +readahead 213 +brk 214 +munmap 215 +mremap 216 +add_key 217 +request_key 218 +keyctl 219 +clone 220 +execve 221 +mmap 222 +fadvise64 223 +swapon 224 +swapoff 225 +mprotect 226 +msync 227 +mlock 228 +munlock 229 +mlockall 230 +munlockall 231 +mincore 232 +madvise 233 +remap_file_pages 234 +mbind 235 +get_mempolicy 236 +set_mempolicy 237 +migrate_pages 238 +move_pages 239 +rt_tgsigqueueinfo 240 +perf_event_open 241 +accept4 242 +recvmmsg 243 +wait4 260 +prlimit64 261 +fanotify_init 262 +fanotify_mark 263 +name_to_handle_at 264 +open_by_handle_at 265 +clock_adjtime 266 +syncfs 267 +setns 268 +sendmmsg 269 +cacheflush 0x1002 +set_tls 0x1005 diff --git a/testcases/kernel/include/linux_syscall_numbers.h b/testcases/kernel/include/linux_syscall_numbers.h index 41356c6..38931cf 100644 --- a/testcases/kernel/include/linux_syscall_numbers.h +++ b/testcases/kernel/include/linux_syscall_numbers.h @@ -19,7 +19,7 @@ #define ltp_syscall(NR, ...) ({ \ int __ret; \ - if (NR == 0) { \ + if (NR == __LTP__NR_INVALID_SYSCALL) { \ errno = ENOSYS; \ __ret = -1; \ } else { \ @@ -33,6 +33,782 @@ __ret; \ }) +#define __LTP__NR_INVALID_SYSCALL -1 + +#ifdef __aarch64__ +# ifndef __NR_io_setup +# define __NR_io_setup 0 +# endif +# ifndef __NR_io_destroy +# define __NR_io_destroy 1 +# endif +# ifndef __NR_io_submit +# define __NR_io_submit 2 +# endif +# ifndef __NR_io_cancel +# define __NR_io_cancel 3 +# endif +# ifndef __NR_io_getevents +# define __NR_io_getevents 4 +# endif +# ifndef __NR_setxattr +# define __NR_setxattr 5 +# endif +# ifndef __NR_lsetxattr +# define __NR_lsetxattr 6 +# endif +# ifndef __NR_fsetxattr +# define __NR_fsetxattr 7 +# endif +# ifndef __NR_getxattr +# define __NR_getxattr 8 +# endif +# ifndef __NR_lgetxattr +# define __NR_lgetxattr 9 +# endif +# ifndef __NR_fgetxattr +# define __NR_fgetxattr 10 +# endif +# ifndef __NR_listxattr +# define __NR_listxattr 11 +# endif +# ifndef __NR_llistxattr +# define __NR_llistxattr 12 +# endif +# ifndef __NR_flistxattr +# define __NR_flistxattr 13 +# endif +# ifndef __NR_removexattr +# define __NR_removexattr 14 +# endif +# ifndef __NR_lremovexattr +# define __NR_lremovexattr 15 +# endif +# ifndef __NR_fremovexattr +# define __NR_fremovexattr 16 +# endif +# ifndef __NR_getcwd +# define __NR_getcwd 17 +# endif +# ifndef __NR_lookup_dcookie +# define __NR_lookup_dcookie 18 +# endif +# ifndef __NR_eventfd2 +# define __NR_eventfd2 19 +# endif +# ifndef __NR_epoll_create1 +# define __NR_epoll_create1 20 +# endif +# ifndef __NR_epoll_ctl +# define __NR_epoll_ctl 21 +# endif +# ifndef __NR_epoll_pwait +# define __NR_epoll_pwait 22 +# endif +# ifndef __NR_dup +# define __NR_dup 23 +# endif +# ifndef __NR_dup3 +# define __NR_dup3 24 +# endif +# ifndef __NR_fcntl +# define __NR_fcntl 25 +# endif +# ifndef __NR_inotify_init1 +# define __NR_inotify_init1 26 +# endif +# ifndef __NR_inotify_add_watch +# define __NR_inotify_add_watch 27 +# endif +# ifndef __NR_inotify_rm_watch +# define __NR_inotify_rm_watch 28 +# endif +# ifndef __NR_ioctl +# define __NR_ioctl 29 +# endif +# ifndef __NR_ioprio_set +# define __NR_ioprio_set 30 +# endif +# ifndef __NR_ioprio_get +# define __NR_ioprio_get 31 +# endif +# ifndef __NR_flock +# define __NR_flock 32 +# endif +# ifndef __NR_mknodat +# define __NR_mknodat 33 +# endif +# ifndef __NR_mkdirat +# define __NR_mkdirat 34 +# endif +# ifndef __NR_unlinkat +# define __NR_unlinkat 35 +# endif +# ifndef __NR_symlinkat +# define __NR_symlinkat 36 +# endif +# ifndef __NR_linkat +# define __NR_linkat 37 +# endif +# ifndef __NR_renameat +# define __NR_renameat 38 +# endif +# ifndef __NR_umount2 +# define __NR_umount2 39 +# endif +# ifndef __NR_mount +# define __NR_mount 40 +# endif +# ifndef __NR_pivot_root +# define __NR_pivot_root 41 +# endif +# ifndef __NR_nfsservctl +# define __NR_nfsservctl 42 +# endif +# ifndef __NR_statfs +# define __NR_statfs 43 +# endif +# ifndef __NR_fstatfs +# define __NR_fstatfs 44 +# endif +# ifndef __NR_truncate +# define __NR_truncate 45 +# endif +# ifndef __NR_ftruncate +# define __NR_ftruncate 46 +# endif +# ifndef __NR_fallocate +# define __NR_fallocate 47 +# endif +# ifndef __NR_faccessat +# define __NR_faccessat 48 +# endif +# ifndef __NR_chdir +# define __NR_chdir 49 +# endif +# ifndef __NR_fchdir +# define __NR_fchdir 50 +# endif +# ifndef __NR_chroot +# define __NR_chroot 51 +# endif +# ifndef __NR_fchmod +# define __NR_fchmod 52 +# endif +# ifndef __NR_fchmodat +# define __NR_fchmodat 53 +# endif +# ifndef __NR_fchownat +# define __NR_fchownat 54 +# endif +# ifndef __NR_fchown +# define __NR_fchown 55 +# endif +# ifndef __NR_openat +# define __NR_openat 56 +# endif +# ifndef __NR_close +# define __NR_close 57 +# endif +# ifndef __NR_vhangup +# define __NR_vhangup 58 +# endif +# ifndef __NR_pipe2 +# define __NR_pipe2 59 +# endif +# ifndef __NR_quotactl +# define __NR_quotactl 60 +# endif +# ifndef __NR_getdents64 +# define __NR_getdents64 61 +# endif +# ifndef __NR_lseek +# define __NR_lseek 62 +# endif +# ifndef __NR_read +# define __NR_read 63 +# endif +# ifndef __NR_write +# define __NR_write 64 +# endif +# ifndef __NR_readv +# define __NR_readv 65 +# endif +# ifndef __NR_writev +# define __NR_writev 66 +# endif +# ifndef __NR_pread64 +# define __NR_pread64 67 +# endif +# ifndef __NR_pwrite64 +# define __NR_pwrite64 68 +# endif +# ifndef __NR_preadv +# define __NR_preadv 69 +# endif +# ifndef __NR_pwritev +# define __NR_pwritev 70 +# endif +# ifndef __NR_sendfile +# define __NR_sendfile 71 +# endif +# ifndef __NR_pselect6 +# define __NR_pselect6 72 +# endif +# ifndef __NR_ppoll +# define __NR_ppoll 73 +# endif +# ifndef __NR_signalfd4 +# define __NR_signalfd4 74 +# endif +# ifndef __NR_vmsplice +# define __NR_vmsplice 75 +# endif +# ifndef __NR_splice +# define __NR_splice 76 +# endif +# ifndef __NR_tee +# define __NR_tee 77 +# endif +# ifndef __NR_readlinkat +# define __NR_readlinkat 78 +# endif +# ifndef __NR_fstatat +# define __NR_fstatat 79 +# endif +# ifndef __NR_fstat +# define __NR_fstat 80 +# endif +# ifndef __NR_sync +# define __NR_sync 81 +# endif +# ifndef __NR_fsync +# define __NR_fsync 82 +# endif +# ifndef __NR_fdatasync +# define __NR_fdatasync 83 +# endif +# ifndef __NR_sync_file_range2 +# define __NR_sync_file_range2 84 +# endif +# ifndef __NR_sync_file_range +# define __NR_sync_file_range 84 +# endif +# ifndef __NR_timerfd_create +# define __NR_timerfd_create 85 +# endif +# ifndef __NR_timerfd_settime +# define __NR_timerfd_settime 86 +# endif +# ifndef __NR_timerfd_gettime +# define __NR_timerfd_gettime 87 +# endif +# ifndef __NR_utimensat +# define __NR_utimensat 88 +# endif +# ifndef __NR_acct +# define __NR_acct 89 +# endif +# ifndef __NR_capget +# define __NR_capget 90 +# endif +# ifndef __NR_capset +# define __NR_capset 91 +# endif +# ifndef __NR_personality +# define __NR_personality 92 +# endif +# ifndef __NR_exit +# define __NR_exit 93 +# endif +# ifndef __NR_exit_group +# define __NR_exit_group 94 +# endif +# ifndef __NR_waitid +# define __NR_waitid 95 +# endif +# ifndef __NR_set_tid_address +# define __NR_set_tid_address 96 +# endif +# ifndef __NR_unshare +# define __NR_unshare 97 +# endif +# ifndef __NR_futex +# define __NR_futex 98 +# endif +# ifndef __NR_set_robust_list +# define __NR_set_robust_list 99 +# endif +# ifndef __NR_get_robust_list +# define __NR_get_robust_list 100 +# endif +# ifndef __NR_nanosleep +# define __NR_nanosleep 101 +# endif +# ifndef __NR_getitimer +# define __NR_getitimer 102 +# endif +# ifndef __NR_setitimer +# define __NR_setitimer 103 +# endif +# ifndef __NR_kexec_load +# define __NR_kexec_load 104 +# endif +# ifndef __NR_init_module +# define __NR_init_module 105 +# endif +# ifndef __NR_delete_module +# define __NR_delete_module 106 +# endif +# ifndef __NR_timer_create +# define __NR_timer_create 107 +# endif +# ifndef __NR_timer_gettime +# define __NR_timer_gettime 108 +# endif +# ifndef __NR_timer_getoverrun +# define __NR_timer_getoverrun 109 +# endif +# ifndef __NR_timer_settime +# define __NR_timer_settime 110 +# endif +# ifndef __NR_timer_delete +# define __NR_timer_delete 111 +# endif +# ifndef __NR_clock_settime +# define __NR_clock_settime 112 +# endif +# ifndef __NR_clock_gettime +# define __NR_clock_gettime 113 +# endif +# ifndef __NR_clock_getres +# define __NR_clock_getres 114 +# endif +# ifndef __NR_clock_nanosleep +# define __NR_clock_nanosleep 115 +# endif +# ifndef __NR_syslog +# define __NR_syslog 116 +# endif +# ifndef __NR_ptrace +# define __NR_ptrace 117 +# endif +# ifndef __NR_sched_setparam +# define __NR_sched_setparam 118 +# endif +# ifndef __NR_sched_setscheduler +# define __NR_sched_setscheduler 119 +# endif +# ifndef __NR_sched_getscheduler +# define __NR_sched_getscheduler 120 +# endif +# ifndef __NR_sched_getparam +# define __NR_sched_getparam 121 +# endif +# ifndef __NR_sched_setaffinity +# define __NR_sched_setaffinity 122 +# endif +# ifndef __NR_sched_getaffinity +# define __NR_sched_getaffinity 123 +# endif +# ifndef __NR_sched_yield +# define __NR_sched_yield 124 +# endif +# ifndef __NR_sched_get_priority_max +# define __NR_sched_get_priority_max 125 +# endif +# ifndef __NR_sched_get_priority_min +# define __NR_sched_get_priority_min 126 +# endif +# ifndef __NR_sched_rr_get_interval +# define __NR_sched_rr_get_interval 127 +# endif +# ifndef __NR_restart_syscall +# define __NR_restart_syscall 128 +# endif +# ifndef __NR_kill +# define __NR_kill 129 +# endif +# ifndef __NR_tkill +# define __NR_tkill 130 +# endif +# ifndef __NR_tgkill +# define __NR_tgkill 131 +# endif +# ifndef __NR_sigaltstack +# define __NR_sigaltstack 132 +# endif +# ifndef __NR_rt_sigsuspend +# define __NR_rt_sigsuspend 133 +# endif +# ifndef __NR_rt_sigaction +# define __NR_rt_sigaction 134 +# endif +# ifndef __NR_rt_sigprocmask +# define __NR_rt_sigprocmask 135 +# endif +# ifndef __NR_rt_sigpending +# define __NR_rt_sigpending 136 +# endif +# ifndef __NR_rt_sigtimedwait +# define __NR_rt_sigtimedwait 137 +# endif +# ifndef __NR_rt_sigqueueinfo +# define __NR_rt_sigqueueinfo 138 +# endif +# ifndef __NR_rt_sigreturn +# define __NR_rt_sigreturn 139 +# endif +# ifndef __NR_setpriority +# define __NR_setpriority 140 +# endif +# ifndef __NR_getpriority +# define __NR_getpriority 141 +# endif +# ifndef __NR_reboot +# define __NR_reboot 142 +# endif +# ifndef __NR_setregid +# define __NR_setregid 143 +# endif +# ifndef __NR_setgid +# define __NR_setgid 144 +# endif +# ifndef __NR_setreuid +# define __NR_setreuid 145 +# endif +# ifndef __NR_setuid +# define __NR_setuid 146 +# endif +# ifndef __NR_setresuid +# define __NR_setresuid 147 +# endif +# ifndef __NR_getresuid +# define __NR_getresuid 148 +# endif +# ifndef __NR_setresgid +# define __NR_setresgid 149 +# endif +# ifndef __NR_getresgid +# define __NR_getresgid 150 +# endif +# ifndef __NR_setfsuid +# define __NR_setfsuid 151 +# endif +# ifndef __NR_setfsgid +# define __NR_setfsgid 152 +# endif +# ifndef __NR_times +# define __NR_times 153 +# endif +# ifndef __NR_setpgid +# define __NR_setpgid 154 +# endif +# ifndef __NR_getpgid +# define __NR_getpgid 155 +# endif +# ifndef __NR_getsid +# define __NR_getsid 156 +# endif +# ifndef __NR_setsid +# define __NR_setsid 157 +# endif +# ifndef __NR_getgroups +# define __NR_getgroups 158 +# endif +# ifndef __NR_setgroups +# define __NR_setgroups 159 +# endif +# ifndef __NR_uname +# define __NR_uname 160 +# endif +# ifndef __NR_sethostname +# define __NR_sethostname 161 +# endif +# ifndef __NR_setdomainname +# define __NR_setdomainname 162 +# endif +# ifndef __NR_getrlimit +# define __NR_getrlimit 163 +# endif +# ifndef __NR_setrlimit +# define __NR_setrlimit 164 +# endif +# ifndef __NR_getrusage +# define __NR_getrusage 165 +# endif +# ifndef __NR_umask +# define __NR_umask 166 +# endif +# ifndef __NR_prctl +# define __NR_prctl 167 +# endif +# ifndef __NR_getcpu +# define __NR_getcpu 168 +# endif +# ifndef __NR_gettimeofday +# define __NR_gettimeofday 169 +# endif +# ifndef __NR_settimeofday +# define __NR_settimeofday 170 +# endif +# ifndef __NR_adjtimex +# define __NR_adjtimex 171 +# endif +# ifndef __NR_getpid +# define __NR_getpid 172 +# endif +# ifndef __NR_getppid +# define __NR_getppid 173 +# endif +# ifndef __NR_getuid +# define __NR_getuid 174 +# endif +# ifndef __NR_geteuid +# define __NR_geteuid 175 +# endif +# ifndef __NR_getgid +# define __NR_getgid 176 +# endif +# ifndef __NR_getegid +# define __NR_getegid 177 +# endif +# ifndef __NR_gettid +# define __NR_gettid 178 +# endif +# ifndef __NR_sysinfo +# define __NR_sysinfo 179 +# endif +# ifndef __NR_mq_open +# define __NR_mq_open 180 +# endif +# ifndef __NR_mq_unlink +# define __NR_mq_unlink 181 +# endif +# ifndef __NR_mq_timedsend +# define __NR_mq_timedsend 182 +# endif +# ifndef __NR_mq_timedreceive +# define __NR_mq_timedreceive 183 +# endif +# ifndef __NR_mq_notify +# define __NR_mq_notify 184 +# endif +# ifndef __NR_mq_getsetattr +# define __NR_mq_getsetattr 185 +# endif +# ifndef __NR_msgget +# define __NR_msgget 186 +# endif +# ifndef __NR_msgctl +# define __NR_msgctl 187 +# endif +# ifndef __NR_msgrcv +# define __NR_msgrcv 188 +# endif +# ifndef __NR_msgsnd +# define __NR_msgsnd 189 +# endif +# ifndef __NR_semget +# define __NR_semget 190 +# endif +# ifndef __NR_semctl +# define __NR_semctl 191 +# endif +# ifndef __NR_semtimedop +# define __NR_semtimedop 192 +# endif +# ifndef __NR_semop +# define __NR_semop 193 +# endif +# ifndef __NR_shmget +# define __NR_shmget 194 +# endif +# ifndef __NR_shmctl +# define __NR_shmctl 195 +# endif +# ifndef __NR_shmat +# define __NR_shmat 196 +# endif +# ifndef __NR_shmdt +# define __NR_shmdt 197 +# endif +# ifndef __NR_socket +# define __NR_socket 198 +# endif +# ifndef __NR_socketpair +# define __NR_socketpair 199 +# endif +# ifndef __NR_bind +# define __NR_bind 200 +# endif +# ifndef __NR_listen +# define __NR_listen 201 +# endif +# ifndef __NR_accept +# define __NR_accept 202 +# endif +# ifndef __NR_connect +# define __NR_connect 203 +# endif +# ifndef __NR_getsockname +# define __NR_getsockname 204 +# endif +# ifndef __NR_getpeername +# define __NR_getpeername 205 +# endif +# ifndef __NR_sendto +# define __NR_sendto 206 +# endif +# ifndef __NR_recvfrom +# define __NR_recvfrom 207 +# endif +# ifndef __NR_setsockopt +# define __NR_setsockopt 208 +# endif +# ifndef __NR_getsockopt +# define __NR_getsockopt 209 +# endif +# ifndef __NR_shutdown +# define __NR_shutdown 210 +# endif +# ifndef __NR_sendmsg +# define __NR_sendmsg 211 +# endif +# ifndef __NR_recvmsg +# define __NR_recvmsg 212 +# endif +# ifndef __NR_readahead +# define __NR_readahead 213 +# endif +# ifndef __NR_brk +# define __NR_brk 214 +# endif +# ifndef __NR_munmap +# define __NR_munmap 215 +# endif +# ifndef __NR_mremap +# define __NR_mremap 216 +# endif +# ifndef __NR_add_key +# define __NR_add_key 217 +# endif +# ifndef __NR_request_key +# define __NR_request_key 218 +# endif +# ifndef __NR_keyctl +# define __NR_keyctl 219 +# endif +# ifndef __NR_clone +# define __NR_clone 220 +# endif +# ifndef __NR_execve +# define __NR_execve 221 +# endif +# ifndef __NR_mmap +# define __NR_mmap 222 +# endif +# ifndef __NR_fadvise64 +# define __NR_fadvise64 223 +# endif +# ifndef __NR_swapon +# define __NR_swapon 224 +# endif +# ifndef __NR_swapoff +# define __NR_swapoff 225 +# endif +# ifndef __NR_mprotect +# define __NR_mprotect 226 +# endif +# ifndef __NR_msync +# define __NR_msync 227 +# endif +# ifndef __NR_mlock +# define __NR_mlock 228 +# endif +# ifndef __NR_munlock +# define __NR_munlock 229 +# endif +# ifndef __NR_mlockall +# define __NR_mlockall 230 +# endif +# ifndef __NR_munlockall +# define __NR_munlockall 231 +# endif +# ifndef __NR_mincore +# define __NR_mincore 232 +# endif +# ifndef __NR_madvise +# define __NR_madvise 233 +# endif +# ifndef __NR_remap_file_pages +# define __NR_remap_file_pages 234 +# endif +# ifndef __NR_mbind +# define __NR_mbind 235 +# endif +# ifndef __NR_get_mempolicy +# define __NR_get_mempolicy 236 +# endif +# ifndef __NR_set_mempolicy +# define __NR_set_mempolicy 237 +# endif +# ifndef __NR_migrate_pages +# define __NR_migrate_pages 238 +# endif +# ifndef __NR_move_pages +# define __NR_move_pages 239 +# endif +# ifndef __NR_rt_tgsigqueueinfo +# define __NR_rt_tgsigqueueinfo 240 +# endif +# ifndef __NR_perf_event_open +# define __NR_perf_event_open 241 +# endif +# ifndef __NR_accept4 +# define __NR_accept4 242 +# endif +# ifndef __NR_recvmmsg +# define __NR_recvmmsg 243 +# endif +# ifndef __NR_wait4 +# define __NR_wait4 260 +# endif +# ifndef __NR_prlimit64 +# define __NR_prlimit64 261 +# endif +# ifndef __NR_fanotify_init +# define __NR_fanotify_init 262 +# endif +# ifndef __NR_fanotify_mark +# define __NR_fanotify_mark 263 +# endif +# ifndef __NR_name_to_handle_at +# define __NR_name_to_handle_at 264 +# endif +# ifndef __NR_open_by_handle_at +# define __NR_open_by_handle_at 265 +# endif +# ifndef __NR_clock_adjtime +# define __NR_clock_adjtime 266 +# endif +# ifndef __NR_syncfs +# define __NR_syncfs 267 +# endif +# ifndef __NR_setns +# define __NR_setns 268 +# endif +# ifndef __NR_sendmmsg +# define __NR_sendmmsg 269 +# endif +# ifndef __NR_cacheflush +# define __NR_cacheflush 0x1002 +# endif +# ifndef __NR_set_tls +# define __NR_set_tls 0x1005 +# endif +#endif + #ifdef __arm__ # ifndef __NR_restart_syscall @@ -11028,1212 +11804,1236 @@ /* Common stubs */ # ifndef __NR_accept -# define __NR_accept 0 +# define __NR_accept __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_accept4 -# define __NR_accept4 0 +# define __NR_accept4 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_access -# define __NR_access 0 +# define __NR_access __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_acct -# define __NR_acct 0 +# define __NR_acct __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_add_key -# define __NR_add_key 0 +# define __NR_add_key __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_adjtimex -# define __NR_adjtimex 0 +# define __NR_adjtimex __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_afs_syscall -# define __NR_afs_syscall 0 +# define __NR_afs_syscall __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_alarm -# define __NR_alarm 0 +# define __NR_alarm __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_arch_prctl -# define __NR_arch_prctl 0 +# define __NR_arch_prctl __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_arm_fadvise64_64 -# define __NR_arm_fadvise64_64 0 +# define __NR_arm_fadvise64_64 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_arm_sync_file_range -# define __NR_arm_sync_file_range 0 +# define __NR_arm_sync_file_range __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_bdflush -# define __NR_bdflush 0 +# define __NR_bdflush __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_bind -# define __NR_bind 0 +# define __NR_bind __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_break -# define __NR_break 0 +# define __NR_break __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_brk -# define __NR_brk 0 +# define __NR_brk __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_cacheflush -# define __NR_cacheflush 0 +# define __NR_cacheflush __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_capget -# define __NR_capget 0 +# define __NR_capget __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_capset -# define __NR_capset 0 +# define __NR_capset __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_chdir -# define __NR_chdir 0 +# define __NR_chdir __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_chmod -# define __NR_chmod 0 +# define __NR_chmod __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_chown -# define __NR_chown 0 +# define __NR_chown __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_chown32 -# define __NR_chown32 0 +# define __NR_chown32 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_chroot -# define __NR_chroot 0 +# define __NR_chroot __LTP__NR_INVALID_SYSCALL +# endif +# ifndef __NR_clock_adjtime +# define __NR_clock_adjtime __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_clock_getres -# define __NR_clock_getres 0 +# define __NR_clock_getres __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_clock_gettime -# define __NR_clock_gettime 0 +# define __NR_clock_gettime __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_clock_nanosleep -# define __NR_clock_nanosleep 0 +# define __NR_clock_nanosleep __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_clock_settime -# define __NR_clock_settime 0 +# define __NR_clock_settime __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_clone -# define __NR_clone 0 +# define __NR_clone __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_clone2 -# define __NR_clone2 0 +# define __NR_clone2 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_close -# define __NR_close 0 +# define __NR_close __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_connect -# define __NR_connect 0 +# define __NR_connect __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_creat -# define __NR_creat 0 +# define __NR_creat __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_create_module -# define __NR_create_module 0 +# define __NR_create_module __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_delete_module -# define __NR_delete_module 0 +# define __NR_delete_module __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_dup -# define __NR_dup 0 +# define __NR_dup __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_dup2 -# define __NR_dup2 0 +# define __NR_dup2 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_dup3 -# define __NR_dup3 0 +# define __NR_dup3 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_epoll_create -# define __NR_epoll_create 0 +# define __NR_epoll_create __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_epoll_create1 -# define __NR_epoll_create1 0 +# define __NR_epoll_create1 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_epoll_ctl -# define __NR_epoll_ctl 0 +# define __NR_epoll_ctl __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_epoll_ctl_old -# define __NR_epoll_ctl_old 0 +# define __NR_epoll_ctl_old __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_epoll_pwait -# define __NR_epoll_pwait 0 +# define __NR_epoll_pwait __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_epoll_wait -# define __NR_epoll_wait 0 +# define __NR_epoll_wait __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_epoll_wait_old -# define __NR_epoll_wait_old 0 +# define __NR_epoll_wait_old __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_eventfd -# define __NR_eventfd 0 +# define __NR_eventfd __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_eventfd2 -# define __NR_eventfd2 0 +# define __NR_eventfd2 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_execv -# define __NR_execv 0 +# define __NR_execv __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_execve -# define __NR_execve 0 +# define __NR_execve __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_exit -# define __NR_exit 0 +# define __NR_exit __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_exit_group -# define __NR_exit_group 0 +# define __NR_exit_group __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_faccessat -# define __NR_faccessat 0 +# define __NR_faccessat __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fadvise64 -# define __NR_fadvise64 0 +# define __NR_fadvise64 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fadvise64_64 -# define __NR_fadvise64_64 0 +# define __NR_fadvise64_64 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fallocate -# define __NR_fallocate 0 +# define __NR_fallocate __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fanotify_init -# define __NR_fanotify_init 0 +# define __NR_fanotify_init __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fanotify_mark -# define __NR_fanotify_mark 0 +# define __NR_fanotify_mark __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fchdir -# define __NR_fchdir 0 +# define __NR_fchdir __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fchmod -# define __NR_fchmod 0 +# define __NR_fchmod __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fchmodat -# define __NR_fchmodat 0 +# define __NR_fchmodat __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fchown -# define __NR_fchown 0 +# define __NR_fchown __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fchown32 -# define __NR_fchown32 0 +# define __NR_fchown32 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fchownat -# define __NR_fchownat 0 +# define __NR_fchownat __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fcntl -# define __NR_fcntl 0 +# define __NR_fcntl __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fcntl64 -# define __NR_fcntl64 0 +# define __NR_fcntl64 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fdatasync -# define __NR_fdatasync 0 +# define __NR_fdatasync __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fgetxattr -# define __NR_fgetxattr 0 +# define __NR_fgetxattr __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_flistxattr -# define __NR_flistxattr 0 +# define __NR_flistxattr __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_flock -# define __NR_flock 0 +# define __NR_flock __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fork -# define __NR_fork 0 +# define __NR_fork __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fremovexattr -# define __NR_fremovexattr 0 +# define __NR_fremovexattr __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fsetxattr -# define __NR_fsetxattr 0 +# define __NR_fsetxattr __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fstat -# define __NR_fstat 0 +# define __NR_fstat __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fstat64 -# define __NR_fstat64 0 +# define __NR_fstat64 __LTP__NR_INVALID_SYSCALL +# endif +# ifndef __NR_fstatat +# define __NR_fstatat __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fstatat64 -# define __NR_fstatat64 0 +# define __NR_fstatat64 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fstatfs -# define __NR_fstatfs 0 +# define __NR_fstatfs __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fstatfs64 -# define __NR_fstatfs64 0 +# define __NR_fstatfs64 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_fsync -# define __NR_fsync 0 +# define __NR_fsync __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_ftime -# define __NR_ftime 0 +# define __NR_ftime __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_ftruncate -# define __NR_ftruncate 0 +# define __NR_ftruncate __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_ftruncate64 -# define __NR_ftruncate64 0 +# define __NR_ftruncate64 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_futex -# define __NR_futex 0 +# define __NR_futex __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_futimesat -# define __NR_futimesat 0 +# define __NR_futimesat __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getcpu -# define __NR_getcpu 0 +# define __NR_getcpu __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getcwd -# define __NR_getcwd 0 +# define __NR_getcwd __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getdents -# define __NR_getdents 0 +# define __NR_getdents __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getdents64 -# define __NR_getdents64 0 +# define __NR_getdents64 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getdomainname -# define __NR_getdomainname 0 +# define __NR_getdomainname __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getegid -# define __NR_getegid 0 +# define __NR_getegid __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getegid32 -# define __NR_getegid32 0 +# define __NR_getegid32 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_geteuid -# define __NR_geteuid 0 +# define __NR_geteuid __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_geteuid32 -# define __NR_geteuid32 0 +# define __NR_geteuid32 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getgid -# define __NR_getgid 0 +# define __NR_getgid __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getgid32 -# define __NR_getgid32 0 +# define __NR_getgid32 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getgroups -# define __NR_getgroups 0 +# define __NR_getgroups __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getgroups32 -# define __NR_getgroups32 0 +# define __NR_getgroups32 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getitimer -# define __NR_getitimer 0 +# define __NR_getitimer __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_get_kernel_syms -# define __NR_get_kernel_syms 0 +# define __NR_get_kernel_syms __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_get_mempolicy -# define __NR_get_mempolicy 0 +# define __NR_get_mempolicy __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getpagesize -# define __NR_getpagesize 0 +# define __NR_getpagesize __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getpeername -# define __NR_getpeername 0 +# define __NR_getpeername __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getpgid -# define __NR_getpgid 0 +# define __NR_getpgid __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getpgrp -# define __NR_getpgrp 0 +# define __NR_getpgrp __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getpid -# define __NR_getpid 0 +# define __NR_getpid __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getpmsg -# define __NR_getpmsg 0 +# define __NR_getpmsg __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getppid -# define __NR_getppid 0 +# define __NR_getppid __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getpriority -# define __NR_getpriority 0 +# define __NR_getpriority __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getresgid -# define __NR_getresgid 0 +# define __NR_getresgid __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getresgid32 -# define __NR_getresgid32 0 +# define __NR_getresgid32 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getresuid -# define __NR_getresuid 0 +# define __NR_getresuid __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getresuid32 -# define __NR_getresuid32 0 +# define __NR_getresuid32 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getrlimit -# define __NR_getrlimit 0 +# define __NR_getrlimit __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_get_robust_list -# define __NR_get_robust_list 0 +# define __NR_get_robust_list __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getrusage -# define __NR_getrusage 0 +# define __NR_getrusage __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getsid -# define __NR_getsid 0 +# define __NR_getsid __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getsockname -# define __NR_getsockname 0 +# define __NR_getsockname __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getsockopt -# define __NR_getsockopt 0 +# define __NR_getsockopt __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_get_thread_area -# define __NR_get_thread_area 0 +# define __NR_get_thread_area __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_gettid -# define __NR_gettid 0 +# define __NR_gettid __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_gettimeofday -# define __NR_gettimeofday 0 +# define __NR_gettimeofday __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getuid -# define __NR_getuid 0 +# define __NR_getuid __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getuid32 -# define __NR_getuid32 0 +# define __NR_getuid32 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getunwind -# define __NR_getunwind 0 +# define __NR_getunwind __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_getxattr -# define __NR_getxattr 0 +# define __NR_getxattr __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_gtty -# define __NR_gtty 0 +# define __NR_gtty __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_idle -# define __NR_idle 0 +# define __NR_idle __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_init_module -# define __NR_init_module 0 +# define __NR_init_module __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_inotify_add_watch -# define __NR_inotify_add_watch 0 +# define __NR_inotify_add_watch __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_inotify_init -# define __NR_inotify_init 0 +# define __NR_inotify_init __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_inotify_init1 -# define __NR_inotify_init1 0 +# define __NR_inotify_init1 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_inotify_rm_watch -# define __NR_inotify_rm_watch 0 +# define __NR_inotify_rm_watch __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_io_cancel -# define __NR_io_cancel 0 +# define __NR_io_cancel __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_ioctl -# define __NR_ioctl 0 +# define __NR_ioctl __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_io_destroy -# define __NR_io_destroy 0 +# define __NR_io_destroy __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_io_getevents -# define __NR_io_getevents 0 +# define __NR_io_getevents __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_ioperm -# define __NR_ioperm 0 +# define __NR_ioperm __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_iopl -# define __NR_iopl 0 +# define __NR_iopl __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_ioprio_get -# define __NR_ioprio_get 0 +# define __NR_ioprio_get __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_ioprio_set -# define __NR_ioprio_set 0 +# define __NR_ioprio_set __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_io_setup -# define __NR_io_setup 0 +# define __NR_io_setup __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_io_submit -# define __NR_io_submit 0 +# define __NR_io_submit __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_ipc -# define __NR_ipc 0 +# define __NR_ipc __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_kexec_load -# define __NR_kexec_load 0 +# define __NR_kexec_load __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_keyctl -# define __NR_keyctl 0 +# define __NR_keyctl __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_kill -# define __NR_kill 0 +# define __NR_kill __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_lchown -# define __NR_lchown 0 +# define __NR_lchown __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_lchown32 -# define __NR_lchown32 0 +# define __NR_lchown32 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_lgetxattr -# define __NR_lgetxattr 0 +# define __NR_lgetxattr __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_link -# define __NR_link 0 +# define __NR_link __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_linkat -# define __NR_linkat 0 +# define __NR_linkat __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_listen -# define __NR_listen 0 +# define __NR_listen __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_listxattr -# define __NR_listxattr 0 +# define __NR_listxattr __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_llistxattr -# define __NR_llistxattr 0 +# define __NR_llistxattr __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_lock -# define __NR_lock 0 +# define __NR_lock __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_lookup_dcookie -# define __NR_lookup_dcookie 0 +# define __NR_lookup_dcookie __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_lremovexattr -# define __NR_lremovexattr 0 +# define __NR_lremovexattr __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_lseek -# define __NR_lseek 0 +# define __NR_lseek __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_lsetxattr -# define __NR_lsetxattr 0 +# define __NR_lsetxattr __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_lstat -# define __NR_lstat 0 +# define __NR_lstat __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_lstat64 -# define __NR_lstat64 0 +# define __NR_lstat64 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_madvise -# define __NR_madvise 0 +# define __NR_madvise __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_madvise1 -# define __NR_madvise1 0 +# define __NR_madvise1 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_mbind -# define __NR_mbind 0 +# define __NR_mbind __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_memory_ordering -# define __NR_memory_ordering 0 +# define __NR_memory_ordering __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_migrate_pages -# define __NR_migrate_pages 0 +# define __NR_migrate_pages __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_mincore -# define __NR_mincore 0 +# define __NR_mincore __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_mkdir -# define __NR_mkdir 0 +# define __NR_mkdir __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_mkdirat -# define __NR_mkdirat 0 +# define __NR_mkdirat __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_mknod -# define __NR_mknod 0 +# define __NR_mknod __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_mknodat -# define __NR_mknodat 0 +# define __NR_mknodat __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_mlock -# define __NR_mlock 0 +# define __NR_mlock __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_mlockall -# define __NR_mlockall 0 +# define __NR_mlockall __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_mmap -# define __NR_mmap 0 +# define __NR_mmap __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_mmap2 -# define __NR_mmap2 0 +# define __NR_mmap2 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_modify_ldt -# define __NR_modify_ldt 0 +# define __NR_modify_ldt __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_mount -# define __NR_mount 0 +# define __NR_mount __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_move_pages -# define __NR_move_pages 0 +# define __NR_move_pages __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_mprotect -# define __NR_mprotect 0 +# define __NR_mprotect __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_mpx -# define __NR_mpx 0 +# define __NR_mpx __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_mq_getsetattr -# define __NR_mq_getsetattr 0 +# define __NR_mq_getsetattr __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_mq_notify -# define __NR_mq_notify 0 +# define __NR_mq_notify __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_mq_open -# define __NR_mq_open 0 +# define __NR_mq_open __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_mq_timedreceive -# define __NR_mq_timedreceive 0 +# define __NR_mq_timedreceive __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_mq_timedsend -# define __NR_mq_timedsend 0 +# define __NR_mq_timedsend __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_mq_unlink -# define __NR_mq_unlink 0 +# define __NR_mq_unlink __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_mremap -# define __NR_mremap 0 +# define __NR_mremap __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_msgctl -# define __NR_msgctl 0 +# define __NR_msgctl __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_msgget -# define __NR_msgget 0 +# define __NR_msgget __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_msgrcv -# define __NR_msgrcv 0 +# define __NR_msgrcv __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_msgsnd -# define __NR_msgsnd 0 +# define __NR_msgsnd __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_msync -# define __NR_msync 0 +# define __NR_msync __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_multiplexer -# define __NR_multiplexer 0 +# define __NR_multiplexer __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_munlock -# define __NR_munlock 0 +# define __NR_munlock __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_munlockall -# define __NR_munlockall 0 +# define __NR_munlockall __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_munmap -# define __NR_munmap 0 +# define __NR_munmap __LTP__NR_INVALID_SYSCALL +# endif +# ifndef __NR_name_to_handle_at +# define __NR_name_to_handle_at __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_nanosleep -# define __NR_nanosleep 0 +# define __NR_nanosleep __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_newfstatat -# define __NR_newfstatat 0 +# define __NR_newfstatat __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_nfsservctl -# define __NR_nfsservctl 0 +# define __NR_nfsservctl __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_nice -# define __NR_nice 0 +# define __NR_nice __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_ni_syscall -# define __NR_ni_syscall 0 +# define __NR_ni_syscall __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_oldfstat -# define __NR_oldfstat 0 +# define __NR_oldfstat __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_oldlstat -# define __NR_oldlstat 0 +# define __NR_oldlstat __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_oldolduname -# define __NR_oldolduname 0 +# define __NR_oldolduname __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_oldstat -# define __NR_oldstat 0 +# define __NR_oldstat __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_olduname -# define __NR_olduname 0 +# define __NR_olduname __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_open -# define __NR_open 0 +# define __NR_open __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_openat -# define __NR_openat 0 +# define __NR_openat __LTP__NR_INVALID_SYSCALL +# endif +# ifndef __NR_open_by_handle_at +# define __NR_open_by_handle_at __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_pause -# define __NR_pause 0 +# define __NR_pause __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_pciconfig_iobase -# define __NR_pciconfig_iobase 0 +# define __NR_pciconfig_iobase __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_pciconfig_read -# define __NR_pciconfig_read 0 +# define __NR_pciconfig_read __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_pciconfig_write -# define __NR_pciconfig_write 0 +# define __NR_pciconfig_write __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_perfctr -# define __NR_perfctr 0 +# define __NR_perfctr __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_perf_event_open -# define __NR_perf_event_open 0 +# define __NR_perf_event_open __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_perfmonctl -# define __NR_perfmonctl 0 +# define __NR_perfmonctl __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_personality -# define __NR_personality 0 +# define __NR_personality __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_pipe -# define __NR_pipe 0 +# define __NR_pipe __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_pipe2 -# define __NR_pipe2 0 +# define __NR_pipe2 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_pivot_root -# define __NR_pivot_root 0 +# define __NR_pivot_root __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_poll -# define __NR_poll 0 +# define __NR_poll __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_ppoll -# define __NR_ppoll 0 +# define __NR_ppoll __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_prctl -# define __NR_prctl 0 +# define __NR_prctl __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_pread64 -# define __NR_pread64 0 +# define __NR_pread64 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_preadv -# define __NR_preadv 0 +# define __NR_preadv __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_prlimit64 -# define __NR_prlimit64 0 +# define __NR_prlimit64 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_prof -# define __NR_prof 0 +# define __NR_prof __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_profil -# define __NR_profil 0 +# define __NR_profil __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_pselect6 -# define __NR_pselect6 0 +# define __NR_pselect6 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_ptrace -# define __NR_ptrace 0 +# define __NR_ptrace __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_putpmsg -# define __NR_putpmsg 0 +# define __NR_putpmsg __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_pwrite64 -# define __NR_pwrite64 0 +# define __NR_pwrite64 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_pwritev -# define __NR_pwritev 0 +# define __NR_pwritev __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_query_module -# define __NR_query_module 0 +# define __NR_query_module __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_quotactl -# define __NR_quotactl 0 +# define __NR_quotactl __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_read -# define __NR_read 0 +# define __NR_read __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_readahead -# define __NR_readahead 0 +# define __NR_readahead __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_readdir -# define __NR_readdir 0 +# define __NR_readdir __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_readlink -# define __NR_readlink 0 +# define __NR_readlink __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_readlinkat -# define __NR_readlinkat 0 +# define __NR_readlinkat __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_readv -# define __NR_readv 0 +# define __NR_readv __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_reboot -# define __NR_reboot 0 +# define __NR_reboot __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_recv -# define __NR_recv 0 +# define __NR_recv __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_recvfrom -# define __NR_recvfrom 0 +# define __NR_recvfrom __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_recvmmsg -# define __NR_recvmmsg 0 +# define __NR_recvmmsg __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_recvmsg -# define __NR_recvmsg 0 +# define __NR_recvmsg __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_remap_file_pages -# define __NR_remap_file_pages 0 +# define __NR_remap_file_pages __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_removexattr -# define __NR_removexattr 0 +# define __NR_removexattr __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_rename -# define __NR_rename 0 +# define __NR_rename __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_renameat -# define __NR_renameat 0 +# define __NR_renameat __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_request_key -# define __NR_request_key 0 +# define __NR_request_key __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_restart_syscall -# define __NR_restart_syscall 0 +# define __NR_restart_syscall __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_rmdir -# define __NR_rmdir 0 +# define __NR_rmdir __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_rtas -# define __NR_rtas 0 +# define __NR_rtas __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_rt_sigaction -# define __NR_rt_sigaction 0 +# define __NR_rt_sigaction __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_rt_sigpending -# define __NR_rt_sigpending 0 +# define __NR_rt_sigpending __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_rt_sigprocmask -# define __NR_rt_sigprocmask 0 +# define __NR_rt_sigprocmask __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_rt_sigqueueinfo -# define __NR_rt_sigqueueinfo 0 +# define __NR_rt_sigqueueinfo __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_rt_sigreturn -# define __NR_rt_sigreturn 0 +# define __NR_rt_sigreturn __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_rt_sigsuspend -# define __NR_rt_sigsuspend 0 +# define __NR_rt_sigsuspend __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_rt_sigtimedwait -# define __NR_rt_sigtimedwait 0 +# define __NR_rt_sigtimedwait __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_rt_tgsigqueueinfo -# define __NR_rt_tgsigqueueinfo 0 +# define __NR_rt_tgsigqueueinfo __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_sched_getaffinity -# define __NR_sched_getaffinity 0 +# define __NR_sched_getaffinity __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_sched_get_affinity -# define __NR_sched_get_affinity 0 +# define __NR_sched_get_affinity __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_sched_getparam -# define __NR_sched_getparam 0 +# define __NR_sched_getparam __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_sched_get_priority_max -# define __NR_sched_get_priority_max 0 +# define __NR_sched_get_priority_max __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_sched_get_priority_min -# define __NR_sched_get_priority_min 0 +# define __NR_sched_get_priority_min __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_sched_getscheduler -# define __NR_sched_getscheduler 0 +# define __NR_sched_getscheduler __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_sched_rr_get_interval -# define __NR_sched_rr_get_interval 0 +# define __NR_sched_rr_get_interval __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_sched_setaffinity -# define __NR_sched_setaffinity 0 +# define __NR_sched_setaffinity __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_sched_set_affinity -# define __NR_sched_set_affinity 0 +# define __NR_sched_set_affinity __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_sched_setparam -# define __NR_sched_setparam 0 +# define __NR_sched_setparam __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_sched_setscheduler -# define __NR_sched_setscheduler 0 +# define __NR_sched_setscheduler __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_sched_yield -# define __NR_sched_yield 0 +# define __NR_sched_yield __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_security -# define __NR_security 0 +# define __NR_security __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_select -# define __NR_select 0 +# define __NR_select __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_semctl -# define __NR_semctl 0 +# define __NR_semctl __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_semget -# define __NR_semget 0 +# define __NR_semget __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_semop -# define __NR_semop 0 +# define __NR_semop __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_semtimedop -# define __NR_semtimedop 0 +# define __NR_semtimedop __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_send -# define __NR_send 0 +# define __NR_send __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_sendfile -# define __NR_sendfile 0 +# define __NR_sendfile __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_sendfile64 -# define __NR_sendfile64 0 +# define __NR_sendfile64 __LTP__NR_INVALID_SYSCALL +# endif +# ifndef __NR_sendmmsg +# define __NR_sendmmsg __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_sendmsg -# define __NR_sendmsg 0 +# define __NR_sendmsg __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_sendto -# define __NR_sendto 0 +# define __NR_sendto __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setdomainname -# define __NR_setdomainname 0 +# define __NR_setdomainname __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setfsgid -# define __NR_setfsgid 0 +# define __NR_setfsgid __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setfsgid32 -# define __NR_setfsgid32 0 +# define __NR_setfsgid32 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setfsuid -# define __NR_setfsuid 0 +# define __NR_setfsuid __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setfsuid32 -# define __NR_setfsuid32 0 +# define __NR_setfsuid32 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setgid -# define __NR_setgid 0 +# define __NR_setgid __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setgid32 -# define __NR_setgid32 0 +# define __NR_setgid32 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setgroups -# define __NR_setgroups 0 +# define __NR_setgroups __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setgroups32 -# define __NR_setgroups32 0 +# define __NR_setgroups32 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_sethostname -# define __NR_sethostname 0 +# define __NR_sethostname __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setitimer -# define __NR_setitimer 0 +# define __NR_setitimer __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_set_mempolicy -# define __NR_set_mempolicy 0 +# define __NR_set_mempolicy __LTP__NR_INVALID_SYSCALL +# endif +# ifndef __NR_setns +# define __NR_setns __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setpgid -# define __NR_setpgid 0 +# define __NR_setpgid __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setpriority -# define __NR_setpriority 0 +# define __NR_setpriority __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setregid -# define __NR_setregid 0 +# define __NR_setregid __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setregid32 -# define __NR_setregid32 0 +# define __NR_setregid32 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setresgid -# define __NR_setresgid 0 +# define __NR_setresgid __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setresgid32 -# define __NR_setresgid32 0 +# define __NR_setresgid32 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setresuid -# define __NR_setresuid 0 +# define __NR_setresuid __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setresuid32 -# define __NR_setresuid32 0 +# define __NR_setresuid32 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setreuid -# define __NR_setreuid 0 +# define __NR_setreuid __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setreuid32 -# define __NR_setreuid32 0 +# define __NR_setreuid32 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setrlimit -# define __NR_setrlimit 0 +# define __NR_setrlimit __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_set_robust_list -# define __NR_set_robust_list 0 +# define __NR_set_robust_list __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setsid -# define __NR_setsid 0 +# define __NR_setsid __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setsockopt -# define __NR_setsockopt 0 +# define __NR_setsockopt __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_set_thread_area -# define __NR_set_thread_area 0 +# define __NR_set_thread_area __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_set_tid_address -# define __NR_set_tid_address 0 +# define __NR_set_tid_address __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_settimeofday -# define __NR_settimeofday 0 +# define __NR_settimeofday __LTP__NR_INVALID_SYSCALL +# endif +# ifndef __NR_set_tls +# define __NR_set_tls __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setuid -# define __NR_setuid 0 +# define __NR_setuid __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setuid32 -# define __NR_setuid32 0 +# define __NR_setuid32 __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_setxattr -# define __NR_setxattr 0 +# define __NR_setxattr __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_sgetmask -# define __NR_sgetmask 0 +# define __NR_sgetmask __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_shmat -# define __NR_shmat 0 +# define __NR_shmat __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_shmatcall -# define __NR_shmatcall 0 +# define __NR_shmatcall __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_shmctl -# define __NR_shmctl 0 +# define __NR_shmctl __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_shmdt -# define __NR_shmdt 0 +# define __NR_shmdt __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_shmget -# define __NR_shmget 0 +# define __NR_shmget __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_shutdown -# define __NR_shutdown 0 +# define __NR_shutdown __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_sigaction -# define __NR_sigaction 0 +# define __NR_sigaction __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_sigaltstack -# define __NR_sigaltstack 0 +# define __NR_sigaltstack __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_signal -# define __NR_signal 0 +# define __NR_signal __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_signalfd -# define __NR_signalfd 0 +# define __NR_signalfd __LTP__NR_INVALID_SYSCALL # endif # ifndef __NR_signalfd4 -# define __NR_signalfd4 0 +# define __NR_signa... [truncated message content] |
From: Cyril H. <su...@li...> - 2013-05-06 15:22:07
|
The branch, master, has been updated via 8c40131496399102fb4decd575e39cbf0968e3dd (commit) from 3f9110428b52c978516c24ced41ed1fd445ab4ff (commit) - Log ----------------------------------------------------------------- commit 8c40131496399102fb4decd575e39cbf0968e3dd Author: Cyril Hrubis <ch...@su...> Date: Mon May 6 16:54:01 2013 +0200 openposix: Fix generate-makefiles and speculative tests. After the change that included dirname in test binary names the testcases in foo/speculative/ directories became "speculative_x-y.run-test". This commit adds special case to the makefile generator so that they end up as foo_speculative_x-y.run-test instead. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: .../scripts/generate-makefiles.sh | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/testcases/open_posix_testsuite/scripts/generate-makefiles.sh b/testcases/open_posix_testsuite/scripts/generate-makefiles.sh index 5a1b175..9c758d2 100755 --- a/testcases/open_posix_testsuite/scripts/generate-makefiles.sh +++ b/testcases/open_posix_testsuite/scripts/generate-makefiles.sh @@ -46,6 +46,12 @@ generate_makefile() { test_prefix=$(basename "$prereq_dir") + # special case for speculative testcases + if [ "$test_prefix" = "speculative" ]; then + test_prefix=$(basename $(echo "$prereq_dir" | sed s/speculative//)) + test_prefix="${test_prefix}_speculative" + fi + # Add all source files to $make_target_prereq_cache. for prereq in $prereq_cache; do # Stuff that needs to be tested. hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-05-06 09:22:24
|
The branch, master, has been updated via 3f9110428b52c978516c24ced41ed1fd445ab4ff (commit) via 61fbe0cd0da35a673493b3966710f35bb14519db (commit) from 62a7ab01a20bbababd1e37b2442d9b3906bec0a7 (commit) - Log ----------------------------------------------------------------- commit 3f9110428b52c978516c24ced41ed1fd445ab4ff Author: DAN LI <li...@cn...> Date: Fri Apr 26 15:53:38 2013 +0800 syscalls/mount/mount02.c: modify array "exp_enos" Expected errno setted in array "exp_enos" do not match echo test item rightly, leading to two problems: * Not every test item in mount02 is executed. There are 13 test items in mount02 currently to test error: ENODEV, ENOTBLK, EBUSY, EBUSY, EINVAL, EINVAL, EINVAL, EFAULT, EFAULT, ENAMETOOLONG, ENOENT, ENOENT, ENOTDIR But, only 8 of them are tested as specified in array "exp_enos": ENODEV, ENOTBLK, EBUSY, EINVAL, EFAULT, ENAMETOOLONG, ENOENT, ENOTDIR * For test item which is executed, its errno returned is maybe not the one expected. This patch modifies array "exp_enos" to make it one-to-one correspondent with each test item, to fix above problems. Signed-off-by: DAN LI <li...@cn...> Signed-off-by: Wanlong Gao <gao...@cn...> commit 61fbe0cd0da35a673493b3966710f35bb14519db Author: DAN LI <li...@cn...> Date: Fri Apr 26 15:50:54 2013 +0800 syscalls/mount/mount02.c: cleanup 1. Remove redundant comments 2. Revise code to follow ltp-code-style Signed-off-by: DAN LI <li...@cn...> Signed-off-by: Wanlong Gao <gao...@cn...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/syscalls/mount/mount02.c | 171 ++++++++++------------------- 1 files changed, 60 insertions(+), 111 deletions(-) diff --git a/testcases/kernel/syscalls/mount/mount02.c b/testcases/kernel/syscalls/mount/mount02.c index 1d1a5c1..b33d3dd 100644 --- a/testcases/kernel/syscalls/mount/mount02.c +++ b/testcases/kernel/syscalls/mount/mount02.c @@ -14,76 +14,34 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * */ -/****************************************************************************** - * - * TEST IDENTIFIER : mount02 - * - * EXECUTED BY : root / superuser - * - * TEST TITLE : Test for checking basic error conditions for mount(2) - * - * TEST CASE TOTAL : 13 - * - * AUTHOR : Nirmala Devi Dhanasekar <nir...@wi...> - * - * SIGNALS - * Uses SIGUSR1 to pause before test if option set. - * (See the parse_opts(3) man page). - * - * DESCRIPTION - * Check for basic errors returned by mount(2) system call. - * - * Verify that mount(2) returns -1 and sets errno to - * - * 1) ENODEV if filesystem type not configured - * 2) ENOTBLK if specialfile is not a block device - * 3) EBUSY if specialfile is already mounted or - * it cannot be remounted read-only, because it still holds - * files open for writing. - * 4) EINVAL if specialfile or device is invalid or - * a remount was attempted, while source was not already - * mounted on target. - * 5) EFAULT if specialfile or device file points to invalid address space. - * 6) ENAMETOOLONG if pathname was longer than MAXPATHLEN. - * 7) ENOENT if pathname was empty or has a nonexistent component. - * 8) ENOTDIR if not a directory. - * - * Setup: - * Setup signal handling. - * Create a mount point. - * Pause for SIGUSR1 if option specified. - * - * Test: - * Loop if the proper options are given. - * Do necessary setup for each test. - * Execute system call - * Check return code, if system call failed and errno == expected errno - * Issue sys call passed with expected return value and errno. - * Otherwise, - * Issue sys call failed to produce expected error. - * Do cleanup for each test. - * - * Cleanup: - * Print errno log and/or timing stats if options given - * Delete the temporary directory(s)/file(s) created. - * - * USAGE: <for command-line> - * mount02 [-T type] -D device [-e] [-i n] [-I x] [-p x] [-t] - * where, -T type : specifies the type of filesystem to - * be mounted. Default ext2. - * -D device : device to be mounted. - * -e : Turn on errno logging. - * -i n : Execute test n times. - * -I x : Execute test for x seconds. - * -p : Pause for SIGUSR1 before starting - * -P x : Pause for x seconds between iterations. - * -t : Turn on syscall timing. - * - * RESTRICTIONS - * test must be run with the -D option - * test doesn't support -c option to run it in parallel, as mount - * syscall is not supposed to run in parallel. - *****************************************************************************/ + +/* + AUTHOR: Nirmala Devi Dhanasekar <nir...@wi...> + + EXECUTED BY: root / superuser + + DESCRIPTION + Check for basic errors returned by mount(2) system call. + + Verify that mount(2) returns -1 and sets errno to + 1) ENODEV if filesystem type not configured + 2) ENOTBLK if specialfile is not a block device + 3) EBUSY if specialfile is already mounted or + it cannot be remounted read-only, because it still holds + files open for writing. + 4) EINVAL if specialfile or device is invalid or + a remount was attempted, while source was not already + mounted on target. + 5) EFAULT if specialfile or device file points to invalid address space. + 6) ENAMETOOLONG if pathname was longer than MAXPATHLEN. + 7) ENOENT if pathname was empty or has a nonexistent component. + 8) ENOTDIR if not a directory. + + RESTRICTIONS + test must be run with the -D option + test doesn't support -c option to run it in parallel, as mount + syscall is not supposed to run in parallel. +*/ #include <errno.h> #include <sys/mount.h> @@ -104,8 +62,8 @@ char *TCID = "mount02"; #define DEFAULT_FSTYPE "ext2" #define FSTYPE_LEN 20 -#define DIR_MODE S_IRWXU | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP -#define FILE_MODE S_IRWXU | S_IRWXG | S_IRWXO +#define DIR_MODE (S_IRWXU | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP) +#define FILE_MODE (S_IRWXU | S_IRWXG | S_IRWXO) static char *Einval = (char *)-1; static char Longpathname[PATH_MAX + 2]; @@ -120,18 +78,20 @@ static int fd; static char mntpoint[PATH_MAX]; static char *fstype; static char *device; -static int Tflag = 0; -static int Dflag = 0; +static int Tflag; +static int Dflag; -static int exp_enos[] = { ENODEV, ENOTBLK, EBUSY, EINVAL, EFAULT, ENAMETOOLONG, - ENOENT, ENOTDIR, 0 +static int exp_enos[] = { + ENODEV, ENOTBLK, EBUSY, EBUSY, EINVAL, + EINVAL, EINVAL, EFAULT, EFAULT, ENAMETOOLONG, + ENOENT, ENOENT, ENOTDIR, 0 }; int TST_TOTAL = (sizeof(exp_enos) / sizeof(exp_enos[0])) - 1; -static option_t options[] = { /* options supported by mount02 test */ - {"T:", &Tflag, &fstype}, /* -T type of filesystem */ - {"D:", &Dflag, &device}, /* -D device used for mounting */ +static option_t options[] = { + {"T:", &Tflag, &fstype}, + {"D:", &Dflag, &device}, {NULL, NULL, NULL} }; @@ -140,7 +100,8 @@ int main(int ac, char **av) int lc, i; char *msg; - if ((msg = parse_opts(ac, av, options, &help)) != NULL) + msg = parse_opts(ac, av, options, &help); + if (msg != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); /* Check for mandatory option of the testcase */ @@ -149,9 +110,8 @@ int main(int ac, char **av) " mounting with -D option."); Type = malloc(FSTYPE_LEN); - if (Type == NULL) { + if (Type == NULL) tst_brkm(TBROK | TERRNO, NULL, "malloc failed"); - } if (Tflag == 1) { strncpy(Type, fstype, @@ -183,8 +143,8 @@ int main(int ac, char **av) /* Call mount(2) to test different test conditions. * verify that it fails with -1 return value and - * sets appropriate errno.*/ - + * sets appropriate errno. + */ TEST(mount(Device, Mntpoint, Fstype, Flag, NULL)); /* check return code */ @@ -192,11 +152,11 @@ int main(int ac, char **av) tst_resm(TPASS | TERRNO, "mount got expected failure"); } else { - if (umount(mntpoint) == -1) { + if (umount(mntpoint) == -1) tst_brkm(TBROK | TERRNO, cleanup, "umount of %s failed", Mntpoint); - } + tst_resm(TFAIL | TERRNO, "mount(2) failed to produce expected " "error (%d)", exp_enos[i]); @@ -207,7 +167,6 @@ int main(int ac, char **av) } } - /* cleanup and exit */ cleanup(); tst_exit(); @@ -218,7 +177,7 @@ int main(int ac, char **av) * setup_test() - Setup function for test cases based on the error values * to be returned. */ -int setup_test(int i, int cnt) +static int setup_test(int i, int cnt) { char temp[20]; @@ -271,7 +230,9 @@ int setup_test(int i, int cnt) } sprintf(temp, "/%s/t3_%d", mntpoint, cnt); strcat(Path, temp); - if ((fd = open(Path, O_CREAT | O_RDWR, S_IRWXU)) == -1) { + + fd = open(Path, O_CREAT | O_RDWR, S_IRWXU); + if (fd == -1) { tst_resm(TWARN | TERRNO, "open() failed to create %s", Path); return 1; @@ -330,7 +291,8 @@ int setup_test(int i, int cnt) } sprintf(temp, "/t_%d_%d", getpid(), cnt); strcat(Path, temp); - if ((fd = open(Path, O_CREAT, S_IRWXU)) == -1) { + fd = open(Path, O_CREAT, S_IRWXU); + if (fd == -1) { tst_resm(TWARN, "open failed to create %s", Path); return 1; } else { @@ -346,7 +308,7 @@ int setup_test(int i, int cnt) * cleanup_test() - Setup function for test cases based on the error values * to be returned. */ -int cleanup_test(int i) +static int cleanup_test(int i) { switch (i) { case 0: @@ -366,9 +328,8 @@ int cleanup_test(int i) /* FALLTHROUGH */ case 2: TEST(umount(mntpoint)); - if (TEST_RETURN != 0) { + if (TEST_RETURN != 0) tst_resm(TWARN | TTERRNO, "umount failed"); - } break; case 12: close(fd); @@ -377,41 +338,29 @@ int cleanup_test(int i) return 0; } -/* setup() - performs all ONE TIME setup for this test */ -void setup() +static void setup(void) { - tst_sig(FORK, DEF_HANDLER, cleanup); tst_require_root(NULL); - /* make a temp directory */ tst_tmpdir(); (void)sprintf(mntpoint, "mnt_%d", getpid()); - if (mkdir(mntpoint, DIR_MODE) == -1) { + if (mkdir(mntpoint, DIR_MODE) == -1) tst_brkm(TBROK | TERRNO, cleanup, "mkdir(%s, %#o) failed", mntpoint, DIR_MODE); - } TEST_EXP_ENOS(exp_enos); TEST_PAUSE; } -/* - *cleanup() - performs all ONE TIME cleanup for this test at - * completion or premature exit. - */ -void cleanup() +static void cleanup(void) { free(Type); - /* - * print timing stats if that option was specified. - * print errno log if that option was specified. - */ TEST_CLEANUP; tst_rmdir(); @@ -420,9 +369,9 @@ void cleanup() /* * issue a help message */ -void help() +static void help(void) { printf("-T type : specifies the type of filesystem to be mounted." - " Default ext2. \n"); - printf("-D device : device used for mounting \n"); + " Default ext2.\n"); + printf("-D device : device used for mounting.\n"); } hooks/post-receive -- ltp |
From: Shubham G. <su...@li...> - 2013-05-03 06:44:19
|
The branch, master, has been updated via 62a7ab01a20bbababd1e37b2442d9b3906bec0a7 (commit) from 64ae94faa975b60265effe994da8465a195d4824 (commit) - Log ----------------------------------------------------------------- commit 62a7ab01a20bbababd1e37b2442d9b3906bec0a7 Author: Shubham <sh...@li...> Date: Fri May 3 12:12:13 2013 +0530 LTP 20130503 ----------------------------------------------------------------------- Summary of changes: VERSION | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/VERSION b/VERSION index 3faeef2..d9a931a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -20130109 +20130503 hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-05-02 17:22:04
|
The branch, master, has been updated via 64ae94faa975b60265effe994da8465a195d4824 (commit) via 64f445e44bb4f2e44f11c37c157ca23bedd68459 (commit) from f2ec5c633c1b50e5affa5488148a196358fb1de6 (commit) - Log ----------------------------------------------------------------- commit 64ae94faa975b60265effe994da8465a195d4824 Author: Cyril Hrubis <ch...@su...> Date: Thu May 2 18:16:57 2013 +0200 openposix/...pthread_mutexattr_gettype/speculative/3-1 The testcase tests for optional behavior. On linux the function just returns member of the passed attr structure and as a such cannot fail. This commit changes the test to return UNTESTED when the call succeeded. Signed-off-by: Cyril Hrubis <ch...@su...> commit 64f445e44bb4f2e44f11c37c157ca23bedd68459 Author: Cyril Hrubis <ch...@su...> Date: Thu May 2 15:53:16 2013 +0200 openposix/.../pthread_key_create/speculative/5-1.c * The pthread_key_create was called twice in the loop no wonder it failed with EAGAIN before the loop has reached the limit. * Cleaned up the code a litte. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: .../pthread_key_create/speculative/5-1.c | 61 ++++++++++---------- .../pthread_mutexattr_gettype/speculative/3-1.c | 16 +++-- 2 files changed, 40 insertions(+), 37 deletions(-) diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/speculative/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/speculative/5-1.c index b2183d5..435602c 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/speculative/5-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_key_create/speculative/5-1.c @@ -1,19 +1,22 @@ /* * Copyright (c) 2002, Intel Corporation. All rights reserved. * Created by: bing.wei.liu REMOVE-THIS AT intel DOT com + * Copyright (c) 2013 Cyril Hrubis <ch...@su...> + * * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. - + * * Test that pthread_key_create() * - * If successful, the pthread_key_create() function shall store the newly created key value - * at *key and shall return zero. Otherwise, an error number shall be returned to indicate - * an error: + * If successful, the pthread_key_create() function shall store the newly + * created key value at *key and shall return zero. Otherwise, an error number + * shall be returned to indicate an error: * - * [EAGAIN] - the system lacked the necessary resources to create another thread_specific - * data key, or the system imposed limit on the total number of keys per process - * [PTHREAD_KEYS_MAX] has been exceeded. + * [EAGAIN] - the system lacked the necessary resources to create another + * thread_specific data key, or the system imposed limit on the + * total number of keys per process [PTHREAD_KEYS_MAX] has been + * exceeded. * * [ENOMEM] - insufficient memory exists to create the key. * @@ -22,7 +25,8 @@ * Steps: * 1. Define an array of keys * 2. Use pthread_key_create() and create those keys - * 3. Verify that you can set and get specific values for those keys without errors. + * 3. Verify that you can set and get specific values for those keys without + * errors. * */ @@ -34,7 +38,7 @@ #include <unistd.h> #include "posixtest.h" -pthread_key_t keys[PTHREAD_KEYS_MAX]; +static pthread_key_t keys[PTHREAD_KEYS_MAX]; int main(void) { @@ -42,29 +46,26 @@ int main(void) for (i = 0; i <= PTHREAD_KEYS_MAX; i++) { rc = pthread_key_create(&keys[i], NULL); - pthread_key_t key; - rc = pthread_key_create(&key, NULL); - if (i == PTHREAD_KEYS_MAX) { - if (rc != EAGAIN) { - printf - ("Test FAILED: Expected EAGAIN when exceeded the limit of keys in a single process, but got: %d\n", - rc); - return PTS_FAIL; - } - } - else if (rc != 0) { - if (rc != EAGAIN) { - printf("Error: pthread_key_create() failed\n"); - return PTS_UNRESOLVED; - } else { - printf - ("Test FAILED: EAGAIN was returned before the key limit was exceeded\n"); - return PTS_FAIL; - } + if (rc != 0) + break; + } + + if (i == PTHREAD_KEYS_MAX) { + if (rc == EAGAIN) { + printf("Test PASSED\n"); + return PTS_PASS; + } else { + printf("Expected EAGAIN on exceeding the limit, got: %d\n", rc); + return PTS_FAIL; } } - printf("Test PASSED\n"); - return PTS_PASS; + if (rc == EAGAIN) { + printf("EAGAIN returned before the key limit was exceeded\n"); + return PTS_FAIL; + } + + printf("Error: pthread_key_create() failed with %d\n", rc); + return PTS_UNRESOLVED; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/speculative/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/speculative/3-1.c index 684c64d..f4ffad7 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/speculative/3-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/speculative/3-1.c @@ -37,13 +37,15 @@ int main(void) /* Pass an invalid 'attr'. */ ret = pthread_mutexattr_gettype(&mta, &type); - if (ret != EINVAL) { - printf - ("Test FAILED: Incorrect return code. Expected EINVAL, but got: %d\n", - ret); + switch (ret) { + case 0: + printf("UNTESTED: The call didn't fail.\n"); + return PTS_UNTESTED; + case EINVAL: + printf("Test PASSED\n"); + return PTS_PASS; + default: + printf("Test FAILED: Expected EINVAL, but got: %d\n", ret); return PTS_FAIL; } - - printf("Test PASSED\n"); - return PTS_PASS; } hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-04-30 15:21:25
|
The branch, master, has been updated via f2ec5c633c1b50e5affa5488148a196358fb1de6 (commit) from d27f4b35eb108b4895478beeb9c20356b82f5147 (commit) - Log ----------------------------------------------------------------- commit f2ec5c633c1b50e5affa5488148a196358fb1de6 Author: Cyril Hrubis <ch...@su...> Date: Tue Apr 30 16:29:43 2013 +0200 mem/thp03: Return TCONF if KSM is not supported The madvise() with MADV_MERGEABLE will return EINVAL when kernel is not compiled with KSM. Make the test return TCONF rather than TBROK in this case. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/mem/thp/thp03.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/testcases/kernel/mem/thp/thp03.c b/testcases/kernel/mem/thp/thp03.c index 8b54243..a9faa93 100644 --- a/testcases/kernel/mem/thp/thp03.c +++ b/testcases/kernel/mem/thp/thp03.c @@ -44,6 +44,7 @@ #include <fcntl.h> #include <stdlib.h> #include <string.h> +#include <errno.h> #include "mem.h" #include "safe_macros.h" #include "test.h" @@ -93,8 +94,15 @@ static void thp_test(void) memset(p, 0x00, unaligned_size); if (mprotect(p, unaligned_size, PROT_NONE) == -1) tst_brkm(TBROK | TERRNO, cleanup, "mprotect"); - if (madvise(p + hugepage_size, page_size, MADV_MERGEABLE) == -1) - tst_brkm(TBROK | TERRNO, cleanup, "madvise"); + + if (madvise(p + hugepage_size, page_size, MADV_MERGEABLE) == -1) { + if (errno == EINVAL) { + tst_brkm(TCONF, cleanup, + "MADV_MERGEABLE is not enabled/supported"); + } else { + tst_brkm(TBROK | TERRNO, cleanup, "madvise"); + } + } switch (fork()) { case -1: hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-04-30 14:21:42
|
The branch, master, has been updated via d27f4b35eb108b4895478beeb9c20356b82f5147 (commit) from 25f426417111b852555d2a0a61d94df2971a5726 (commit) - Log ----------------------------------------------------------------- commit d27f4b35eb108b4895478beeb9c20356b82f5147 Author: Cyril Hrubis <ch...@su...> Date: Tue Apr 30 16:03:30 2013 +0200 mem/ksm05: Add check for KSM sysfs existence. Add check (the same as in ksm01) for the existence of KSM sysfs files. Without it the testcase prints 665 lines of TBROK and then Segfaults on systems without KSM support. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/mem/ksm/ksm05.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/testcases/kernel/mem/ksm/ksm05.c b/testcases/kernel/mem/ksm/ksm05.c index 089a9ff..e8053a1 100644 --- a/testcases/kernel/mem/ksm/ksm05.c +++ b/testcases/kernel/mem/ksm/ksm05.c @@ -151,7 +151,11 @@ void setup(void) if (tst_kvercmp(2, 6, 32) < 0) tst_brkm(TCONF, NULL, "2.6.32 or greater kernel required."); + if (access(PATH_KSM, F_OK) == -1) + tst_brkm(TCONF, NULL, "KSM configuration is not enabled"); + tst_sig(FORK, sighandler, cleanup); + TEST_PAUSE; /* save original /sys/kernel/mm/ksm/run value */ hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-04-30 11:21:21
|
The branch, master, has been updated via 25f426417111b852555d2a0a61d94df2971a5726 (commit) from be0fe25ec364aad44531171e6bd748d29272565c (commit) - Log ----------------------------------------------------------------- commit 25f426417111b852555d2a0a61d94df2971a5726 Author: Cyril Hrubis <ch...@su...> Date: Tue Apr 30 12:57:09 2013 +0200 syscalls/accept4: Fix test when accept4 returns ENOSYS * Make the test actually exit with TCONF when accept4 returned ENOSYS * Remove ifdefs around the main as due tu linux_syscall_numbers.h both __NR_accept4 and __NR_socketcall are always defined. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/syscalls/accept4/accept4_01.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/testcases/kernel/syscalls/accept4/accept4_01.c b/testcases/kernel/syscalls/accept4/accept4_01.c index 2629b1f..fa39236 100644 --- a/testcases/kernel/syscalls/accept4/accept4_01.c +++ b/testcases/kernel/syscalls/accept4/accept4_01.c @@ -138,8 +138,12 @@ do_test(int lfd, struct sockaddr_in *conn_addr, closeonexec_flag | nonblock_flag); #endif if (acceptfd == -1) { - tst_resm(TCONF, - "syscall __NR_accept4 not supported on your arch"); + if (errno == ENOSYS) { + tst_brkm(TCONF, cleanup, + "syscall __NR_accept4 not supported"); + } else { + tst_brkm(TBROK | TERRNO, cleanup, "accept4 failed"); + } } fdf = fcntl(acceptfd, F_GETFD); @@ -209,7 +213,6 @@ static int create_listening_socket(int port_num) int main(int argc, char *argv[]) { -#if defined(__NR_accept4) || defined(__NR_socketcall) struct sockaddr_in conn_addr; int lfd; int port_num; @@ -228,11 +231,8 @@ int main(int argc, char *argv[]) do_test(lfd, &conn_addr, SOCK_CLOEXEC, 0); do_test(lfd, &conn_addr, 0, SOCK_NONBLOCK); do_test(lfd, &conn_addr, SOCK_CLOEXEC, SOCK_NONBLOCK); + close(lfd); -#else - tst_resm(TCONF, "syscall __NR_accept4 not supported on your arch"); -#endif - cleanup(); tst_exit(); } hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-04-29 17:22:20
|
The branch, master, has been updated via be0fe25ec364aad44531171e6bd748d29272565c (commit) via db25118e45199ec46950fa291e6920e0407779d8 (commit) from a25f89ec9c0ead801445582c4f839f74d364b63e (commit) - Log ----------------------------------------------------------------- commit be0fe25ec364aad44531171e6bd748d29272565c Author: Cyril Hrubis <ch...@su...> Date: Mon Apr 29 18:39:13 2013 +0200 openposix/.../aio_fsync/5-1.c: Fixes. * Don't use ret variable to store return value from aio_error() as this overwrites the value that should be returned (coincidentally both PTS_PASS and return from aio_error() when I/O has finised are zero). * Print "Test PASSED" when test has passed. Signed-off-by: Cyril Hrubis <ch...@su...> commit db25118e45199ec46950fa291e6920e0407779d8 Author: Cyril Hrubis <ch...@su...> Date: Mon Apr 29 18:15:41 2013 +0200 openposix/.../aio_fsync/2-1,3-1: Add "Test PASSED" Make the tests to print "Test PASSED" when the test has passed. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: .../conformance/interfaces/aio_fsync/2-1.c | 2 ++ .../conformance/interfaces/aio_fsync/3-1.c | 1 + .../conformance/interfaces/aio_fsync/5-1.c | 13 +++++++------ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/2-1.c index 09da565..3f65b94 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/2-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/2-1.c @@ -84,6 +84,8 @@ int main(void) close(fd); return PTS_FAIL; } + close(fd); + printf("Test PASSED\n"); return PTS_PASS; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/3-1.c index adda4d9..7d6dbaf 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/3-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/3-1.c @@ -85,5 +85,6 @@ int main(void) } close(fd); + printf("Test PASSED\n"); return PTS_PASS; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/5-1.c index f9995dc..34fb7f8 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/5-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/5-1.c @@ -30,7 +30,7 @@ int main(void) int fd; struct aiocb aiocb_write; struct aiocb aiocb_fsync; - int ret; + int ret, err; if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) return PTS_UNSUPPORTED; @@ -69,14 +69,13 @@ int main(void) ret = PTS_PASS; /* allow to check if aio_error() move from EINPROGRESS to - * something else - * otherwise test hangs + * something else otherwise test hangs */ do { usleep(10000); - ret = aio_error(&aiocb_fsync); - } while (ret == EINPROGRESS); - if (ret < 0) { + err = aio_error(&aiocb_fsync); + } while (err == EINPROGRESS); + if (err < 0) { printf(TNAME " Error at aio_error() : %s\n", strerror(ret)); exit(PTS_FAIL); } @@ -84,6 +83,8 @@ int main(void) close(fd); /* we didn't check if the operation is really performed */ + if (ret == PTS_PASS) + printf("Test PASSED\n"); return ret; } hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-04-27 07:24:37
|
The branch, master, has been updated via a25f89ec9c0ead801445582c4f839f74d364b63e (commit) via f1b9dd559f1c89f566cf5ccea7f70fa2a2e7fe63 (commit) via a0359f4e494221fa1e64f1e5cbbac9dbae74ea0d (commit) via bce0f51df79dc56e381ebd02102603b330958dde (commit) from b3e9e5ee189c11cc36fff206896f03fdfbec63fc (commit) - Log ----------------------------------------------------------------- commit a25f89ec9c0ead801445582c4f839f74d364b63e Author: Mike Frysinger <va...@ge...> Date: Sat Apr 27 02:35:01 2013 -0400 adjust copyright/license on a few files to match reality From the author: I looked at the four files in question. I did write getitimer03.c and I believe using the standard IBM copyright is correct. I ported the getresgid01.c code to run under Linux. As I recall it was originally a Sequent test case for the Dynix/ptx OS. Again I believe using the standard IBM copyright is correct. I did not work with the last two files, but they follow the same pattern as the getresgid01.c code. There were originally part of the Dynix/ptx test cases. Also note: the Makefile in question was rewritten by Cisco as part of the build system overhaul, so use the standard copyright for that. Signed-off-by: Mike Frysinger <va...@ge...> commit f1b9dd559f1c89f566cf5ccea7f70fa2a2e7fe63 Author: Mike Frysinger <va...@ge...> Date: Sat Apr 27 02:27:46 2013 -0400 kernel: include: regen linux_syscall_numbers.h Signed-off-by: Mike Frysinger <va...@ge...> commit a0359f4e494221fa1e64f1e5cbbac9dbae74ea0d Author: Mike Frysinger <va...@ge...> Date: Sat Apr 27 02:15:44 2013 -0400 kernel: include: fix dependency on regen script and input files Signed-off-by: Mike Frysinger <va...@ge...> commit bce0f51df79dc56e381ebd02102603b330958dde Author: Mike Frysinger <va...@ge...> Date: Sat Apr 27 02:12:42 2013 -0400 kernel: include: generate headers in parallel Signed-off-by: Mike Frysinger <va...@ge...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/include/Makefile | 2 +- testcases/kernel/include/linux_syscall_numbers.h | 4994 ++++++++++++++++----- testcases/kernel/include/regen.sh | 69 +- testcases/kernel/syscalls/getitimer/getitimer03.c | 25 +- testcases/kernel/syscalls/getresgid/getresgid01.c | 26 +- testcases/kernel/syscalls/nftw/Makefile | 32 +- testcases/kernel/syscalls/nftw/nftw64.h | 33 +- 7 files changed, 4085 insertions(+), 1096 deletions(-) diff --git a/testcases/kernel/include/Makefile b/testcases/kernel/include/Makefile index 3559ab4..db21a2a 100644 --- a/testcases/kernel/include/Makefile +++ b/testcases/kernel/include/Makefile @@ -28,7 +28,7 @@ INSTALL_DIR := $(includedir) MAKE_TARGETS := linux_syscall_numbers.h -linux_syscall_numbers.h: $(wildcard $(srcdir)/*.sh) +linux_syscall_numbers.h: $(wildcard $(abs_srcdir)/*.sh $(abs_srcdir)/*.in) $(SHELL) "$(abs_srcdir)/regen.sh" include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/include/linux_syscall_numbers.h b/testcases/kernel/include/linux_syscall_numbers.h index 545b420..41356c6 100644 --- a/testcases/kernel/include/linux_syscall_numbers.h +++ b/testcases/kernel/include/linux_syscall_numbers.h @@ -1025,6 +1025,21 @@ # ifndef __NR_perf_event_open # define __NR_perf_event_open (__NR_SYSCALL_BASE+364) # endif +# ifndef __NR_recvmmsg +# define __NR_recvmmsg (__NR_SYSCALL_BASE+365) +# endif +# ifndef __NR_accept4 +# define __NR_accept4 (__NR_SYSCALL_BASE+366) +# endif +# ifndef __NR_fanotify_init +# define __NR_fanotify_init (__NR_SYSCALL_BASE+367) +# endif +# ifndef __NR_fanotify_mark +# define __NR_fanotify_mark (__NR_SYSCALL_BASE+368) +# endif +# ifndef __NR_prlimit64 +# define __NR_prlimit64 (__NR_SYSCALL_BASE+369) +# endif #endif @@ -2077,6 +2092,18 @@ # ifndef __NR_perf_event_open # define __NR_perf_event_open 336 # endif +# ifndef __NR_recvmmsg +# define __NR_recvmmsg 337 +# endif +# ifndef __NR_fanotify_init +# define __NR_fanotify_init 338 +# endif +# ifndef __NR_fanotify_mark +# define __NR_fanotify_mark 339 +# endif +# ifndef __NR_prlimit64 +# define __NR_prlimit64 340 +# endif #endif @@ -2951,101 +2978,22 @@ # ifndef __NR_rt_tgsigqueueinfo # define __NR_rt_tgsigqueueinfo 1321 # endif -#endif - - -#ifdef __powerpc64__ -# ifndef __NR_timer_create -# define __NR_timer_create 240 -# endif -# ifndef __NR_timer_settime -# define __NR_timer_settime 241 -# endif -# ifndef __NR_timer_delete -# define __NR_timer_delete 244 -# endif -# ifndef __NR_clock_settime -# define __NR_clock_settime 245 -# endif -# ifndef __NR_clock_gettime -# define __NR_clock_gettime 246 -# endif -# ifndef __NR_get_mempolicy -# define __NR_get_mempolicy 260 -# endif -# ifndef __NR_set_mempolicy -# define __NR_set_mempolicy 261 -# endif -# ifndef __NR_ppoll -# define __NR_ppoll 281 -# endif -# ifndef __NR_splice -# define __NR_splice 283 -# endif -# ifndef __NR_tee -# define __NR_tee 284 -# endif -# ifndef __NR_vmsplice -# define __NR_vmsplice 285 -# endif -# ifndef __NR_openat -# define __NR_openat 286 -# endif -# ifndef __NR_mkdirat -# define __NR_mkdirat (__NR_openat + 1) -# endif -# ifndef __NR_mknodat -# define __NR_mknodat (__NR_openat + 2) -# endif -# ifndef __NR_fchownat -# define __NR_fchownat (__NR_openat + 3) -# endif -# ifndef __NR_futimesat -# define __NR_futimesat (__NR_openat + 4) -# endif -# ifndef __NR_newfstatat -# define __NR_newfstatat (__NR_openat + 5) -# endif -# ifndef __NR_fstatat64 -# define __NR_fstatat64 (__NR_openat + 5) -# endif -# ifndef __NR_unlinkat -# define __NR_unlinkat (__NR_openat + 6) -# endif -# ifndef __NR_renameat -# define __NR_renameat (__NR_openat + 7) -# endif -# ifndef __NR_linkat -# define __NR_linkat (__NR_openat + 8) -# endif -# ifndef __NR_symlinkat -# define __NR_symlinkat (__NR_openat + 9) -# endif -# ifndef __NR_readlinkat -# define __NR_readlinkat (__NR_openat + 10) -# endif -# ifndef __NR_fchmodat -# define __NR_fchmodat (__NR_openat + 11) -# endif -# ifndef __NR_faccessat -# define __NR_faccessat (__NR_openat + 12) +# ifndef __NR_recvmmsg +# define __NR_recvmmsg 1322 # endif -# ifndef __NR_utimensat -# define __NR_utimensat 304 -# endif -# ifndef __NR_eventfd -# define __NR_eventfd 307 +# ifndef __NR_fanotify_init +# define __NR_fanotify_init 1323 # endif -# ifndef __NR_fallocate -# define __NR_fallocate 309 +# ifndef __NR_fanotify_mark +# define __NR_fanotify_mark 1324 # endif -# ifndef __NR_eventfd2 -# define __NR_eventfd2 314 +# ifndef __NR_prlimit64 +# define __NR_prlimit64 1325 # endif #endif -#ifdef __powerpc__ +#ifdef __powerpc64__ # ifndef __NR_restart_syscall # define __NR_restart_syscall 0 # endif @@ -4003,65 +3951,82 @@ # ifndef __NR_rt_tgsigqueueinfo # define __NR_rt_tgsigqueueinfo 322 # endif -# ifndef __NR_syscalls -# define __NR_syscalls 323 +# ifndef __NR_fanotify_init +# define __NR_fanotify_init 323 # endif -#endif - - -#ifdef __s390x__ -# ifndef __NR_openat -# define __NR_openat 288 +# ifndef __NR_fanotify_mark +# define __NR_fanotify_mark 324 # endif -# ifndef __NR_mkdirat -# define __NR_mkdirat (__NR_openat + 1) +# ifndef __NR_prlimit64 +# define __NR_prlimit64 325 # endif -# ifndef __NR_mknodat -# define __NR_mknodat (__NR_openat + 2) +# ifndef __NR_socket +# define __NR_socket 326 # endif -# ifndef __NR_fchownat -# define __NR_fchownat (__NR_openat + 3) +# ifndef __NR_bind +# define __NR_bind 327 # endif -# ifndef __NR_futimesat -# define __NR_futimesat (__NR_openat + 4) +# ifndef __NR_connect +# define __NR_connect 328 # endif -# ifndef __NR_newfstatat -# define __NR_newfstatat (__NR_openat + 5) +# ifndef __NR_listen +# define __NR_listen 329 # endif -# ifndef __NR_fstatat64 -# define __NR_fstatat64 (__NR_openat + 5) +# ifndef __NR_accept +# define __NR_accept 330 # endif -# ifndef __NR_unlinkat -# define __NR_unlinkat (__NR_openat + 6) +# ifndef __NR_getsockname +# define __NR_getsockname 331 # endif -# ifndef __NR_renameat -# define __NR_renameat (__NR_openat + 7) +# ifndef __NR_getpeername +# define __NR_getpeername 332 # endif -# ifndef __NR_linkat -# define __NR_linkat (__NR_openat + 8) +# ifndef __NR_socketpair +# define __NR_socketpair 333 # endif -# ifndef __NR_symlinkat -# define __NR_symlinkat (__NR_openat + 9) +# ifndef __NR_send +# define __NR_send 334 # endif -# ifndef __NR_readlinkat -# define __NR_readlinkat (__NR_openat + 10) +# ifndef __NR_sendto +# define __NR_sendto 335 # endif -# ifndef __NR_fchmodat -# define __NR_fchmodat (__NR_openat + 11) +# ifndef __NR_recv +# define __NR_recv 336 # endif -# ifndef __NR_faccessat -# define __NR_faccessat (__NR_openat + 12) +# ifndef __NR_recvfrom +# define __NR_recvfrom 337 # endif -# ifndef __NR_eventfd -# define __NR_eventfd 318 +# ifndef __NR_shutdown +# define __NR_shutdown 338 # endif -# ifndef __NR_fallocate -# define __NR_fallocate 314 +# ifndef __NR_setsockopt +# define __NR_setsockopt 339 +# endif +# ifndef __NR_getsockopt +# define __NR_getsockopt 340 +# endif +# ifndef __NR_sendmsg +# define __NR_sendmsg 341 +# endif +# ifndef __NR_recvmsg +# define __NR_recvmsg 342 +# endif +# ifndef __NR_recvmmsg +# define __NR_recvmmsg 343 +# endif +# ifndef __NR_accept4 +# define __NR_accept4 344 +# endif +# ifndef __NR_syscalls +# define __NR_syscalls 345 # endif #endif -#ifdef __s390__ +#ifdef __powerpc__ +# ifndef __NR_restart_syscall +# define __NR_restart_syscall 0 +# endif # ifndef __NR_exit # define __NR_exit 1 # endif @@ -4080,8 +4045,8 @@ # ifndef __NR_close # define __NR_close 6 # endif -# ifndef __NR_restart_syscall -# define __NR_restart_syscall 7 +# ifndef __NR_waitpid +# define __NR_waitpid 7 # endif # ifndef __NR_creat # define __NR_creat 8 @@ -4098,12 +4063,24 @@ # ifndef __NR_chdir # define __NR_chdir 12 # endif +# ifndef __NR_time +# define __NR_time 13 +# endif # ifndef __NR_mknod # define __NR_mknod 14 # endif # ifndef __NR_chmod # define __NR_chmod 15 # endif +# ifndef __NR_lchown +# define __NR_lchown 16 +# endif +# ifndef __NR_break +# define __NR_break 17 +# endif +# ifndef __NR_oldstat +# define __NR_oldstat 18 +# endif # ifndef __NR_lseek # define __NR_lseek 19 # endif @@ -4116,24 +4093,45 @@ # ifndef __NR_umount # define __NR_umount 22 # endif +# ifndef __NR_setuid +# define __NR_setuid 23 +# endif +# ifndef __NR_getuid +# define __NR_getuid 24 +# endif +# ifndef __NR_stime +# define __NR_stime 25 +# endif # ifndef __NR_ptrace # define __NR_ptrace 26 # endif # ifndef __NR_alarm # define __NR_alarm 27 # endif +# ifndef __NR_oldfstat +# define __NR_oldfstat 28 +# endif # ifndef __NR_pause # define __NR_pause 29 # endif # ifndef __NR_utime # define __NR_utime 30 # endif +# ifndef __NR_stty +# define __NR_stty 31 +# endif +# ifndef __NR_gtty +# define __NR_gtty 32 +# endif # ifndef __NR_access # define __NR_access 33 # endif # ifndef __NR_nice # define __NR_nice 34 # endif +# ifndef __NR_ftime +# define __NR_ftime 35 +# endif # ifndef __NR_sync # define __NR_sync 36 # endif @@ -4158,27 +4156,54 @@ # ifndef __NR_times # define __NR_times 43 # endif +# ifndef __NR_prof +# define __NR_prof 44 +# endif # ifndef __NR_brk # define __NR_brk 45 # endif +# ifndef __NR_setgid +# define __NR_setgid 46 +# endif +# ifndef __NR_getgid +# define __NR_getgid 47 +# endif # ifndef __NR_signal # define __NR_signal 48 # endif +# ifndef __NR_geteuid +# define __NR_geteuid 49 +# endif +# ifndef __NR_getegid +# define __NR_getegid 50 +# endif # ifndef __NR_acct # define __NR_acct 51 # endif # ifndef __NR_umount2 # define __NR_umount2 52 # endif +# ifndef __NR_lock +# define __NR_lock 53 +# endif # ifndef __NR_ioctl # define __NR_ioctl 54 # endif # ifndef __NR_fcntl # define __NR_fcntl 55 # endif +# ifndef __NR_mpx +# define __NR_mpx 56 +# endif # ifndef __NR_setpgid # define __NR_setpgid 57 # endif +# ifndef __NR_ulimit +# define __NR_ulimit 58 +# endif +# ifndef __NR_oldolduname +# define __NR_oldolduname 59 +# endif # ifndef __NR_umask # define __NR_umask 60 # endif @@ -4203,6 +4228,18 @@ # ifndef __NR_sigaction # define __NR_sigaction 67 # endif +# ifndef __NR_sgetmask +# define __NR_sgetmask 68 +# endif +# ifndef __NR_ssetmask +# define __NR_ssetmask 69 +# endif +# ifndef __NR_setreuid +# define __NR_setreuid 70 +# endif +# ifndef __NR_setregid +# define __NR_setregid 71 +# endif # ifndef __NR_sigsuspend # define __NR_sigsuspend 72 # endif @@ -4215,6 +4252,9 @@ # ifndef __NR_setrlimit # define __NR_setrlimit 75 # endif +# ifndef __NR_getrlimit +# define __NR_getrlimit 76 +# endif # ifndef __NR_getrusage # define __NR_getrusage 77 # endif @@ -4224,11 +4264,23 @@ # ifndef __NR_settimeofday # define __NR_settimeofday 79 # endif +# ifndef __NR_getgroups +# define __NR_getgroups 80 +# endif +# ifndef __NR_setgroups +# define __NR_setgroups 81 +# endif +# ifndef __NR_select +# define __NR_select 82 +# endif # ifndef __NR_symlink # define __NR_symlink 83 # endif -# ifndef __NR_readlink -# define __NR_readlink 85 +# ifndef __NR_oldlstat +# define __NR_oldlstat 84 +# endif +# ifndef __NR_readlink +# define __NR_readlink 85 # endif # ifndef __NR_uselib # define __NR_uselib 86 @@ -4257,18 +4309,27 @@ # ifndef __NR_fchmod # define __NR_fchmod 94 # endif +# ifndef __NR_fchown +# define __NR_fchown 95 +# endif # ifndef __NR_getpriority # define __NR_getpriority 96 # endif # ifndef __NR_setpriority # define __NR_setpriority 97 # endif +# ifndef __NR_profil +# define __NR_profil 98 +# endif # ifndef __NR_statfs # define __NR_statfs 99 # endif # ifndef __NR_fstatfs # define __NR_fstatfs 100 # endif +# ifndef __NR_ioperm +# define __NR_ioperm 101 +# endif # ifndef __NR_socketcall # define __NR_socketcall 102 # endif @@ -4290,8 +4351,11 @@ # ifndef __NR_fstat # define __NR_fstat 108 # endif -# ifndef __NR_lookup_dcookie -# define __NR_lookup_dcookie 110 +# ifndef __NR_olduname +# define __NR_olduname 109 +# endif +# ifndef __NR_iopl +# define __NR_iopl 110 # endif # ifndef __NR_vhangup # define __NR_vhangup 111 @@ -4299,6 +4363,9 @@ # ifndef __NR_idle # define __NR_idle 112 # endif +# ifndef __NR_vm86 +# define __NR_vm86 113 +# endif # ifndef __NR_wait4 # define __NR_wait4 114 # endif @@ -4326,6 +4393,9 @@ # ifndef __NR_uname # define __NR_uname 122 # endif +# ifndef __NR_modify_ldt +# define __NR_modify_ldt 123 +# endif # ifndef __NR_adjtimex # define __NR_adjtimex 124 # endif @@ -4368,6 +4438,12 @@ # ifndef __NR_afs_syscall # define __NR_afs_syscall 137 # endif +# ifndef __NR_setfsuid +# define __NR_setfsuid 138 +# endif +# ifndef __NR_setfsgid +# define __NR_setfsgid 139 +# endif # ifndef __NR_getdents # define __NR_getdents 141 # endif @@ -4431,613 +4507,553 @@ # ifndef __NR_mremap # define __NR_mremap 163 # endif +# ifndef __NR_setresuid +# define __NR_setresuid 164 +# endif +# ifndef __NR_getresuid +# define __NR_getresuid 165 +# endif # ifndef __NR_query_module -# define __NR_query_module 167 +# define __NR_query_module 166 # endif # ifndef __NR_poll -# define __NR_poll 168 +# define __NR_poll 167 # endif # ifndef __NR_nfsservctl -# define __NR_nfsservctl 169 +# define __NR_nfsservctl 168 +# endif +# ifndef __NR_setresgid +# define __NR_setresgid 169 +# endif +# ifndef __NR_getresgid +# define __NR_getresgid 170 # endif # ifndef __NR_prctl -# define __NR_prctl 172 +# define __NR_prctl 171 # endif # ifndef __NR_rt_sigreturn -# define __NR_rt_sigreturn 173 +# define __NR_rt_sigreturn 172 # endif # ifndef __NR_rt_sigaction -# define __NR_rt_sigaction 174 +# define __NR_rt_sigaction 173 # endif # ifndef __NR_rt_sigprocmask -# define __NR_rt_sigprocmask 175 +# define __NR_rt_sigprocmask 174 # endif # ifndef __NR_rt_sigpending -# define __NR_rt_sigpending 176 +# define __NR_rt_sigpending 175 # endif # ifndef __NR_rt_sigtimedwait -# define __NR_rt_sigtimedwait 177 +# define __NR_rt_sigtimedwait 176 # endif # ifndef __NR_rt_sigqueueinfo -# define __NR_rt_sigqueueinfo 178 +# define __NR_rt_sigqueueinfo 177 # endif # ifndef __NR_rt_sigsuspend -# define __NR_rt_sigsuspend 179 +# define __NR_rt_sigsuspend 178 # endif # ifndef __NR_pread64 -# define __NR_pread64 180 +# define __NR_pread64 179 # endif # ifndef __NR_pwrite64 -# define __NR_pwrite64 181 +# define __NR_pwrite64 180 +# endif +# ifndef __NR_chown +# define __NR_chown 181 # endif # ifndef __NR_getcwd -# define __NR_getcwd 183 +# define __NR_getcwd 182 # endif # ifndef __NR_capget -# define __NR_capget 184 +# define __NR_capget 183 # endif # ifndef __NR_capset -# define __NR_capset 185 +# define __NR_capset 184 # endif # ifndef __NR_sigaltstack -# define __NR_sigaltstack 186 +# define __NR_sigaltstack 185 # endif # ifndef __NR_sendfile -# define __NR_sendfile 187 +# define __NR_sendfile 186 # endif # ifndef __NR_getpmsg -# define __NR_getpmsg 188 +# define __NR_getpmsg 187 # endif # ifndef __NR_putpmsg -# define __NR_putpmsg 189 +# define __NR_putpmsg 188 # endif # ifndef __NR_vfork -# define __NR_vfork 190 +# define __NR_vfork 189 +# endif +# ifndef __NR_ugetrlimit +# define __NR_ugetrlimit 190 +# endif +# ifndef __NR_readahead +# define __NR_readahead 191 +# endif +# ifndef __NR_mmap2 +# define __NR_mmap2 192 +# endif +# ifndef __NR_truncate64 +# define __NR_truncate64 193 +# endif +# ifndef __NR_ftruncate64 +# define __NR_ftruncate64 194 +# endif +# ifndef __NR_stat64 +# define __NR_stat64 195 +# endif +# ifndef __NR_lstat64 +# define __NR_lstat64 196 +# endif +# ifndef __NR_fstat64 +# define __NR_fstat64 197 +# endif +# ifndef __NR_pciconfig_read +# define __NR_pciconfig_read 198 +# endif +# ifndef __NR_pciconfig_write +# define __NR_pciconfig_write 199 +# endif +# ifndef __NR_pciconfig_iobase +# define __NR_pciconfig_iobase 200 +# endif +# ifndef __NR_multiplexer +# define __NR_multiplexer 201 +# endif +# ifndef __NR_getdents64 +# define __NR_getdents64 202 # endif # ifndef __NR_pivot_root -# define __NR_pivot_root 217 +# define __NR_pivot_root 203 # endif -# ifndef __NR_mincore -# define __NR_mincore 218 +# ifndef __NR_fcntl64 +# define __NR_fcntl64 204 # endif # ifndef __NR_madvise -# define __NR_madvise 219 +# define __NR_madvise 205 # endif -# ifndef __NR_getdents64 -# define __NR_getdents64 220 +# ifndef __NR_mincore +# define __NR_mincore 206 # endif -# ifndef __NR_readahead -# define __NR_readahead 222 +# ifndef __NR_gettid +# define __NR_gettid 207 +# endif +# ifndef __NR_tkill +# define __NR_tkill 208 # endif # ifndef __NR_setxattr -# define __NR_setxattr 224 +# define __NR_setxattr 209 # endif # ifndef __NR_lsetxattr -# define __NR_lsetxattr 225 +# define __NR_lsetxattr 210 # endif # ifndef __NR_fsetxattr -# define __NR_fsetxattr 226 +# define __NR_fsetxattr 211 # endif # ifndef __NR_getxattr -# define __NR_getxattr 227 +# define __NR_getxattr 212 # endif # ifndef __NR_lgetxattr -# define __NR_lgetxattr 228 +# define __NR_lgetxattr 213 # endif # ifndef __NR_fgetxattr -# define __NR_fgetxattr 229 +# define __NR_fgetxattr 214 # endif # ifndef __NR_listxattr -# define __NR_listxattr 230 +# define __NR_listxattr 215 # endif # ifndef __NR_llistxattr -# define __NR_llistxattr 231 +# define __NR_llistxattr 216 # endif # ifndef __NR_flistxattr -# define __NR_flistxattr 232 +# define __NR_flistxattr 217 # endif # ifndef __NR_removexattr -# define __NR_removexattr 233 +# define __NR_removexattr 218 # endif # ifndef __NR_lremovexattr -# define __NR_lremovexattr 234 +# define __NR_lremovexattr 219 # endif # ifndef __NR_fremovexattr -# define __NR_fremovexattr 235 -# endif -# ifndef __NR_gettid -# define __NR_gettid 236 -# endif -# ifndef __NR_tkill -# define __NR_tkill 237 +# define __NR_fremovexattr 220 # endif # ifndef __NR_futex -# define __NR_futex 238 +# define __NR_futex 221 # endif # ifndef __NR_sched_setaffinity -# define __NR_sched_setaffinity 239 +# define __NR_sched_setaffinity 222 # endif # ifndef __NR_sched_getaffinity -# define __NR_sched_getaffinity 240 +# define __NR_sched_getaffinity 223 # endif -# ifndef __NR_tgkill -# define __NR_tgkill 241 +# ifndef __NR_tuxcall +# define __NR_tuxcall 225 +# endif +# ifndef __NR_sendfile64 +# define __NR_sendfile64 226 # endif # ifndef __NR_io_setup -# define __NR_io_setup 243 +# define __NR_io_setup 227 # endif # ifndef __NR_io_destroy -# define __NR_io_destroy 244 +# define __NR_io_destroy 228 # endif # ifndef __NR_io_getevents -# define __NR_io_getevents 245 +# define __NR_io_getevents 229 # endif # ifndef __NR_io_submit -# define __NR_io_submit 246 +# define __NR_io_submit 230 # endif # ifndef __NR_io_cancel -# define __NR_io_cancel 247 +# define __NR_io_cancel 231 +# endif +# ifndef __NR_set_tid_address +# define __NR_set_tid_address 232 +# endif +# ifndef __NR_fadvise64 +# define __NR_fadvise64 233 # endif # ifndef __NR_exit_group -# define __NR_exit_group 248 +# define __NR_exit_group 234 +# endif +# ifndef __NR_lookup_dcookie +# define __NR_lookup_dcookie 235 # endif # ifndef __NR_epoll_create -# define __NR_epoll_create 249 +# define __NR_epoll_create 236 # endif # ifndef __NR_epoll_ctl -# define __NR_epoll_ctl 250 +# define __NR_epoll_ctl 237 # endif # ifndef __NR_epoll_wait -# define __NR_epoll_wait 251 -# endif -# ifndef __NR_set_tid_address -# define __NR_set_tid_address 252 +# define __NR_epoll_wait 238 # endif -# ifndef __NR_fadvise64 -# define __NR_fadvise64 253 +# ifndef __NR_remap_file_pages +# define __NR_remap_file_pages 239 # endif # ifndef __NR_timer_create -# define __NR_timer_create 254 +# define __NR_timer_create 240 # endif # ifndef __NR_timer_settime -# define __NR_timer_settime (__NR_timer_create+1) +# define __NR_timer_settime 241 # endif # ifndef __NR_timer_gettime -# define __NR_timer_gettime (__NR_timer_create+2) +# define __NR_timer_gettime 242 # endif # ifndef __NR_timer_getoverrun -# define __NR_timer_getoverrun (__NR_timer_create+3) +# define __NR_timer_getoverrun 243 # endif # ifndef __NR_timer_delete -# define __NR_timer_delete (__NR_timer_create+4) +# define __NR_timer_delete 244 # endif # ifndef __NR_clock_settime -# define __NR_clock_settime (__NR_timer_create+5) +# define __NR_clock_settime 245 # endif # ifndef __NR_clock_gettime -# define __NR_clock_gettime (__NR_timer_create+6) +# define __NR_clock_gettime 246 # endif # ifndef __NR_clock_getres -# define __NR_clock_getres (__NR_timer_create+7) +# define __NR_clock_getres 247 # endif # ifndef __NR_clock_nanosleep -# define __NR_clock_nanosleep (__NR_timer_create+8) +# define __NR_clock_nanosleep 248 +# endif +# ifndef __NR_swapcontext +# define __NR_swapcontext 249 +# endif +# ifndef __NR_tgkill +# define __NR_tgkill 250 +# endif +# ifndef __NR_utimes +# define __NR_utimes 251 # endif # ifndef __NR_statfs64 -# define __NR_statfs64 265 +# define __NR_statfs64 252 # endif # ifndef __NR_fstatfs64 -# define __NR_fstatfs64 266 +# define __NR_fstatfs64 253 # endif -# ifndef __NR_remap_file_pages -# define __NR_remap_file_pages 267 +# ifndef __NR_fadvise64_64 +# define __NR_fadvise64_64 254 +# endif +# ifndef __NR_rtas +# define __NR_rtas 255 +# endif +# ifndef __NR_sys_debug_setcontext +# define __NR_sys_debug_setcontext 256 +# endif +# ifndef __NR_migrate_pages +# define __NR_migrate_pages 258 +# endif +# ifndef __NR_mbind +# define __NR_mbind 259 +# endif +# ifndef __NR_get_mempolicy +# define __NR_get_mempolicy 260 +# endif +# ifndef __NR_set_mempolicy +# define __NR_set_mempolicy 261 # endif # ifndef __NR_mq_open -# define __NR_mq_open 271 +# define __NR_mq_open 262 # endif # ifndef __NR_mq_unlink -# define __NR_mq_unlink 272 +# define __NR_mq_unlink 263 # endif # ifndef __NR_mq_timedsend -# define __NR_mq_timedsend 273 +# define __NR_mq_timedsend 264 # endif # ifndef __NR_mq_timedreceive -# define __NR_mq_timedreceive 274 +# define __NR_mq_timedreceive 265 # endif # ifndef __NR_mq_notify -# define __NR_mq_notify 275 +# define __NR_mq_notify 266 # endif # ifndef __NR_mq_getsetattr -# define __NR_mq_getsetattr 276 +# define __NR_mq_getsetattr 267 # endif # ifndef __NR_kexec_load -# define __NR_kexec_load 277 +# define __NR_kexec_load 268 # endif # ifndef __NR_add_key -# define __NR_add_key 278 +# define __NR_add_key 269 # endif # ifndef __NR_request_key -# define __NR_request_key 279 +# define __NR_request_key 270 # endif # ifndef __NR_keyctl -# define __NR_keyctl 280 +# define __NR_keyctl 271 # endif # ifndef __NR_waitid -# define __NR_waitid 281 +# define __NR_waitid 272 # endif # ifndef __NR_ioprio_set -# define __NR_ioprio_set 282 +# define __NR_ioprio_set 273 # endif # ifndef __NR_ioprio_get -# define __NR_ioprio_get 283 +# define __NR_ioprio_get 274 # endif # ifndef __NR_inotify_init -# define __NR_inotify_init 284 +# define __NR_inotify_init 275 # endif # ifndef __NR_inotify_add_watch -# define __NR_inotify_add_watch 285 +# define __NR_inotify_add_watch 276 # endif # ifndef __NR_inotify_rm_watch -# define __NR_inotify_rm_watch 286 +# define __NR_inotify_rm_watch 277 +# endif +# ifndef __NR_spu_run +# define __NR_spu_run 278 +# endif +# ifndef __NR_spu_create +# define __NR_spu_create 279 +# endif +# ifndef __NR_pselect6 +# define __NR_pselect6 280 +# endif +# ifndef __NR_ppoll +# define __NR_ppoll 281 +# endif +# ifndef __NR_unshare +# define __NR_unshare 282 +# endif +# ifndef __NR_splice +# define __NR_splice 283 +# endif +# ifndef __NR_tee +# define __NR_tee 284 +# endif +# ifndef __NR_vmsplice +# define __NR_vmsplice 285 # endif # ifndef __NR_openat -# define __NR_openat 288 +# define __NR_openat 286 # endif # ifndef __NR_mkdirat -# define __NR_mkdirat 289 +# define __NR_mkdirat 287 # endif # ifndef __NR_mknodat -# define __NR_mknodat 290 +# define __NR_mknodat 288 # endif # ifndef __NR_fchownat -# define __NR_fchownat 291 +# define __NR_fchownat 289 # endif # ifndef __NR_futimesat -# define __NR_futimesat 292 +# define __NR_futimesat 290 +# endif +# ifndef __NR_newfstatat +# define __NR_newfstatat 291 +# endif +# ifndef __NR_fstatat64 +# define __NR_fstatat64 291 # endif # ifndef __NR_unlinkat -# define __NR_unlinkat 294 +# define __NR_unlinkat 292 # endif # ifndef __NR_renameat -# define __NR_renameat 295 +# define __NR_renameat 293 # endif # ifndef __NR_linkat -# define __NR_linkat 296 +# define __NR_linkat 294 # endif # ifndef __NR_symlinkat -# define __NR_symlinkat 297 +# define __NR_symlinkat 295 # endif # ifndef __NR_readlinkat -# define __NR_readlinkat 298 +# define __NR_readlinkat 296 # endif # ifndef __NR_fchmodat -# define __NR_fchmodat 299 +# define __NR_fchmodat 297 # endif # ifndef __NR_faccessat -# define __NR_faccessat 300 -# endif -# ifndef __NR_pselect6 -# define __NR_pselect6 301 -# endif -# ifndef __NR_ppoll -# define __NR_ppoll 302 -# endif -# ifndef __NR_unshare -# define __NR_unshare 303 -# endif -# ifndef __NR_set_robust_list -# define __NR_set_robust_list 304 +# define __NR_faccessat 298 # endif # ifndef __NR_get_robust_list -# define __NR_get_robust_list 305 -# endif -# ifndef __NR_splice -# define __NR_splice 306 -# endif -# ifndef __NR_sync_file_range -# define __NR_sync_file_range 307 +# define __NR_get_robust_list 299 # endif -# ifndef __NR_tee -# define __NR_tee 308 +# ifndef __NR_set_robust_list +# define __NR_set_robust_list 300 # endif -# ifndef __NR_vmsplice -# define __NR_vmsplice 309 +# ifndef __NR_move_pages +# define __NR_move_pages 301 # endif # ifndef __NR_getcpu -# define __NR_getcpu 311 +# define __NR_getcpu 302 # endif # ifndef __NR_epoll_pwait -# define __NR_epoll_pwait 312 -# endif -# ifndef __NR_utimes -# define __NR_utimes 313 -# endif -# ifndef __NR_fallocate -# define __NR_fallocate 314 +# define __NR_epoll_pwait 303 # endif # ifndef __NR_utimensat -# define __NR_utimensat 315 +# define __NR_utimensat 304 # endif # ifndef __NR_signalfd -# define __NR_signalfd 316 +# define __NR_signalfd 305 # endif -# ifndef __NR_timerfd -# define __NR_timerfd 317 +# ifndef __NR_timerfd_create +# define __NR_timerfd_create 306 # endif # ifndef __NR_eventfd -# define __NR_eventfd 318 +# define __NR_eventfd 307 # endif -# ifndef __NR_timerfd_create -# define __NR_timerfd_create 319 +# ifndef __NR_sync_file_range2 +# define __NR_sync_file_range2 308 +# endif +# ifndef __NR_fallocate +# define __NR_fallocate 309 +# endif +# ifndef __NR_subpage_prot +# define __NR_subpage_prot 310 # endif # ifndef __NR_timerfd_settime -# define __NR_timerfd_settime 320 +# define __NR_timerfd_settime 311 # endif # ifndef __NR_timerfd_gettime -# define __NR_timerfd_gettime 321 +# define __NR_timerfd_gettime 312 # endif # ifndef __NR_signalfd4 -# define __NR_signalfd4 322 +# define __NR_signalfd4 313 # endif # ifndef __NR_eventfd2 -# define __NR_eventfd2 323 +# define __NR_eventfd2 314 # endif -# ifndef __NR_inotify_init1 -# define __NR_inotify_init1 324 +# ifndef __NR_epoll_create1 +# define __NR_epoll_create1 315 +# endif +# ifndef __NR_dup3 +# define __NR_dup3 316 # endif # ifndef __NR_pipe2 -# define __NR_pipe2 325 +# define __NR_pipe2 317 # endif -# ifndef __NR_dup3 -# define __NR_dup3 326 +# ifndef __NR_inotify_init1 +# define __NR_inotify_init1 318 # endif -# ifndef __NR_epoll_create1 -# define __NR_epoll_create1 327 +# ifndef __NR_perf_event_open +# define __NR_perf_event_open 319 # endif # ifndef __NR_preadv -# define __NR_preadv 328 +# define __NR_preadv 320 # endif # ifndef __NR_pwritev -# define __NR_pwritev 329 +# define __NR_pwritev 321 # endif # ifndef __NR_rt_tgsigqueueinfo -# define __NR_rt_tgsigqueueinfo 330 +# define __NR_rt_tgsigqueueinfo 322 # endif -# ifndef __NR_perf_event_open -# define __NR_perf_event_open 331 +# ifndef __NR_fanotify_init +# define __NR_fanotify_init 323 # endif -# ifndef __NR_time -# define __NR_time 13 +# ifndef __NR_fanotify_mark +# define __NR_fanotify_mark 324 # endif -# ifndef __NR_lchown -# define __NR_lchown 16 +# ifndef __NR_prlimit64 +# define __NR_prlimit64 325 # endif -# ifndef __NR_setuid -# define __NR_setuid 23 +# ifndef __NR_socket +# define __NR_socket 326 # endif -# ifndef __NR_getuid -# define __NR_getuid 24 +# ifndef __NR_bind +# define __NR_bind 327 # endif -# ifndef __NR_stime -# define __NR_stime 25 +# ifndef __NR_connect +# define __NR_connect 328 # endif -# ifndef __NR_setgid -# define __NR_setgid 46 +# ifndef __NR_listen +# define __NR_listen 329 # endif -# ifndef __NR_getgid -# define __NR_getgid 47 +# ifndef __NR_accept +# define __NR_accept 330 # endif -# ifndef __NR_geteuid -# define __NR_geteuid 49 +# ifndef __NR_getsockname +# define __NR_getsockname 331 # endif -# ifndef __NR_getegid -# define __NR_getegid 50 +# ifndef __NR_getpeername +# define __NR_getpeername 332 # endif -# ifndef __NR_setreuid -# define __NR_setreuid 70 +# ifndef __NR_socketpair +# define __NR_socketpair 333 # endif -# ifndef __NR_setregid -# define __NR_setregid 71 +# ifndef __NR_send +# define __NR_send 334 # endif -# ifndef __NR_getrlimit -# define __NR_getrlimit 76 +# ifndef __NR_sendto +# define __NR_sendto 335 # endif -# ifndef __NR_getgroups -# define __NR_getgroups 80 +# ifndef __NR_recv +# define __NR_recv 336 # endif -# ifndef __NR_setgroups -# define __NR_setgroups 81 +# ifndef __NR_recvfrom +# define __NR_recvfrom 337 # endif -# ifndef __NR_fchown -# define __NR_fchown 95 +# ifndef __NR_shutdown +# define __NR_shutdown 338 # endif -# ifndef __NR_ioperm -# define __NR_ioperm 101 +# ifndef __NR_setsockopt +# define __NR_setsockopt 339 # endif -# ifndef __NR_setfsuid -# define __NR_setfsuid 138 +# ifndef __NR_getsockopt +# define __NR_getsockopt 340 # endif -# ifndef __NR_setfsgid -# define __NR_setfsgid 139 +# ifndef __NR_sendmsg +# define __NR_sendmsg 341 # endif -# ifndef __NR_setresuid -# define __NR_setresuid 164 +# ifndef __NR_recvmsg +# define __NR_recvmsg 342 # endif -# ifndef __NR_getresuid -# define __NR_getresuid 165 +# ifndef __NR_recvmmsg +# define __NR_recvmmsg 343 # endif -# ifndef __NR_setresgid -# define __NR_setresgid 170 -# endif -# ifndef __NR_getresgid -# define __NR_getresgid 171 -# endif -# ifndef __NR_chown -# define __NR_chown 182 -# endif -# ifndef __NR_ugetrlimit -# define __NR_ugetrlimit 191 -# endif -# ifndef __NR_mmap2 -# define __NR_mmap2 192 -# endif -# ifndef __NR_truncate64 -# define __NR_truncate64 193 -# endif -# ifndef __NR_ftruncate64 -# define __NR_ftruncate64 194 -# endif -# ifndef __NR_stat64 -# define __NR_stat64 195 -# endif -# ifndef __NR_lstat64 -# define __NR_lstat64 196 -# endif -# ifndef __NR_fstat64 -# define __NR_fstat64 197 -# endif -# ifndef __NR_lchown32 -# define __NR_lchown32 198 -# endif -# ifndef __NR_getuid32 -# define __NR_getuid32 199 -# endif -# ifndef __NR_getgid32 -# define __NR_getgid32 200 -# endif -# ifndef __NR_geteuid32 -# define __NR_geteuid32 201 -# endif -# ifndef __NR_getegid32 -# define __NR_getegid32 202 -# endif -# ifndef __NR_setreuid32 -# define __NR_setreuid32 203 -# endif -# ifndef __NR_setregid32 -# define __NR_setregid32 204 -# endif -# ifndef __NR_getgroups32 -# define __NR_getgroups32 205 -# endif -# ifndef __NR_setgroups32 -# define __NR_setgroups32 206 -# endif -# ifndef __NR_fchown32 -# define __NR_fchown32 207 -# endif -# ifndef __NR_setresuid32 -# define __NR_setresuid32 208 -# endif -# ifndef __NR_getresuid32 -# define __NR_getresuid32 209 -# endif -# ifndef __NR_setresgid32 -# define __NR_setresgid32 210 -# endif -# ifndef __NR_getresgid32 -# define __NR_getresgid32 211 -# endif -# ifndef __NR_chown32 -# define __NR_chown32 212 -# endif -# ifndef __NR_setuid32 -# define __NR_setuid32 213 -# endif -# ifndef __NR_setgid32 -# define __NR_setgid32 214 -# endif -# ifndef __NR_setfsuid32 -# define __NR_setfsuid32 215 -# endif -# ifndef __NR_setfsgid32 -# define __NR_setfsgid32 216 -# endif -# ifndef __NR_fcntl64 -# define __NR_fcntl64 221 -# endif -# ifndef __NR_sendfile64 -# define __NR_sendfile64 223 -# endif -# ifndef __NR_fadvise64_64 -# define __NR_fadvise64_64 264 -# endif -# ifndef __NR_fstatat64 -# define __NR_fstatat64 293 -# endif -# ifndef __NR_select -# define __NR_select 142 -# endif -# ifndef __NR_getrlimit -# define __NR_getrlimit 191 -# endif -# ifndef __NR_lchown -# define __NR_lchown 198 -# endif -# ifndef __NR_getuid -# define __NR_getuid 199 -# endif -# ifndef __NR_getgid -# define __NR_getgid 200 -# endif -# ifndef __NR_geteuid -# define __NR_geteuid 201 -# endif -# ifndef __NR_getegid -# define __NR_getegid 202 -# endif -# ifndef __NR_setreuid -# define __NR_setreuid 203 -# endif -# ifndef __NR_setregid -# define __NR_setregid 204 -# endif -# ifndef __NR_getgroups -# define __NR_getgroups 205 -# endif -# ifndef __NR_setgroups -# define __NR_setgroups 206 -# endif -# ifndef __NR_fchown -# define __NR_fchown 207 -# endif -# ifndef __NR_setresuid -# define __NR_setresuid 208 -# endif -# ifndef __NR_getresuid -# define __NR_getresuid 209 -# endif -# ifndef __NR_setresgid -# define __NR_setresgid 210 -# endif -# ifndef __NR_getresgid -# define __NR_getresgid 211 -# endif -# ifndef __NR_chown -# define __NR_chown 212 -# endif -# ifndef __NR_setuid -# define __NR_setuid 213 -# endif -# ifndef __NR_setgid -# define __NR_setgid 214 -# endif -# ifndef __NR_setfsuid -# define __NR_setfsuid 215 -# endif -# ifndef __NR_setfsgid -# define __NR_setfsgid 216 +# ifndef __NR_accept4 +# define __NR_accept4 344 # endif -# ifndef __NR_newfstatat -# define __NR_newfstatat 293 +# ifndef __NR_syscalls +# define __NR_syscalls 345 # endif #endif -#ifdef __sh__ -# ifndef __NR_restart_syscall -# define __NR_restart_syscall 0 -# endif +#ifdef __s390x__ # ifndef __NR_exit # define __NR_exit 1 # endif @@ -5056,8 +5072,8 @@ # ifndef __NR_close # define __NR_close 6 # endif -# ifndef __NR_waitpid -# define __NR_waitpid 7 +# ifndef __NR_restart_syscall +# define __NR_restart_syscall 7 # endif # ifndef __NR_creat # define __NR_creat 8 @@ -5074,24 +5090,12 @@ # ifndef __NR_chdir # define __NR_chdir 12 # endif -# ifndef __NR_time -# define __NR_time 13 -# endif # ifndef __NR_mknod # define __NR_mknod 14 # endif # ifndef __NR_chmod # define __NR_chmod 15 # endif -# ifndef __NR_lchown -# define __NR_lchown 16 -# endif -# ifndef __NR_break -# define __NR_break 17 -# endif -# ifndef __NR_oldstat -# define __NR_oldstat 18 -# endif # ifndef __NR_lseek # define __NR_lseek 19 # endif @@ -5104,45 +5108,24 @@ # ifndef __NR_umount # define __NR_umount 22 # endif -# ifndef __NR_setuid -# define __NR_setuid 23 -# endif -# ifndef __NR_getuid -# define __NR_getuid 24 -# endif -# ifndef __NR_stime -# define __NR_stime 25 -# endif # ifndef __NR_ptrace # define __NR_ptrace 26 # endif # ifndef __NR_alarm # define __NR_alarm 27 # endif -# ifndef __NR_oldfstat -# define __NR_oldfstat 28 -# endif # ifndef __NR_pause # define __NR_pause 29 # endif # ifndef __NR_utime # define __NR_utime 30 # endif -# ifndef __NR_stty -# define __NR_stty 31 -# endif -# ifndef __NR_gtty -# define __NR_gtty 32 -# endif # ifndef __NR_access # define __NR_access 33 # endif # ifndef __NR_nice # define __NR_nice 34 # endif -# ifndef __NR_ftime -# define __NR_ftime 35 -# endif # ifndef __NR_sync # define __NR_sync 36 # endif @@ -5167,54 +5150,27 @@ # ifndef __NR_times # define __NR_times 43 # endif -# ifndef __NR_prof -# define __NR_prof 44 -# endif # ifndef __NR_brk # define __NR_brk 45 # endif -# ifndef __NR_setgid -# define __NR_setgid 46 -# endif -# ifndef __NR_getgid -# define __NR_getgid 47 -# endif # ifndef __NR_signal # define __NR_signal 48 # endif -# ifndef __NR_geteuid -# define __NR_geteuid 49 -# endif -# ifndef __NR_getegid -# define __NR_getegid 50 -# endif # ifndef __NR_acct # define __NR_acct 51 # endif # ifndef __NR_umount2 # define __NR_umount2 52 # endif -# ifndef __NR_lock -# define __NR_lock 53 -# endif # ifndef __NR_ioctl # define __NR_ioctl 54 # endif # ifndef __NR_fcntl # define __NR_fcntl 55 # endif -# ifndef __NR_mpx -# define __NR_mpx 56 -# endif # ifndef __NR_setpgid # define __NR_setpgid 57 # endif -# ifndef __NR_ulimit -# define __NR_ulimit 58 -# endif -# ifndef __NR_oldolduname -# define __NR_oldolduname 59 -# endif # ifndef __NR_umask # define __NR_umask 60 # endif @@ -5239,18 +5195,6 @@ # ifndef __NR_sigaction # define __NR_sigaction 67 # endif -# ifndef __NR_sgetmask -# define __NR_sgetmask 68 -# endif -# ifndef __NR_ssetmask -# define __NR_ssetmask 69 -# endif -# ifndef __NR_setreuid -# define __NR_setreuid 70 -# endif -# ifndef __NR_setregid -# define __NR_setregid 71 -# endif # ifndef __NR_sigsuspend # define __NR_sigsuspend 72 # endif @@ -5263,9 +5207,6 @@ # ifndef __NR_setrlimit # define __NR_setrlimit 75 # endif -# ifndef __NR_getrlimit -# define __NR_getrlimit 76 -# endif # ifndef __NR_getrusage # define __NR_getrusage 77 # endif @@ -5275,20 +5216,8 @@ # ifndef __NR_settimeofday # define __NR_settimeofday 79 # endif -# ifndef __NR_getgroups -# define __NR_getgroups 80 -# endif -# ifndef __NR_setgroups -# define __NR_setgroups 81 -# endif -# ifndef __NR_select -# define __NR_select 82 -# endif -# ifndef __NR_symlink -# define __NR_symlink 83 -# endif -# ifndef __NR_oldlstat -# define __NR_oldlstat 84 +# ifndef __NR_symlink +# define __NR_symlink 83 # endif # ifndef __NR_readlink # define __NR_readlink 85 @@ -5320,27 +5249,18 @@ # ifndef __NR_fchmod # define __NR_fchmod 94 # endif -# ifndef __NR_fchown -# define __NR_fchown 95 -# endif # ifndef __NR_getpriority # define __NR_getpriority 96 # endif # ifndef __NR_setpriority # define __NR_setpriority 97 # endif -# ifndef __NR_profil -# define __NR_profil 98 -# endif # ifndef __NR_statfs # define __NR_statfs 99 # endif # ifndef __NR_fstatfs # define __NR_fstatfs 100 # endif -# ifndef __NR_ioperm -# define __NR_ioperm 101 -# endif # ifndef __NR_socketcall # define __NR_socketcall 102 # endif @@ -5362,11 +5282,8 @@ # ifndef __NR_fstat # define __NR_fstat 108 # endif -# ifndef __NR_olduname -# define __NR_olduname 109 -# endif -# ifndef __NR_iopl -# define __NR_iopl 110 +# ifndef __NR_lookup_dcookie +# define __NR_lookup_dcookie 110 # endif # ifndef __NR_vhangup # define __NR_vhangup 111 @@ -5374,9 +5291,6 @@ # ifndef __NR_idle # define __NR_idle 112 # endif -# ifndef __NR_vm86old -# define __NR_vm86old 113 -# endif # ifndef __NR_wait4 # define __NR_wait4 114 # endif @@ -5404,9 +5318,6 @@ # ifndef __NR_uname # define __NR_uname 122 # endif -# ifndef __NR_cacheflush -# define __NR_cacheflush 123 -# endif # ifndef __NR_adjtimex # define __NR_adjtimex 124 # endif @@ -5449,12 +5360,6 @@ # ifndef __NR_afs_syscall # define __NR_afs_syscall 137 # endif -# ifndef __NR_setfsuid -# define __NR_setfsuid 138 -# endif -# ifndef __NR_setfsgid -# define __NR_setfsgid 139 -# endif # ifndef __NR_getdents # define __NR_getdents 141 # endif @@ -5518,15 +5423,6 @@ # ifndef __NR_mremap # define __NR_mremap 163 # endif -# ifndef __NR_setresuid -# define __NR_setresuid 164 -# endif -# ifndef __NR_getresuid -# define __NR_getresuid 165 -# endif -# ifndef __NR_vm86 -# define __NR_vm86 166 -# endif # ifndef __NR_query_module # define __NR_query_module 167 # endif @@ -5536,12 +5432,6 @@ # ifndef __NR_nfsservctl # define __NR_nfsservctl 169 # endif -# ifndef __NR_setresgid -# define __NR_setresgid 170 -# endif -# ifndef __NR_getresgid -# define __NR_getresgid 171 -# endif # ifndef __NR_prctl # define __NR_prctl 172 # endif @@ -5572,9 +5462,6 @@ # ifndef __NR_pwrite64 # define __NR_pwrite64 181 # endif -# ifndef __NR_chown -# define __NR_chown 182 -# endif # ifndef __NR_getcwd # define __NR_getcwd 183 # endif @@ -5590,618 +5477,3638 @@ # ifndef __NR_sendfile # define __NR_sendfile 187 # endif -# ifndef __NR_streams1 -# define __NR_streams1 188 +# ifndef __NR_getpmsg +# define __NR_getpmsg 188 # endif -# ifndef __NR_streams2 -# define __NR_streams2 189 +# ifndef __NR_putpmsg +# define __NR_putpmsg 189 # endif # ifndef __NR_vfork # define __NR_vfork 190 # endif -# ifndef __NR_ugetrlimit -# define __NR_ugetrlimit 191 +# ifndef __NR_pivot_root +# define __NR_pivot_root 217 # endif -# ifndef __NR_mmap2 -# define __NR_mmap2 192 +# ifndef __NR_mincore +# define __NR_mincore 218 # endif -# ifndef __NR_truncate64 -# define __NR_truncate64 193 +# ifndef __NR_madvise +# define __NR_madvise 219 # endif -# ifndef __NR_ftruncate64 -# define __NR_ftruncate64 194 +# ifndef __NR_getdents64 +# define __NR_getdents64 220 # endif -# ifndef __NR_stat64 -# define __NR_stat64 195 +# ifndef __NR_readahead +# define __NR_readahead 222 # endif -# ifndef __NR_lstat64 -# define __NR_lstat64 196 +# ifndef __NR_setxattr +# define __NR_setxattr 224 # endif -# ifndef __NR_fstat64 -# define __NR_fstat64 197 +# ifndef __NR_lsetxattr +# define __NR_lsetxattr 225 # endif -# ifndef __NR_lchown32 -# define __NR_lchown32 198 +# ifndef __NR_fsetxattr +# define __NR_fsetxattr 226 # endif -# ifndef __NR_getuid32 -# define __NR_getuid32 199 +# ifndef __NR_getxattr +# define __NR_getxattr 227 # endif -# ifndef __NR_getgid32 -# define __NR_getgid32 200 +# ifndef __NR_lgetxattr +# define __NR_lgetxattr 228 # endif -# ifndef __NR_geteuid32 -# define __NR_geteuid32 201 +# ifndef __NR_fgetxattr +# define __NR_fgetxattr 229 # endif -# ifndef __NR_getegid32 -# define __NR_getegid32 202 +# ifndef __NR_listxattr +# define __NR_listxattr 230 # endif -# ifndef __NR_setreuid32 -# define __NR_setreuid32 203 +# ifndef __NR_llistxattr +# define __NR_llistxattr 231 # endif -# ifndef __NR_setregid32 -# define __NR_setregid32 204 +# ifndef __NR_flistxattr +# define __NR_flistxattr 232 # endif -# ifndef __NR_getgroups32 -# define __NR_getgroups32 205 +# ifndef __NR_removexattr +# define __NR_removexattr 233 # endif -# ifndef __NR_setgroups32 -# define __NR_setgroups32 206 +# ifndef __NR_lremovexattr +# define __NR_lremovexattr 234 # endif -# ifndef __NR_fchown32 -# define __NR_fchown32 207 +# ifndef __NR_fremovexattr +# define __NR_fremovexattr 235 # endif -# ifndef __NR_setresuid32 -# define __NR_setresuid32 208 +# ifndef __NR_gettid +# define __NR_gettid 236 # endif -# ifndef __NR_getresuid32 -# define __NR_getresuid32 209 +# ifndef __NR_tkill +# define __NR_tkill 237 # endif -# ifndef __NR_setresgid32 -# define __NR_setresgid32 210 +# ifndef __NR_futex +# define __NR_futex 238 # endif -# ifndef __NR_getresgid32 -# define __NR_getresgid32 211 +# ifndef __NR_sched_setaffinity +# define __NR_sched_setaffinity 239 # endif -# ifndef __NR_chown32 -# define __NR_chown32 212 +# ifndef __NR_sched_getaffinity +# define __NR_sched_getaffinity 240 # endif -# ifndef __NR_setuid32 -# define __NR_setuid32 213 +# ifndef __NR_tgkill +# define __NR_tgkill 241 # endif -# ifndef __NR_setgid32 -# define __NR_setgid32 214 +# ifndef __NR_io_setup +# define __NR_io_setup 243 # endif -# ifndef __NR_setfsuid32 -# define __NR_setfsuid32 215 +# ifndef __NR_io_destroy +# define __NR_io_destroy 244 # endif -# ifndef __NR_setfsgid32 -# define __NR_setfsgid32 216 +# ifndef __NR_io_getevents +# define __NR_io_getevents 245 # endif -# ifndef __NR_pivot_root -# define __NR_pivot_root 217 +# ifndef __NR_io_submit +# define __NR_io_submit 246 # endif -# ifndef __NR_mincore -# define __NR_mincore 218 +# ifndef __NR_io_cancel +# define __NR_io_cancel 247 # endif -# ifndef __NR_madvise -# define __NR_madvise 219 +# ifndef __NR_exit_group +# define __NR_exit_group 248 # endif -# ifndef __NR_socket -# define __NR_socket 220 +# ifndef __NR_epoll_create +# define __NR_epoll_create 249 # endif -# ifndef __NR_bind -# define __NR_bind 221 +# ifndef __NR_epoll_ctl +# define __NR_epoll_ctl 250 # endif -# ifndef __NR_connect -# define __NR_connect 222 +# ifndef __NR_epoll_wait +# define __NR_epoll_wait 251 # endif -# ifndef __NR_listen -# define __NR_listen 223 +# ifndef __NR_set_tid_address +# define __NR_set_tid_address 252 # endif -# ifndef __NR_accept -# define __NR_accept 224 +# ifndef __NR_fadvise64 +# define __NR_fadvise64 253 # endif -# ifndef __NR_getsockname -# define __NR_getsockname 225 +# ifndef __NR_timer_create +# define __NR_timer_create 254 # endif -# ifndef __NR_getpeername -# define __NR_getpeername 226 +# ifndef __NR_timer_settime +# define __NR_timer_settime (__NR_timer_create+1) # endif -# ifndef __NR_socketpair -# define __NR_socketpair 227 +# ifndef __NR_timer_gettime +# define __NR_timer_gettime (__NR_timer_create+2) # endif -# ifndef __NR_send -# define __NR_send 228 +# ifndef __NR_timer_getoverrun +# define __NR_timer_getoverrun (__NR_timer_create+3) # endif -# ifndef __NR_sendto -# define __NR_sendto 229 +# ifndef __NR_timer_delete +# define __NR_timer_delete (__NR_timer_create+4) # endif -# ifndef __NR_recv -# define __NR_recv 230 +# ifndef __NR_clock_settime +# define __NR_clock_settime (__NR_timer_create+5) # endif -# ifndef __NR_recvfrom -# define __NR_recvfrom 231 +# ifndef __NR_clock_gettime +# define __NR_clock_gettime (__NR_timer_create+6) # endif -# ifndef __NR_shutdown -# define __NR_shutdown 232 +# ifndef __NR_clock_getres +# define __NR_clock_getres (__NR_timer_create+7) # endif -# ifndef __NR_setsockopt -# define __NR_setsockopt 233 +# ifndef __NR_clock_nanosleep +# define __NR_clock_nanosleep (__NR_timer_create+8) # endif -# ifndef __NR_getsockopt -# define __NR_getsockopt 234 +# ifndef __NR_statfs64 +# define __NR_statfs64 265 # endif -# ifndef __NR_sendmsg -# define __NR_sendmsg 235 +# ifndef __NR_fstatfs64 +# define __NR_fstatfs64 266 # endif -# ifndef __NR_recvmsg -# define __NR_recvmsg 236 +# ifndef __NR_remap_file_pages +# define __NR_remap_file_pages 267 # endif -# ifndef __NR_semop -# define __NR_semop 237 +# ifndef __NR_mq_open +# define __NR_mq_open 271 # endif -# ifndef __NR_semget -# define __NR_semget 238 +# ifndef __NR_mq_unlink +# define __NR_mq_unlink 272 # endif -# ifndef __NR_semctl +# ifndef __NR_mq_timedsend +# define __NR_mq_timedsend 273 +# endif +# ifndef __NR_mq_timedreceive +# define __NR_mq_timedreceive 274 +# endif +# ifndef __NR_mq_notify +# define __NR_mq_notify 275 +# endif +# ifndef __NR_mq_getsetattr +# define __NR_mq_getsetattr 276 +# endif +# ifndef __NR_kexec_load +# define __NR_kexec_load 277 +# endif +# ifndef __NR_add_key +# define __NR_add_key 278 +# endif +# ifndef __NR_request_key +# define __NR_request_key 279 +# endif +# ifndef __NR_keyctl +# define __NR_keyctl 280 +# endif +# ifndef __NR_waitid +# define __NR_waitid 281 +# endif +# ifndef __NR_ioprio_set +# define __NR_ioprio_set 282 +# endif +# ifndef __NR_ioprio_get +# define __NR_ioprio_get 283 +# endif +# ifndef __NR_inotify_init +# define __NR_inotify_init 284 +# endif +# ifndef __NR_inotify_add_watch +# define __NR_inotify_add_watch 285 +# endif +# ifndef __NR_inotify_rm_watch +# define __NR_inotify_rm_watch 286 +# endif +# ifndef __NR_openat +# define __NR_openat 288 +# endif +# ifndef __NR_mkdirat +# define __NR_mkdirat 289 +# endif +# ifndef __NR_mknodat +# define __NR_mknodat 290 +# endif +# ifndef __NR_fchownat +# define __NR_fchownat 291 +# endif +# ifndef __NR_futimesat +# define __NR_futimesat 292 +# endif +# ifndef __NR_unlinkat +# define __NR_unlinkat 294 +# endif +# ifndef __NR_renameat +# define __NR_renameat 295 +# endif +# ifndef __NR_linkat +# define __NR_linkat 296 +# endif +# ifndef __NR_symlinkat +# define __NR_symlinkat 297 +# endif +# ifndef __NR_readlinkat +# define __NR_readlinkat 298 +# endif +# ifndef __NR_fchmodat +# define __NR_fchmodat 299 +# endif +# ifndef __NR_faccessat +# define __NR_faccessat 300 +# endif +# ifndef __NR_pselect6 +# define __NR_pselect6 301 +# endif +# ifndef __NR_ppoll +# define __NR_ppoll 302 +# endif +# ifndef __NR_unshare +# define __NR_unshare 303 +# endif +# ifndef __NR_set_robust_list +# define __NR_set_robust_list 304 +# endif +# ifndef __NR_get_robust_list +# define __NR_get_robust_list 305 +# endif +# ifndef __NR_splice +# define __NR_splice 306 +# endif +# ifndef __NR_sync_file_range +# define __NR_sync_file_range 307 +# endif +# ifndef __NR_tee +# define __NR_tee 308 +# endif +# ifndef __NR_vmsplice +# define __NR_vmsplice 309 +# endif +# ifndef __NR_getcpu +# define __NR_getcpu 311 +# endif +# ifndef __NR_epoll_pwait +# define __NR_epoll_pwait 312 +# endif +# ifndef __NR_utimes +# define __NR_utimes 313 +# endif +# ifndef __NR_fallocate +# define __NR_fallocate 314 +# endif +# ifndef __NR_utimensat +# define __NR_utimensat 315 +# endif +# ifndef __NR_signalfd +# define __NR_signalfd 316 +# endif +# ifndef __NR_timerfd +# define __NR_timerfd 317 +# endif +# ifndef __NR_eventfd +# define __NR_eventfd 318 +# endif +# ifndef __NR_timerfd_create +# define __NR_timerfd_create 319 +# endif +# ifndef __NR_timerfd_settime +# define __NR_timerfd_settime 320 +# endif +# ifndef __NR_timerfd_gettime +# define __NR_timerfd_gettime 321 +# endif +# ifndef __NR_signalfd4 +# define __NR_signalfd4 322 +# endif +# ifndef __NR_eventfd2 +# define __NR_eventfd2 323 +# endif +# ifndef __NR_inotify_init1 +# define __NR_inotify_init1 324 +# endif +# ifndef __NR_pipe2 +# define __NR_pipe2 325 +# endif +# ifndef __NR_dup3 +# define __NR_dup3 326 +# endif +# ifndef __NR_epoll_create1 +# define __NR_epoll_create1 327 +# endif +# ifndef __NR_preadv +# define __NR_preadv 328 +# endif +# ifndef __NR_pwritev +# define __NR_pwritev 329 +# endif +# ifndef __NR_rt_tgsigqueueinfo +# define __NR_rt_tgsigqueueinfo 330 +# endif +# ifndef __NR_perf_event_open +# define __NR_perf_event_open 331 +# endif +# ifndef __NR_fanotify_init +# define __NR_fanotify_init 332 +# endif +# ifndef __NR_fanotify_mark +# define __NR_fanotify_mark 333 +# endif +# ifndef __NR_prlimit64 +# define __NR_prlimit64 334 +# endif +# ifndef __NR_time +# define __NR_time 13 +# endif +# ifndef __NR_lchown +# define __NR_lchown 16 +# endif +# ifndef __NR_setuid +# define __NR_setuid 23 +# endif +# ifndef __NR_getuid +# define __NR_getuid 24 +# endif +# ifndef __NR_stime +# define __NR_stime 25 +# endif +# ifndef __NR_setgid +# define __NR_setgid 46 +# endif +# ifndef __NR_getgid +# define __NR_getgid 47 +# endif +# ifndef __NR_geteuid +# define __NR_geteuid 49 +# endif +# ifndef __NR_getegid +# define __NR_getegid 50 +# endif +# ifndef __NR_setreuid +# define __NR_setreuid 70 +# endif +# ifndef __NR_setregid +# define __NR_setregid 71 +# endif +# ifndef __NR_getrlimit +# define __NR_getrlimit 76 +# endif +# ifndef __NR_getgroups +# define __NR_getgroups 80 +# endif +# ifndef __NR_setgroups +# define __NR_setgroups 81 +# endif +# ifndef __NR_fchown +# define __NR_fchown 95 +# endif +# ifndef __NR_ioperm +# define __NR_ioperm 101 +# endif +# ifndef __NR_setfsuid +# define __NR_setfsuid 138 +# endif +# ifndef __NR_setfsgid +# define __NR_setfsgid 139 +# endif +# ifndef __NR_setresuid +# define __NR_setresuid 164 +# endif +# ifndef __NR_getresuid +# define __NR_getresuid 165 +# endif +# ifndef __NR_setresgid +# define __NR_setresgid 170 +# endif +# ifndef __NR_getresgid +# define __NR_getresgid 171 +# endif +# ifndef __NR_chown +# define __NR_chown 182 +# endif +# ifndef __NR_ugetrlimit +# define __NR_ugetrlimit 191 +# endif +# ifndef __NR_mmap2 +# define __NR_mmap2 192 +# endif +# ifndef __NR_truncate64 +# define __NR_truncate64 193 +# endif +# ifndef __NR_ftruncate64 +# define __NR_ftruncate64 194 +# endif +# ifndef __NR_stat64 +# define __NR_stat64 195 +# endif +# ifndef __NR_lstat64 +# define __NR_lstat64 196 +# endif +# ifndef __NR_fstat64 +# define __NR_fstat64 197 +# endif +# ifndef __NR_lchown32 +# define __NR_lchown32 198 +# endif +# ifndef __NR_getuid32 +# define __NR_getuid32 199 +# endif +# ifndef __NR_getgid32 +# define __NR_getgid32 200 +# endif +# ifndef __NR_geteuid32 +# define __NR_geteuid32 201 +# endif +# ifndef __NR_getegid32 +# define __NR_getegid32 202 +# endif +# ifndef __NR_setreuid32 +# define __NR_setreuid32 203 +# endif +# ifndef __NR_setregid32 +# define __NR_setregid32 204 +# endif +# ifndef __NR_getgroups32 +# define __NR_getgroups32 205 +# endif +# ifndef __NR_setgroups32 +# define __NR_setgroups32 206 +# endif +# ifndef __NR_fchown32 +# define __NR_fchown32 207 +# endif +# ifndef __NR_setresuid32 +# define __NR_setresuid32 208 +# endif +# ifndef __NR_getresuid32 +# define __NR_getresuid32 209 +# endif +# ifndef __NR_setresgid32 +# define __NR_setresgid32 210 +# endif +# ifndef __NR_getresgid32 +# define __NR_getresgid32 211 +# endif +# ifndef __NR_chown32 +# define __NR_chown32 212 +# endif +# ifndef __NR_setuid32 +# define __NR_setuid32 213 +# endif +# ifndef __NR_setgid32 +# define __NR_setgid32 214 +# endif +# ifndef __NR_setfsuid32 +# define __NR_setfsuid32 215 +# endif +# ifndef __NR_setfsgid32 +# define __NR_setfsgid32 216 +# endif +# ifndef __NR_fcntl64 +# define __NR_fcntl64 221 +# endif +# ifndef __NR_sendfile64 +# define __NR_sendfile64 223 +# endif +# ifndef __NR_fadvise64_64 +# define __NR_fadvise64_64 264 +# endif +# ifndef __NR_fstatat64 +# define __NR_fstatat64 293 +# endif +# ifndef __NR_select +# define __NR_select 142 +# endif +# ifndef __NR_getrlimit +# define __NR_getrlimit 191 +# endif +# ifndef __NR_lchown +# define __NR_lchown 198 +# endif +# ifndef __NR_getuid +# define __NR_getuid 199 +# endif +# ifndef __NR_getgid +# define __NR_getgid 200 +# endif +# ifndef __NR_geteuid +# define __NR_geteuid 201 +# endif +# ifndef __NR_getegid +# define __NR_getegid 202 +# endif +# ifndef __NR_setreuid +# define __NR_setreuid 203 +# endif +# ifndef __NR_setregid +# define __NR_setregid 204 +# endif +# ifndef __NR_getgroups +# define __NR_getgroups 205 +# endif +# ifndef __NR_setgroups +# define __NR_setgroups 206 +# endif +# ifndef __NR_fchown +# define __NR_fchown 207 +# endif +# ifndef __NR_setresuid +# define __NR_setresuid 208 +# endif +# ifndef __NR_getresuid +# define __NR_getresuid 209 +# endif +# ifndef __NR_setresgid +# define __NR_setresgid 210 +# endif +# ifndef __NR_getresgid +# define __NR_getresgid 211 +# endif +# ifndef __NR_chown +# define __NR_chown 212 +# endif +# ifndef __NR_setuid +# define __NR_setuid 213 +# endif +# ifndef __NR_setgid +# define __NR_setgid 214 +# endif +# ifndef __NR_setfsuid +# define __NR_setfsuid 215 +# endif +# ifndef __NR_setfsgid +# define __NR_setfsgid 216 +# endif +# ifndef __NR_newfstatat +# define __NR_newfstatat 293 +# endif +#endif + + +#ifdef __s390__ +# ifndef __NR_exit +# define __NR_exit 1 +# endif +# ifndef __NR_fork +# define __NR_fork 2 +# endif +# ifndef __NR_read +# define __NR_read 3 +# endif +# ifndef __NR_write +# define __NR_write 4 +# endif +# ifndef __NR_open +# define __NR_open 5 +# endif +# ifndef __NR_close +# define __NR_close 6 +# endif +# ifndef __NR_restart_syscall +# define __NR_restart_syscall 7 +# endif +# ifndef __NR_creat +# define __NR_creat 8 +# endif +# ifndef __NR_link +# define __NR_link 9 +# endif +# ifndef __NR_unlink +# define __NR_unlink 10 +# endif +# ifndef __NR_execve +# define __NR_execve 11 +# endif +# ifndef __NR_chdir +# define __NR_chdir 12 +# endif +# ifndef __NR_mknod +# define __NR_mknod 14 +# endif +# ifndef __NR_chmod +# define __NR_chmod 15 +# endif +# ifndef __NR_lseek +# define __NR_lseek 19 +# endif +# ifndef __NR_getpid +# define __NR_getpid 20 +# endif +# ifndef __NR_mount +# define __NR_mount 21 +# endif +# ifndef __NR_umount +# define __NR_umount 22 +# endif +# ifndef __NR_ptrace +# define __NR_ptrace 26 +# endif +# ifndef __NR_alarm +# define __NR_alarm 27 +# endif +# ifndef __NR_pause +# define __NR_pause 29 +# endif +# ifndef __NR_utime +# define __NR_utime 30 +# endif +# ifndef __NR_access +# define __NR_access 33 +# endif +# ifndef __NR_nice +# define __NR_nice 34 +# endif +# ifndef __NR_sync +# define __NR_sync 36 +# endif +# ifndef __NR_kill +# define __NR_kill 37 +# endif +# ifndef __NR_rename +# define __NR_rename 38 +# endif +# ifndef __NR_mkdir +# define __NR_mkdir 39 +# endif +# ifndef __NR_rmdir +# define __NR_rmdir 40 +# endif +# ifndef __NR_dup +# define __NR_dup 41 +# endif +# ifndef __NR_pipe +# define __NR_pipe 42 +# endif +# ifndef __NR_times +# define __NR_times 43 +# endif +# ifndef __NR_brk +# define __NR_brk 45 +# endif +# ifndef __NR_signal +# define __NR_signal 48 +# endif +# ifndef __NR_acct +# define __NR_acct 51 +# endif +# ifndef __NR_umount2 +# define __NR_umount2 52 +# endif +# ifndef __NR_ioctl +# define __NR_ioctl 54 +# endif +# ifndef __NR_fcntl +# define __NR_fcntl 55 +# endif +# ifndef __NR_setpgid +# define __NR_setpgid 57 +# endif +# ifndef __NR_umask +# define __NR_umask 60 +# endif +# ifndef __NR_chroot +# define __NR_chroot 61 +# endif +# ifndef __NR_ustat +# define __NR_ustat 62 +# endif +# ifndef __NR_dup2 +# define __NR_dup2 63 +# endif +# ifndef __NR_getppid +# define __NR_getppid 64 +# endif +# ifndef __NR_getpgrp +# define __NR_getpgrp 65 +# endif +# ifndef __NR_setsid +# define __NR_setsid 66 +# endif +# ifndef __NR_sigaction +# define __NR_sigaction 67 +# endif +# ifndef __NR_sigsuspend +# define __NR_sigsuspend 72 +# endif +# ifndef __NR_sigpending +# define __NR_sigpending 73 +# endif +# ifndef __NR_sethostname +# define __NR_sethostname 74 +# endif +# ifndef __NR_setrlimit +# define __NR_setrlimit 75 +# endif +# ifndef __NR_getrusage +# define __NR_getrusage 77 +# endif +# ifndef __NR_gettimeofday +# define __NR_gettimeofday 78 +# endif +# ifndef __NR_settimeofday +# define __NR_settimeofday 79 +# endif +# ifndef __NR_symlink +# define __NR_symlink 83 +# endif +# ifndef __NR_readlink +# define __NR_readlink 85 +# endif +# ifndef __NR_uselib +# define __NR_uselib 86 +# endif +# ifndef __NR_swapon +# define __NR_swapon 87 +# endif +# ifndef __NR_reboot +# define __NR_reboot 88 +# endif +# ifndef __NR_readdir +# define __NR_readdir 89 +# endif +# ifndef __NR_mmap +# define __NR_mmap 90 +# endif +# ifndef __N... [truncated message content] |
From: Cyril H. <su...@li...> - 2013-04-26 08:21:51
|
The branch, master, has been updated via b3e9e5ee189c11cc36fff206896f03fdfbec63fc (commit) via 330f4e37d8e46934fe9f86c844226926b8e60c1b (commit) via 41dae8917c820defbc06fcaf61c807072ed13549 (commit) via 332fe2d0634d9ed972169bdb8bbd080fd00817eb (commit) via f85fea706a1fb8e1abcbb4bef74c28c593c8ea54 (commit) from b662202c9b679e7c69560cd557f766f750325273 (commit) - Log ----------------------------------------------------------------- commit b3e9e5ee189c11cc36fff206896f03fdfbec63fc Author: Wanlong Gao <gao...@cn...> Date: Fri Apr 26 14:55:25 2013 +0800 access05: code cleanups Cleanup the code. Signed-off-by: Wanlong Gao <gao...@cn...> commit 330f4e37d8e46934fe9f86c844226926b8e60c1b Author: Wanlong Gao <gao...@cn...> Date: Fri Apr 26 14:55:25 2013 +0800 access04: code cleanups Cleanup the code. Signed-off-by: Wanlong Gao <gao...@cn...> commit 41dae8917c820defbc06fcaf61c807072ed13549 Author: Wanlong Gao <gao...@cn...> Date: Fri Apr 26 14:55:25 2013 +0800 access03: code cleanups Cleanup the code. Signed-off-by: Wanlong Gao <gao...@cn...> commit 332fe2d0634d9ed972169bdb8bbd080fd00817eb Author: Wanlong Gao <gao...@cn...> Date: Fri Apr 26 14:55:25 2013 +0800 access02: code cleanups Cleanup the code. Signed-off-by: Wanlong Gao <gao...@cn...> commit f85fea706a1fb8e1abcbb4bef74c28c593c8ea54 Author: Wanlong Gao <gao...@cn...> Date: Fri Apr 26 14:55:25 2013 +0800 access01: code cleanups Cleanup the code. Signed-off-by: Wanlong Gao <gao...@cn...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/syscalls/access/access01.c | 199 ++++++-------------------- testcases/kernel/syscalls/access/access02.c | 210 ++++++++++----------------- testcases/kernel/syscalls/access/access03.c | 105 ++------------ testcases/kernel/syscalls/access/access04.c | 75 ++-------- testcases/kernel/syscalls/access/access05.c | 141 +++++------------- 5 files changed, 188 insertions(+), 542 deletions(-) diff --git a/testcases/kernel/syscalls/access/access01.c b/testcases/kernel/syscalls/access/access01.c index f239f3f..2b85c1e 100644 --- a/testcases/kernel/syscalls/access/access01.c +++ b/testcases/kernel/syscalls/access/access01.c @@ -20,103 +20,13 @@ * with this program; if not, write the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, - * Mountain View, CA 94043, or: - * - * http://www.sgi.com - * - * For further information regarding this notice, see: - * - * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ */ -/* $Id: access01.c,v 1.8 2009/11/09 05:56:58 yaberauneya Exp $ */ -/********************************************************** - * - * OS Test - Silicon Graphics, Inc. - * - * TEST IDENTIFIER : access01 - * - * EXECUTED BY : anyone - * - * TEST TITLE : Basic test for access(2) using F_OK, - * R_OK, W_OK and X_OK arguments. - * - * PARENT DOCUMENT : usctpl01 - * - * TEST CASE TOTAL : 6 - * - * WALL CLOCK TIME : 1 - * - * CPU TYPES : ALL - * - * AUTHOR : William Roske - * - * CO-PILOT : Dave Fenner - * - * DATE STARTED : 03/30/92 - * - * INITIAL RELEASE : UNICOS 7.0 - * - * TEST CASES - * - * 1.) access(2) returns 0 for F_OK...(See Description) - * 2.) access(2) returns 0 for R_OK...(See Description) - * 3.) access(2) returns 0 for W_OK...(See Description) - * 4.) access(2) returns 0 for X_OK...(See Description) - * - * INPUT SPECIFICATIONS - * The standard options for system call tests are accepted. - * (See the parse_opts(3) man page). - * - * OUTPUT SPECIFICATIONS - * - * DURATION - * Terminates - with frequency and infinite modes. - * - * SIGNALS - * Uses SIGUSR1 to pause before test if option set. - * (See the parse_opts(3) man page). - * - * RESOURCES - * None - * - * ENVIRONMENTAL NEEDS - * The libcuts.a and libsys.a libraries must be included in - * the compilation of this test. - * - * SPECIAL PROCEDURAL REQUIREMENTS - * None - * - * INTERCASE DEPENDENCIES - * None - * - * DETAILED DESCRIPTION - * This is a Phase I test for the access(2) system call. It is intended - * to provide a limited exposure of the system call, for now. It - * should/will be extended when full functional tests are written for - * access(2). - * - * Setup: - * Setup signal handling. - * Pause for SIGUSR1 if option specified. - * Create a temp directory and cd to it. - * Creat a temp file wil read, write and execute permissions. - * - * Test: - * Loop if the proper options are given. - * Execute system call with F_OK on tmp file - * Check return code, if system call failed (return=-1) - * Log the errno and Issue a FAIL message. - * Otherwise, Issue a PASS message. - * Execute system call with X_OK on tmp file... - * Execute system call with W_OK on tmp file... - * Execute system call with R_OK on tmp file... - * - * Cleanup: - * Print errno log - * - * - *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/ + +/* + * Description: + * Basic test for access(2) using F_OK, R_OK, W_OK and X_OK on tmp file + * AUTHOR : William Roske + */ #include <string.h> #include <unistd.h> @@ -127,77 +37,66 @@ #include <sys/stat.h> #include "test.h" #include "usctest.h" -void setup(); -void cleanup(); + char *TCID = "access01"; -int TST_TOTAL = 4; -char Fname[255]; +char fname[255]; static struct test_case_t { char *file; int mode; char *string; int experrno; -} Test_cases[] = { - { - Fname, F_OK, "F_OK", 0}, { - Fname, X_OK, "X_OK", 0}, { - Fname, W_OK, "W_OK", 0}, { -Fname, R_OK, "R_OK", 0},}; +} test_cases[] = { + {fname, F_OK, "F_OK", 0}, + {fname, X_OK, "X_OK", 0}, + {fname, W_OK, "W_OK", 0}, + {fname, R_OK, "R_OK", 0}, +}; -int Ntc = sizeof(Test_cases) / sizeof(struct test_case_t); +int TST_TOTAL = sizeof(test_cases) / sizeof(struct test_case_t); + +static void setup(void); +static void cleanup(void); -/*********************************************************************** - * Main - ***********************************************************************/ int main(int ac, char **av) { int lc; char *msg; int tc; - TST_TOTAL = Ntc; - - if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) + msg = parse_opts(ac, av, NULL, NULL); + if (msg != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); setup(); for (lc = 0; TEST_LOOPING(lc); lc++) { - tst_count = 0; + for (tc = 0; tc < TST_TOTAL; tc++) { + TEST(access(test_cases[tc].file, test_cases[tc].mode)); - for (tc = 0; tc < Ntc; tc++) { - /* - * Call access(2) - */ - TEST(access(Test_cases[tc].file, Test_cases[tc].mode)); - - /* check return code */ - if (TEST_RETURN == -1 && Test_cases[tc].experrno == 0) { + if (TEST_RETURN == -1 && test_cases[tc].experrno == 0) { tst_resm(TFAIL | TTERRNO, "access(%s, %s) failed", - Test_cases[tc].file, - Test_cases[tc].string); + test_cases[tc].file, + test_cases[tc].string); } else if (TEST_RETURN != -1 - && Test_cases[tc].experrno != 0) { + && test_cases[tc].experrno != 0) { tst_resm(TFAIL, "access(%s, %s) returned %ld, " "exp -1, errno:%d", - Test_cases[tc].file, - Test_cases[tc].string, TEST_RETURN, - Test_cases[tc].experrno); + test_cases[tc].file, + test_cases[tc].string, TEST_RETURN, + test_cases[tc].experrno); } else { - if (STD_FUNCTIONAL_TEST) { - /* No Verification test, yet... */ tst_resm(TPASS, "access(%s, %s) returned %ld", - Test_cases[tc].file, - Test_cases[tc].string, + test_cases[tc].file, + test_cases[tc].string, TEST_RETURN); } } @@ -209,17 +108,15 @@ int main(int ac, char **av) tst_exit(); } -void setup() +static void setup(void) { int fd; struct stat stbuf; tst_sig(FORK, DEF_HANDLER, cleanup); - umask(0); /* reset umask avoid it affects on modes */ - + umask(0); TEST_PAUSE; - tst_tmpdir(); /* @@ -231,42 +128,32 @@ void setup() "chown(\".\", -1, %d) failed", getegid()); } - sprintf(Fname, "accessfile"); + snprintf(fname, sizeof(fname), "accessfile"); - fd = open(Fname, O_RDWR | O_CREAT, 06777); + fd = open(fname, O_RDWR | O_CREAT, 06777); if (fd == -1) tst_brkm(TBROK | TERRNO, cleanup, - "open(%s, O_RDWR|O_CREAT, 06777) failed", Fname); + "open(%s, O_RDWR|O_CREAT, 06777) failed", fname); else if (close(fd) == -1) - tst_resm(TINFO | TERRNO, "close(%s) failed", Fname); + tst_resm(TINFO | TERRNO, "close(%s) failed", fname); /* * force the mode to be set to 6777 */ - if (chmod(Fname, 06777) == -1) + if (chmod(fname, 06777) == -1) tst_brkm(TBROK | TERRNO, cleanup, "chmod(%s, 06777) failed", - Fname); + fname); - stat(Fname, &stbuf); + stat(fname, &stbuf); if ((stbuf.st_mode & 06777) != 06777) { - /* - * file can not be properly setup - */ + tst_brkm(TBROK, cleanup, "'%s' can't be properly setup", + fname); } - } -/*************************************************************** - * cleanup() - performs all ONE TIME cleanup for this test at - * completion or premature exit. - ***************************************************************/ -void cleanup() +static void cleanup(void) { - /* - * print timing stats if that option was specified. - */ TEST_CLEANUP; - tst_rmdir(); } diff --git a/testcases/kernel/syscalls/access/access02.c b/testcases/kernel/syscalls/access/access02.c index 55ad73a..57b5812 100644 --- a/testcases/kernel/syscalls/access/access02.c +++ b/testcases/kernel/syscalls/access/access02.c @@ -18,8 +18,6 @@ */ /* - * Test Name: access02 - * * Test Description: * Verify that access() succeeds to check the read/write/execute permissions * on a file if the mode argument passed was R_OK/W_OK/X_OK. @@ -27,46 +25,7 @@ * Also verify that, access() succeeds to test the accessibility of the file * referred to by symbolic link if the pathname points to a symbolic link. * - * Expected Result: - * access() should return 0 value and the specified file should have - * respective permissions set on it. - * - * Algorithm: - * Setup: - * Setup signal handling. - * Create temporary directory. - * Pause for SIGUSR1 if option specified. - * - * Test: - * Loop if the proper options are given. - * Execute system call - * Check return code, if system call failed (return=-1) - * Log the errno and Issue a FAIL message. - * Otherwise, - * Verify the Functionality of system call - * if successful, - * Issue Functionality-Pass message. - * Otherwise, - * Issue Functionality-Fail message. - * Cleanup: - * Print errno log and/or timing stats if options given - * Delete the temporary directory created. - * - * Usage: <for command-line> - * access02 [-c n] [-f] [-i n] [-I x] [-P x] [-t] - * where, -c n : Run n copies concurrently. - * -f : Turn off functionality Testing. - * -i n : Execute test n times. - * -I x : Execute test for x seconds. - * -P x : Pause for x seconds between iterations. - * -t : Turn on syscall timing. - * - * HISTORY * 07/2001 Ported by Wayne Boyer - * - * RESTRICTIONS: - * None. - * */ #include <sys/types.h> @@ -92,54 +51,47 @@ char *TCID = "access02"; int TST_TOTAL = 4; -int fd1, fd2, fd4; /* file descriptor for testfile(s) */ -char nobody_uid[] = "nobody"; -struct passwd *ltpuser; -int setup1(); /* setup() to test access() for R_OK */ -int setup2(); /* setup() to test access() for W_OK */ -int setup3(); /* setup() to test access() for X_OK */ -int setup4(); /* setup() to test access() on symlink file */ +static int fd1, fd2, fd4; +static const char nobody_uid[] = "nobody"; +static struct passwd *ltpuser; -struct test_case_t { /* test case structure */ +static int setup1(void); +static int setup2(void); +static int setup3(void); +static int setup4(void); + +static struct test_case_t { char *pathname; mode_t a_mode; - int (*setupfunc) (); + int (*setupfunc) (void); } test_cases[] = { - /* Read access */ - { - TEST_FILE1, R_OK, setup1}, - /* Write access */ - { - TEST_FILE2, W_OK, setup2}, - /* Execute access */ - { - TEST_FILE3, X_OK, setup3}, - /* Symlink */ - { -SYM_FILE, W_OK, setup4},}; - -void setup(); -void cleanup(); -int access_verify(int); + {TEST_FILE1, R_OK, setup1}, + {TEST_FILE2, W_OK, setup2}, + {TEST_FILE3, X_OK, setup3}, + {SYM_FILE, W_OK, setup4}, +}; + +static void setup(void); +static void cleanup(void); +static int access_verify(int); int main(int ac, char **av) { int lc; int i; char *msg; - mode_t access_mode; /* specified access mode for testfile */ - char *file_name; /* name of the testfile */ + mode_t access_mode; + char *file_name; - if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) + msg = parse_opts(ac, av, NULL, NULL); + if (msg != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); setup(); for (lc = 0; TEST_LOOPING(lc); lc++) { - tst_count = 0; - for (i = 0; i < TST_TOTAL; i++) { file_name = test_cases[i].pathname; access_mode = test_cases[i].a_mode; @@ -157,24 +109,22 @@ int main(int ac, char **av) continue; } - if (STD_FUNCTIONAL_TEST) { + if (STD_FUNCTIONAL_TEST) access_verify(i); - } else + else tst_resm(TPASS, "call succeeded"); } } cleanup(); - tst_exit(); } -void setup() +static void setup(void) { int i; tst_require_root(NULL); - tst_sig(FORK, DEF_HANDLER, cleanup); ltpuser = getpwnam(nobody_uid); @@ -184,7 +134,6 @@ void setup() tst_brkm(TINFO | TERRNO, NULL, "setuid failed"); TEST_PAUSE; - tst_tmpdir(); for (i = 0; i < TST_TOTAL; i++) @@ -198,12 +147,12 @@ void setup() * Creat/open a testfile and write some data into it. * This function returns 0. */ -int setup1() +static int setup1(void) { char write_buf[] = "abc"; - /* Creat a test file under above directory created */ - if ((fd1 = open(TEST_FILE1, O_RDWR | O_CREAT, FILE_MODE)) == -1) { + fd1 = open(TEST_FILE1, O_RDWR | O_CREAT, FILE_MODE); + if (fd1 == -1) { tst_brkm(TBROK | TERRNO, cleanup, "open(%s, O_RDWR|O_CREAT, %#o) failed", TEST_FILE1, FILE_MODE); @@ -225,10 +174,10 @@ int setup1() * Creat/open a testfile for writing under temporary directory. * This function returns 0. */ -int setup2() +static int setup2(void) { - /* Creat a test file under temporary directory */ - if ((fd2 = open(TEST_FILE2, O_RDWR | O_CREAT, FILE_MODE)) == -1) { + fd2 = open(TEST_FILE2, O_RDWR | O_CREAT, FILE_MODE); + if (fd1 == -1) { tst_brkm(TBROK | TERRNO, cleanup, "open(%s, O_RDWR|O_CREAT, %#o) failed", TEST_FILE2, FILE_MODE); @@ -244,15 +193,15 @@ int setup2() * Creat/open a testfile and provide execute permissions to it. * This function returns 0. */ -int setup3() +static int setup3(void) { - int fd3; /* File handle for test file */ + int fd3; #ifdef UCLINUX char exechead[] = "#!/bin/sh\n"; #endif - /* Creat a test file under temporary directory */ - if ((fd3 = open(TEST_FILE3, O_RDWR | O_CREAT, FILE_MODE)) == -1) { + fd3 = open(TEST_FILE3, O_RDWR | O_CREAT, FILE_MODE); + if (fd3 == -1) { tst_brkm(TBROK | TERRNO, cleanup, "open(%s, O_RDWR|O_CREAT, %#o) failed", TEST_FILE3, FILE_MODE); @@ -287,10 +236,10 @@ int setup3() * Creat a symbolic link of temporary file. * This function returns 0. */ -int setup4() +static int setup4(void) { - /* Creat a temporary file under temporary directory */ - if ((fd4 = open(TEMP_FILE, O_RDWR | O_CREAT, FILE_MODE)) == -1) { + fd4 = open(TEMP_FILE, O_RDWR | O_CREAT, FILE_MODE); + if (fd4 == -1) { tst_brkm(TBROK | TERRNO, cleanup, "open(%s, O_RDWR|O_CREAT, %#o) failed", TEMP_FILE, FILE_MODE); @@ -311,7 +260,7 @@ int setup4() * This function verify the accessibility of the * the testfile with the one verified by access(). */ -int access_verify(int i) +static int access_verify(int i) { char write_buf[] = "abc"; char read_buf[BUFSIZ]; @@ -320,40 +269,48 @@ int access_verify(int i) rval = 0; switch (i) { - case 0: /* - * The specified file has read access. - * Attempt to read some data from the testfile - * and if successful, access() behaviour is - * correct. - */ - if ((rval = read(fd1, &read_buf, sizeof(read_buf))) == -1) + case 0: + /* + * The specified file has read access. + * Attempt to read some data from the testfile + * and if successful, access() behaviour is + * correct. + */ + rval = read(fd1, &read_buf, sizeof(read_buf)); + if (rval == -1) tst_resm(TFAIL | TERRNO, "read(%s) failed", TEST_FILE1); break; - case 1: /* - * The specified file has write access. - * Attempt to write some data to the testfile - * and if successful, access() behaviour is correct. - */ - if ((rval = write(fd2, write_buf, strlen(write_buf))) == -1) + case 1: + /* + * The specified file has write access. + * Attempt to write some data to the testfile + * and if successful, access() behaviour is correct. + */ + rval = write(fd2, write_buf, strlen(write_buf)); + if (rval == -1) tst_resm(TFAIL | TERRNO, "write(%s) failed", TEST_FILE2); break; - case 2: /* - * The specified file has execute access. - * Attempt to execute the specified executable - * file, if successful, access() behaviour is correct. - */ - if ((rval = system("./" TEST_FILE3)) != 0) + case 2: + /* + * The specified file has execute access. + * Attempt to execute the specified executable + * file, if successful, access() behaviour is correct. + */ + rval = system("./" TEST_FILE3); + if (rval != 0) tst_resm(TFAIL, "Fail to execute the %s", TEST_FILE3); break; - case 3: /* - * The file pointed to by symbolic link has - * write access. - * Attempt to write some data to this temporary file - * pointed to by symlink. if successful, access() bahaviour - * is correct. - */ - if ((rval = write(fd4, write_buf, strlen(write_buf))) == -1) + case 3: + /* + * The file pointed to by symbolic link has + * write access. + * Attempt to write some data to this temporary file + * pointed to by symlink. if successful, access() bahaviour + * is correct. + */ + rval = write(fd4, write_buf, strlen(write_buf)); + if (rval == -1) tst_resm(TFAIL | TERRNO, "write(%s) failed", TEMP_FILE); break; default: @@ -363,18 +320,8 @@ int access_verify(int i) return rval; } -/* - * cleanup() - performs all ONE TIME cleanup for this test at - * completion or premature exit. - * - * Remove the test directory and testfile created in the setup. - */ -void cleanup() +static void cleanup(void) { - /* - * print timing stats if that option was specified. - * print errno log if that option was specified. - */ TEST_CLEANUP; /* Close the testfile(s) created in the setup()s */ @@ -385,10 +332,5 @@ void cleanup() if (close(fd4) == -1) tst_brkm(TFAIL | TERRNO, NULL, "close(%s) failed", TEMP_FILE); - /* - * Delete the test directory/file and temporary directory - * created in the setup. - */ tst_rmdir(); - } diff --git a/testcases/kernel/syscalls/access/access03.c b/testcases/kernel/syscalls/access/access03.c index 145ec74..04d6ceb 100644 --- a/testcases/kernel/syscalls/access/access03.c +++ b/testcases/kernel/syscalls/access/access03.c @@ -20,82 +20,11 @@ * with this program; if not, write the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, - * Mountain View, CA 94043, or: - * - * http://www.sgi.com - * - * For further information regarding this notice, see: - * - * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ - * */ -/* $Id: access03.c,v 1.8 2009/03/23 13:35:39 subrata_modak Exp $ */ -/********************************************************** - * - * OS Test - Silicon Graphics, Inc. - * - * TEST IDENTIFIER : access03 - * - * EXECUTED BY : anyone - * - * TEST TITLE : EFAULT error testing for access(2) - * - * PARENT DOCUMENT : acstds01 - * - * TEST CASE TOTAL : 8 - * - * WALL CLOCK TIME : 1 - * - * CPU TYPES : ALL - * - * AUTHOR : Kathy Olmsted - * - * CO-PILOT : Tom Hampson - * - * DATE STARTED : 05/13/92 - * - * INITIAL RELEASE : UNICOS 7.0 - * - * TEST CASES - * - * access(2) test for errno(s) EFAULT. - * - * INPUT SPECIFICATIONS - * The standard options for system call tests are accepted. - * (See the parse_opts(3) man page). - * - * DURATION - * Terminates - with frequency and infinite modes. - * - * SIGNALS - * Uses SIGUSR1 to pause before test if option set. - * (See the parse_opts(3) man page). - * - * ENVIRONMENTAL NEEDS - * No run-time environmental needs. - * - * DETAILED DESCRIPTION - * - * Setup: - * Setup signal handling. - * Make and change to a temporary directory. - * Pause for SIGUSR1 if option specified. - * - * Test: - * Loop if the proper options are given. - * Execute system call - * Check return code, if system call failed (return=-1) - * Log the errno. - * If doing functional test - * check the errno returned and print result message - * - * Cleanup: - * Print errno log and/or timing stats if options given - * Remove the temporary directory and exit. - * - * - *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/ + +/* + * access(2) test for errno(s) EFAULT. + */ #include <errno.h> #include <string.h> @@ -115,8 +44,8 @@ int TST_TOTAL = 8; int exp_enos[] = { EFAULT, 0 }; /* List must end with 0 */ /* XXX (garrcoop): uh, this isn't a bad address yo. */ -void *low_addr; -void *high_addr; +static void *low_addr; +static void *high_addr; #if !defined(UCLINUX) @@ -125,7 +54,8 @@ int main(int ac, char **av) int lc; char *msg; - if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) + msg = parse_opts(ac, av, NULL, NULL); + if (msg != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); setup(); @@ -134,6 +64,7 @@ int main(int ac, char **av) TEST_EXP_ENOS(exp_enos); #define TEST_ACCESS(addr, mode) \ +{ \ if (access(low_addr, mode) == -1) { \ if (errno == EFAULT) { \ tst_resm(TPASS, \ @@ -147,10 +78,10 @@ int main(int ac, char **av) } else { \ tst_resm(TFAIL, \ "access(%p, %s) succeeded unexpectedly", addr, #mode); \ - } + } \ +} for (lc = 0; TEST_LOOPING(lc); lc++) { - tst_count = 0; TEST_ACCESS(low_addr, R_OK); @@ -162,25 +93,22 @@ int main(int ac, char **av) TEST_ACCESS(high_addr, W_OK); TEST_ACCESS(high_addr, X_OK); TEST_ACCESS(high_addr, F_OK); - } cleanup(); tst_exit(); - } -void setup() +static void setup(void) { - tst_sig(NOFORK, DEF_HANDLER, cleanup); - TEST_PAUSE; low_addr = mmap(0, 1, PROT_NONE, MAP_PRIVATE_EXCEPT_UCLINUX | MAP_ANONYMOUS, 0, 0); if (low_addr == MAP_FAILED) tst_brkm(TBROK | TERRNO, NULL, "mmap failed"); + high_addr = get_high_address(); if (high_addr == NULL) tst_brkm(TBROK | TERRNO, NULL, "get_high_address failed"); @@ -189,14 +117,9 @@ void setup() tst_tmpdir(); } -/*************************************************************** - * cleanup() - performs all ONE TIME cleanup for this test at - * completion or premature exit. - ***************************************************************/ -void cleanup() +static void cleanup(void) { TEST_CLEANUP; - tst_rmdir(); } diff --git a/testcases/kernel/syscalls/access/access04.c b/testcases/kernel/syscalls/access/access04.c index 6da846d..09adecf 100644 --- a/testcases/kernel/syscalls/access/access04.c +++ b/testcases/kernel/syscalls/access/access04.c @@ -18,52 +18,11 @@ */ /* - * Test Name: access04 - * * Test Description: * Verify that access() succeeds to check the existance of a file if * search access is permitted on the pathname of the specified file. * - * Expected Result: - * access() should return 0 value and the specified file should exist - * on the file system. - * - * Algorithm: - * Setup: - * Setup signal handling. - * Create temporary directory. - * Pause for SIGUSR1 if option specified. - * - * Test: - * Loop if the proper options are given. - * Execute system call - * Check return code, if system call failed (return=-1) - * Log the errno and Issue a FAIL message. - * Otherwise, - * Verify the Functionality of system call - * if successful, - * Issue Functionality-Pass message. - * Otherwise, - * Issue Functionality-Fail message. - * Cleanup: - * Print errno log and/or timing stats if options given - * Delete the temporary directory created. - * - * Usage: <for command-line> - * access04 [-c n] [-f] [-i n] [-I x] [-P x] [-t] - * where, -c n : Run n copies concurrently. - * -f : Turn off functionality Testing. - * -i n : Execute test n times. - * -I x : Execute test for x seconds. - * -P x : Pause for x seconds between iterations. - * -t : Turn on syscall timing. - * - * HISTORY - * 07/2001 Ported by Wayne Boyer - * - * RESTRICTIONS: - * None. - * + * 07/2001 Ported by Wayne Boyer */ #include <stdio.h> @@ -81,30 +40,31 @@ #define TESTDIR "testdir" #define TESTFILE "testdir/testfile" -#define DIR_MODE S_IRWXU | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP -#define FILE_MODE S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH +#define DIR_MODE (S_IRWXU | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP) +#define FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) char *TCID = "access04"; int TST_TOTAL = 1; -char nobody_uid[] = "nobody"; -struct passwd *ltpuser; -void setup(); /* Main setup function of test */ -void cleanup(); /* cleanup function for the test */ +static const char nobody_uid[] = "nobody"; +static struct passwd *ltpuser; + +static void setup(void); +static void cleanup(void); int main(int ac, char **av) { - struct stat stat_buf; /* struct buffer for stat(2) */ + struct stat stat_buf; int lc; char *msg; - if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) + msg = parse_opts(ac, av, NULL, NULL); + if (msg != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); setup(); for (lc = 0; TEST_LOOPING(lc); lc++) { - tst_count = 0; TEST(access(TESTFILE, F_OK)); @@ -123,22 +83,20 @@ int main(int ac, char **av) tst_resm(TPASS, "functionality of " "access(%s, F_OK) ok", TESTFILE); } - } else + } else { tst_resm(TPASS, "call succeeded"); + } } cleanup(); - tst_exit(); - } -void setup() +static void setup(void) { int fd; tst_sig(NOFORK, DEF_HANDLER, cleanup); - tst_require_root(NULL); ltpuser = getpwnam(nobody_uid); @@ -149,7 +107,6 @@ void setup() tst_brkm(TINFO | TERRNO, NULL, "setuid failed"); TEST_PAUSE; - tst_tmpdir(); if (mkdir(TESTDIR, DIR_MODE) < 0) @@ -174,10 +131,8 @@ void setup() "chmod(%s, 0) failed", TESTFILE); } -void cleanup() +static void cleanup(void) { TEST_CLEANUP; - tst_rmdir(); - } diff --git a/testcases/kernel/syscalls/access/access05.c b/testcases/kernel/syscalls/access/access05.c index 20b71d8..be86225 100644 --- a/testcases/kernel/syscalls/access/access05.c +++ b/testcases/kernel/syscalls/access/access05.c @@ -18,8 +18,6 @@ */ /* - * Test Name: access05 - * * Test Description: * Verify that, * 1. access() fails with -1 return value and sets errno to EACCES @@ -35,45 +33,7 @@ * 5. access() fails with -1 return value and sets errno to ENAMETOOLONG * if the pathname size is > PATH_MAX characters. * - * Expected Result: - * access() should fail with return value -1 and set expected errno. - * - * Algorithm: - * Setup: - * Setup signal handling. - * Create temporary directory. - * Pause for SIGUSR1 if option specified. - * - * Test: - * Loop if the proper options are given. - * Execute system call - * Check return code, if system call failed (return=-1) - * if errno set == expected errno - * Issue sys call fails with expected return value and errno. - * Otherwise, - * Issue sys call fails with unexpected errno. - * Otherwise, - * Issue sys call returns unexpected value. - * - * Cleanup: - * Print errno log and/or timing stats if options given - * Delete the temporary directory(s)/file(s) created. - * - * Usage: <for command-line> - * access05 [-c n] [-e] [-i n] [-I x] [-P x] [-t] - * where, -c n : Run n copies concurrently. - * -e : Turn on errno logging. - * -i n : Execute test n times. - * -I x : Execute test for x seconds. - * -P x : Pause for x seconds between iterations. - * -t : Turn on syscall timing. - * - * HISTORY - * 07/2001 Ported by Wayne Boyer - * - * RESTRICTIONS: - * This test should be run by 'non-super-user' only. - * + * 07/2001 Ported by Wayne Boyer */ #include <stdio.h> @@ -98,59 +58,59 @@ #define FILE_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) -void setup1(); /* setup() to test access() for EACCES */ -void setup2(); /* setup() to test access() for EACCES */ -void setup3(); /* setup() to test access() for EACCES */ -void setup4(); /* setup() to test access() for EINVAL */ -void longpath_setup(); /* setup function to test access() for ENAMETOOLONG */ +static void setup1(void); /* setup() to test access() for EACCES */ +static void setup2(void); /* setup() to test access() for EACCES */ +static void setup3(void); /* setup() to test access() for EACCES */ +static void setup4(void); /* setup() to test access() for EINVAL */ +static void longpath_setup(); /* setup function to test access() for ENAMETOOLONG */ #if !defined(UCLINUX) -char high_address_node[64]; +static char high_address_node[64]; #endif -char Longpathname[PATH_MAX + 2]; +static char longpathname[PATH_MAX + 2]; -struct test_case_t { /* test case structure */ +static struct test_case_t { char *pathname; int a_mode; int exp_errno; void (*setupfunc) (void); } test_cases[] = { - { - TEST_FILE1, R_OK, EACCES, setup1}, { - TEST_FILE2, W_OK, EACCES, setup2}, { - TEST_FILE3, X_OK, EACCES, setup3}, { - TEST_FILE4, INV_OK, EINVAL, setup4}, + {TEST_FILE1, R_OK, EACCES, setup1}, + {TEST_FILE2, W_OK, EACCES, setup2}, + {TEST_FILE3, X_OK, EACCES, setup3}, + {TEST_FILE4, INV_OK, EINVAL, setup4}, #if !defined(UCLINUX) - { - (char *)-1, R_OK, EFAULT, NULL}, { - high_address_node, R_OK, EFAULT, NULL}, + {(char *)-1, R_OK, EFAULT, NULL}, + {high_address_node, R_OK, EFAULT, NULL}, #endif - { - "", W_OK, ENOENT, NULL}, { -Longpathname, R_OK, ENAMETOOLONG, longpath_setup},}; + {"", W_OK, ENOENT, NULL}, + {longpathname, R_OK, ENAMETOOLONG, longpath_setup}, +}; char *TCID = "access05"; int TST_TOTAL = sizeof(test_cases) / sizeof(*test_cases); -int exp_enos[] = { EACCES, EFAULT, EINVAL, ENOENT, ENAMETOOLONG, 0 }; -char nobody_uid[] = "nobody"; -struct passwd *ltpuser; +static int exp_enos[] = { EACCES, EFAULT, EINVAL, ENOENT, ENAMETOOLONG, 0 }; -void setup(); /* Main setup function of test */ -void cleanup(); /* cleanup function for the test */ +static const char nobody_uid[] = "nobody"; +static struct passwd *ltpuser; -char *bad_addr = 0; +static void setup(void); +static void cleanup(void); + +static char *bad_addr; int main(int ac, char **av) { int lc; char *msg; - char *file_name; /* name of the testfile */ - int access_mode; /* specified access mode for testfile */ + char *file_name; + int access_mode; int i; - if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) + msg = parse_opts(ac, av, NULL, NULL); + if (msg != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); setup(); @@ -158,7 +118,6 @@ int main(int ac, char **av) TEST_EXP_ENOS(exp_enos); for (lc = 0; TEST_LOOPING(lc); lc++) { - tst_count = 0; for (i = 0; i < TST_TOTAL; i++) { @@ -197,17 +156,14 @@ int main(int ac, char **av) } cleanup(); - tst_exit(); - } -void setup() +static void setup(void) { int i; tst_sig(NOFORK, DEF_HANDLER, cleanup); - tst_require_root(NULL); ltpuser = getpwnam(nobody_uid); @@ -233,11 +189,10 @@ void setup() test_cases[i].setupfunc(); } -void setup_file(const char *file, mode_t perms) +static void setup_file(const char *file, mode_t perms) { - int fd; /* file handle for testfile */ - - if ((fd = open(file, O_RDWR | O_CREAT, FILE_MODE)) == -1) + int fd = open(file, O_RDWR | O_CREAT, FILE_MODE); + if (fd == -1) tst_brkm(TBROK | TERRNO, cleanup, "open(%s, O_RDWR|O_CREAT, %#o) failed", file, FILE_MODE); @@ -258,7 +213,7 @@ void setup_file(const char *file, mode_t perms) * Deny read access permissions on testfile. * This function returns 0. */ -void setup1() +static void setup1(void) { setup_file(TEST_FILE1, 0333); } @@ -271,7 +226,7 @@ void setup1() * Deny write access permissions on testfile. * This function returns 0. */ -void setup2() +static void setup2(void) { setup_file(TEST_FILE2, 0555); } @@ -284,7 +239,7 @@ void setup2() * Deny search access permissions on testfile. * This function returns 0. */ -void setup3() +static void setup3(void) { setup_file(TEST_FILE3, 0666); } @@ -297,7 +252,7 @@ void setup3() * Creat/open a testfile and close it. * This function returns 0. */ -void setup4() +static void setup4(void) { setup_file(TEST_FILE4, FILE_MODE); } @@ -306,32 +261,16 @@ void setup4() * longpath_setup() - setup to create a node with a name length exceeding * the MAX. length of PATH_MAX. */ -void longpath_setup() +static void longpath_setup(void) { int i; for (i = 0; i <= (PATH_MAX + 1); i++) - Longpathname[i] = 'a'; + longpathname[i] = 'a'; } -/* - * cleanup() - performs all ONE TIME cleanup for this test at - * completion or premature exit. - * - * Remove the test directory and testfile created in the setup. - */ -void cleanup() +static void cleanup(void) { - /* - * print timing stats if that option was specified. - * print errno log if that option was specified. - */ TEST_CLEANUP; - - /* - * Delete the test directory/file and temporary directory - * created in the setup. - */ tst_rmdir(); - } hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-04-25 11:21:38
|
The branch, master, has been updated via b662202c9b679e7c69560cd557f766f750325273 (commit) via cd581241ad9ee9218250b943b30d296f28aa5857 (commit) from 865afa623f8f9dfd9680959ce2acb840eb0bdc61 (commit) - Log ----------------------------------------------------------------- commit b662202c9b679e7c69560cd557f766f750325273 Merge: 865afa6 cd58124 Author: Cyril Hrubis <ch...@su...> Date: Thu Apr 25 12:42:04 2013 +0200 Merge ../ltp-dev commit cd581241ad9ee9218250b943b30d296f28aa5857 Author: Cyril Hrubis <ch...@su...> Date: Thu Apr 25 12:32:09 2013 +0200 openposix/stress/mqueues: Rename args to match. This has been broken by 3a48c063457d2bc61605fdcfc9f30a228b2b19c0 As the binary names were renamed, the arg files no longer match. Fix this by renaming the args files to match again. Reported-by: Jan Stancek <jst...@re...> Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: ...nd_rev_1.args => mqueues_multi_send_rev_1.args} | 0 ...nd_rev_2.args => mqueues_multi_send_rev_2.args} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename testcases/open_posix_testsuite/stress/mqueues/{multi_send_rev_1.args => mqueues_multi_send_rev_1.args} (100%) rename testcases/open_posix_testsuite/stress/mqueues/{multi_send_rev_2.args => mqueues_multi_send_rev_2.args} (100%) diff --git a/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_1.args b/testcases/open_posix_testsuite/stress/mqueues/mqueues_multi_send_rev_1.args similarity index 100% rename from testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_1.args rename to testcases/open_posix_testsuite/stress/mqueues/mqueues_multi_send_rev_1.args diff --git a/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_2.args b/testcases/open_posix_testsuite/stress/mqueues/mqueues_multi_send_rev_2.args similarity index 100% rename from testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_2.args rename to testcases/open_posix_testsuite/stress/mqueues/mqueues_multi_send_rev_2.args hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-04-25 06:21:29
|
The branch, master, has been updated via 865afa623f8f9dfd9680959ce2acb840eb0bdc61 (commit) via dc8c2f3115f39cb325520898fdfc21518641fbd8 (commit) from db7f4359731c9fab922399fd3d9c929295ab1307 (commit) - Log ----------------------------------------------------------------- commit 865afa623f8f9dfd9680959ce2acb840eb0bdc61 Author: DAN LI <li...@cn...> Date: Thu Apr 25 11:07:05 2013 +0800 syscalls/getitimer01.c: Test for getting ITIMER_VIRTUAL and ITIMER_PROF Additional tests of getting ITIMER_VIRTUAL and ITIMER_PROF. Signed-off-by: DAN LI <li...@cn...> Signed-off-by: Wanlong Gao <gao...@cn...> commit dc8c2f3115f39cb325520898fdfc21518641fbd8 Author: DAN LI <li...@cn...> Date: Thu Apr 25 11:04:48 2013 +0800 syscalls/getitimer: cleanup 1. Remove redundant comments 2. Revise code to follow ltp-code-style Signed-off-by: DAN LI <li...@cn...> Signed-off-by: Wanlong Gao <gao...@cn...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/syscalls/getitimer/getitimer01.c | 149 +++++++------------- testcases/kernel/syscalls/getitimer/getitimer02.c | 100 ++++---------- 2 files changed, 79 insertions(+), 170 deletions(-) diff --git a/testcases/kernel/syscalls/getitimer/getitimer01.c b/testcases/kernel/syscalls/getitimer/getitimer01.c index 56c56e0..5569a49 100644 --- a/testcases/kernel/syscalls/getitimer/getitimer01.c +++ b/testcases/kernel/syscalls/getitimer/getitimer01.c @@ -1,55 +1,28 @@ /* + * Copyright (c) International Business Machines Corp., 2001 * - * Copyright (c) International Business Machines Corp., 2001 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This program 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 General Public License for more details. * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* - * NAME - * getitimer01.c - * - * DESCRIPTION - * getitimer01 - check that a correct call to getitimer() succeeds - * - * ALGORITHM - * loop if that option was specified - * allocate needed space - * issue the system call - * check the errno value - * issue a PASS message if we get zero - * otherwise, the tests fails - * issue a FAIL message - * break any remaining tests - * call cleanup - * - * USAGE: <for command-line> - * getitimer01 [-c n] [-f] [-i n] [-I x] [-P x] [-t] - * where, -c n : Run n copies concurrently. - * -f : Turn off functionality Testing. - * -i n : Execute test n times. - * -I x : Execute test for x seconds. - * -P x : Pause for x seconds between iterations. - * -t : Turn on syscall timing. - * - * HISTORY - * 03/2001 - Written by Wayne Boyer - * - * RESTRICTIONS - * none - */ + HISTORY + 03/2001 - Written by Wayne Boyer + + TEST ITEMS: + Check that a correct call to getitimer() succeeds. +*/ #include "test.h" #include "usctest.h" @@ -57,63 +30,58 @@ #include <errno.h> #include <sys/time.h> -void cleanup(void); -void setup(void); +static void cleanup(void); +static void setup(void); char *TCID = "getitimer01"; -int TST_TOTAL = 1; +int TST_TOTAL = 3; + +static int itimer_name[] = { + ITIMER_REAL, + ITIMER_VIRTUAL, + ITIMER_PROF, +}; int main(int ac, char **av) { int lc; + int i; char *msg; - struct itimerval *value; + struct itimerval value; - if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) { + msg = parse_opts(ac, av, NULL, NULL); + if (msg != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); - } - - setup(); /* global setup */ - /* The following loop checks looping state if -i option given */ + setup(); for (lc = 0; TEST_LOOPING(lc); lc++) { - /* reset tst_count in case we are looping */ tst_count = 0; - /* allocate space for the itimerval structure */ + for (i = 0; i < 3; i++) { - if ((value = (struct itimerval *)malloc((size_t) - sizeof(struct - itimerval))) == - NULL) { - tst_brkm(TBROK, cleanup, "value malloc failed"); - } - - /* call the system call with the TEST() macro */ + TEST(getitimer(itimer_name[i], &value)); - TEST(getitimer(ITIMER_REAL, value)); + if (TEST_RETURN != 0) + tst_resm(TFAIL, "call failed - errno = %d - %s", + TEST_ERRNO, strerror(TEST_ERRNO)); - if (TEST_RETURN != 0) { - tst_resm(TFAIL, "call failed - errno = %d - %s", - TEST_ERRNO, strerror(TEST_ERRNO)); - } + if (STD_FUNCTIONAL_TEST) { - if (STD_FUNCTIONAL_TEST) { - - /* - * Since ITIMER_REAL is effectively disabled (we did - * not set it before the getitimer call), the elements - * in it_value should be zero. - */ - if ((value->it_value.tv_sec == 0) && - (value->it_value.tv_usec == 0)) { - tst_resm(TPASS, "functional test passed"); + /* + * Since ITIMER is effectively disabled (we did + * not set it before the getitimer call), the + * elements in it_value should be zero. + */ + if ((value.it_value.tv_sec == 0) && + (value.it_value.tv_usec == 0)) { + tst_resm(TPASS, "functionality is ok"); + } else { + tst_resm(TFAIL, "timer are non zero"); + } } else { - tst_resm(TFAIL, "timer values are non zero"); + tst_resm(TPASS, "call succeeded"); } - } else { - tst_resm(TPASS, "call succeeded"); } } @@ -122,27 +90,14 @@ int main(int ac, char **av) tst_exit(); } -/* - * setup() - performs all the ONE TIME setup for this test. - */ -void setup(void) +static void setup(void) { - tst_sig(NOFORK, DEF_HANDLER, cleanup); TEST_PAUSE; } -/* - * cleanup() - performs all the ONE TIME cleanup for this test at completion - * or premature exit. - */ -void cleanup(void) +static void cleanup(void) { - /* - * print timing stats if that option was specified. - * print errno log if that option was specified. - */ TEST_CLEANUP; - } diff --git a/testcases/kernel/syscalls/getitimer/getitimer02.c b/testcases/kernel/syscalls/getitimer/getitimer02.c index fcb3d6c..4f87883 100644 --- a/testcases/kernel/syscalls/getitimer/getitimer02.c +++ b/testcases/kernel/syscalls/getitimer/getitimer02.c @@ -1,55 +1,30 @@ /* + * Copyright (c) International Business Machines Corp., 2001 * - * Copyright (c) International Business Machines Corp., 2001 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This program 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 General Public License for more details. * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* - * NAME - * getitimer02.c - * - * DESCRIPTION - * getitimer02 - check that a getitimer() call fails as expected - * with an incorrect second argument. - * - * ALGORITHM - * loop if that option was specified - * call getitimer() with an incorrect second argument. - * check the errno value - * issue a PASS message if we get EFAULT - errno 14 - * otherwise, the tests fails - * issue a FAIL message - * break any remaining tests - * call cleanup - * - * USAGE: <for command-line> - * getitimer02 [-c n] [-e] [-i n] [-I x] [-P x] [-t] - * where, -c n : Run n copies concurrently. - * -e : Turn on errno logging. - * -i n : Execute test n times. - * -I x : Execute test for x seconds. - * -P x : Pause for x seconds between iterations. - * -t : Turn on syscall timing. - * - * HISTORY - * 03/2001 - Written by Wayne Boyer - * - * RESTRICTIONS - * none - */ + HISTORY + 03/2001 - Written by Wayne Boyer + + TEST ITEMS: + Check that a getitimer() call fails as expected + with an incorrect second argument. +*/ + #include "test.h" #include "usctest.h" @@ -62,8 +37,8 @@ int TST_TOTAL = 1; #if !defined(UCLINUX) -void cleanup(void); -void setup(void); +static void cleanup(void); +static void setup(void); int exp_enos[] = { EFAULT, 0 }; @@ -72,23 +47,15 @@ int main(int ac, char **av) int lc; char *msg; - if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) { + msg = parse_opts(ac, av, NULL, NULL); + if (msg != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); - } - - setup(); /* global setup */ - /* The following loop checks looping state if -i option given */ + setup(); for (lc = 0; TEST_LOOPING(lc); lc++) { - /* reset tst_count in case we are looping */ tst_count = 0; - /* - * issue the system call with the TEST() macro - * ITIMER_REAL = 0, ITIMER_VIRTUAL = 1 and ITIMER_PROF = 2 - */ - /* call with a bad address */ TEST(getitimer(ITIMER_REAL, (struct itimerval *)-1)); @@ -118,12 +85,8 @@ int main(int ac, char **av) tst_exit(); } -/* - * setup() - performs all the ONE TIME setup for this test. - */ -void setup(void) +static void setup(void) { - tst_sig(NOFORK, DEF_HANDLER, cleanup); TEST_EXP_ENOS(exp_enos); @@ -131,18 +94,9 @@ void setup(void) TEST_PAUSE; } -/* - * cleanup() - performs all the ONE TIME cleanup for this test at completion - * or premature exit. - */ -void cleanup(void) +static void cleanup(void) { - /* - * print timing stats if that option was specified. - * print errno log if that option was specified. - */ TEST_CLEANUP; - } #else hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-04-24 15:21:39
|
The branch, master, has been updated via db7f4359731c9fab922399fd3d9c929295ab1307 (commit) from 3dfde4d6860c43a5f9e35381d2af3d58272adc8d (commit) - Log ----------------------------------------------------------------- commit db7f4359731c9fab922399fd3d9c929295ab1307 Author: Cyril Hrubis <ch...@su...> Date: Wed Apr 24 16:54:22 2013 +0200 fs/proc01.c: Add known issue. Since 786d7e1612f0b0adb6046f19b906609e4fe8b1ba upstream kernel commit the proc operations on regular files are done via proc_reg_*() proxies so the default errno for unimplemented read on proc file changed to EIO returned from the proxy rather than EINVAL that was previously returned from vfs_read(). The only affected known issue I've found is the '/proc/xen/privcmd' file which makes the testcase fail on certain xen installations. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/fs/proc/proc01.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/testcases/kernel/fs/proc/proc01.c b/testcases/kernel/fs/proc/proc01.c index bfeb216..f2aa483 100644 --- a/testcases/kernel/fs/proc/proc01.c +++ b/testcases/kernel/fs/proc/proc01.c @@ -91,6 +91,7 @@ static const struct mapping known_issues[] = { {"read", "/proc/sal/cmc/event", EAGAIN}, {"read", "/proc/sal/init/event", EAGAIN}, {"read", "/proc/sal/mca/event", EAGAIN}, + {"read", "/proc/xen/privcmd", EIO}, {"read", "/proc/xen/privcmd", EINVAL}, {"read", "/proc/self/mem", EIO}, {"read", "/proc/self/task/[0-9]*/mem", EIO}, hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-04-24 13:21:57
|
The branch, master, has been updated via 3dfde4d6860c43a5f9e35381d2af3d58272adc8d (commit) via 8e9b997658241bac4d56f63f2725a1a9965383a7 (commit) via 8e3afe9b89515df7d4d869853a93826675bfdcde (commit) via 123895c0761d4b20260b367437bdfcb144fc2fe8 (commit) from db02e96d6424303e36b1fba58f35f636e7f7830b (commit) - Log ----------------------------------------------------------------- commit 3dfde4d6860c43a5f9e35381d2af3d58272adc8d Author: Cyril Hrubis <ch...@su...> Date: Wed Apr 24 14:46:03 2013 +0200 openposix/.../mmap/14-1: Fix cleanup. The test wasn't unlinking the temporary file on exit. Signed-off-by: Cyril Hrubis <ch...@su...> commit 8e9b997658241bac4d56f63f2725a1a9965383a7 Author: Cyril Hrubis <ch...@su...> Date: Wed Apr 24 14:22:24 2013 +0200 syscalls/mincore*: Fixes. * Make use of tst_tmpdir() to create temporary files * Add option parsing and looping to mincore02 * Changed mmap() first parameter from 0 to NULL * etc. Signed-off-by: Cyril Hrubis <ch...@su...> commit 8e3afe9b89515df7d4d869853a93826675bfdcde Author: Cyril Hrubis <ch...@su...> Date: Wed Apr 24 13:58:29 2013 +0200 syscalls/micore*: Fix. Remove the UCLINUX ifdefs, add mincore directory into UCLINUX FILTER_OUT_DIRS in syscalls Makefile. Signed-off-by: Cyril Hrubis <ch...@su...> commit 123895c0761d4b20260b367437bdfcb144fc2fe8 Author: Cyril Hrubis <ch...@su...> Date: Wed Apr 24 13:34:46 2013 +0200 syscalls/mincore*: Cleanup. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/syscalls/Makefile | 2 +- testcases/kernel/syscalls/mincore/mincore01.c | 203 ++++++----------- testcases/kernel/syscalls/mincore/mincore02.c | 245 +++++++------------- .../conformance/interfaces/mmap/14-1.c | 1 + 4 files changed, 153 insertions(+), 298 deletions(-) diff --git a/testcases/kernel/syscalls/Makefile b/testcases/kernel/syscalls/Makefile index cee99e9..da7c7fa 100644 --- a/testcases/kernel/syscalls/Makefile +++ b/testcases/kernel/syscalls/Makefile @@ -26,7 +26,7 @@ include $(top_srcdir)/include/mk/env_pre.mk ifeq ($(UCLINUX),1) FILTER_OUT_DIRS += capget capset chmod chown clone fork getcontext llseek \ - nftw profil remap_file_pages + nftw profil remap_file_pages mincore endif include $(top_srcdir)/include/mk/generic_trunk_target.mk diff --git a/testcases/kernel/syscalls/mincore/mincore01.c b/testcases/kernel/syscalls/mincore/mincore01.c index 779c52f..d3519f2 100644 --- a/testcases/kernel/syscalls/mincore/mincore01.c +++ b/testcases/kernel/syscalls/mincore/mincore01.c @@ -1,58 +1,33 @@ /* + * Copyright (c) International Business Machines Corp., 2001 + * Author: Rajeev Tiwari: raj...@in... + * Copyright (c) 2004 Gernot Payer <gp...@su...> + * Copyright (c) 2013 Cyril Hrubis <ch...@su...> * - * Copyright (c) International Business Machines Corp., 2001 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This program 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 General Public License for more details. + * This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* - * NAME - * mincore01.c - * - * DESCRIPTION - * Testcase to check the error conditions for mincore - * - * ALGORITHM - * test1: - * Invoke mincore() when the start address is not multiple of page size. - * EINVAL - * test2: - * Invoke mincore() when the vector points to an invalid address. EFAULT - * test3: - * Invoke mincore() when the starting address + length contained unmapped - * memory. ENOMEM - * - * USAGE: <for command-line> - * mincore01 [-c n] [-e] [-i n] [-I x] [-P x] [-t] - * where, -c n : Run n copies concurrently. - * -e : Turn on errno logging. - * -i n : Execute test n times. - * -I x : Execute test for x seconds. - * -P x : Pause for x seconds between iterations. - * -t : Turn on syscall timing. - * - * HISTORY - * Author: Rajeev Tiwari: raj...@in... - * 08/2004 Rajeev Tiwari : does a basic sanity check for the various error - * conditions possible with the mincore system call. - * - * 2004/09/10 Gernot Payer <gp...@su...> - * code cleanup - *$ - * RESTRICTIONS - * None + * test1: + * Invoke mincore() when the start address is not multiple of page size. + * EINVAL + * test2: + * Invoke mincore() when the vector points to an invalid address. EFAULT + * test3: + * Invoke mincore() when the starting address + length contained unmapped + * memory. ENOMEM */ #include <fcntl.h> @@ -78,25 +53,22 @@ static void setup3(void); char *TCID = "mincore01"; int TST_TOTAL = 3; -static char file_name[] = "fooXXXXXX"; static char *global_pointer = NULL; static unsigned char *global_vec = NULL; static int global_len = 0; -static int file_desc = 0; - -#if !defined(UCLINUX) +static int fd = 0; static struct test_case_t { char *addr; int len; unsigned char *vector; int exp_errno; - void (*setupfunc) (); + void (*setupfunc) (void); } TC[] = { - { - NULL, 0, NULL, EINVAL, setup1}, { - NULL, 0, NULL, EFAULT, setup2}, { -NULL, 0, NULL, ENOMEM, setup3},}; + {NULL, 0, NULL, EINVAL, setup1}, + {NULL, 0, NULL, EFAULT, setup2}, + {NULL, 0, NULL, ENOMEM, setup3}, +}; int main(int ac, char **av) { @@ -104,25 +76,20 @@ int main(int ac, char **av) int i; char *msg; - if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) { + msg = parse_opts(ac, av, NULL, NULL); + if (msg != NULL) tst_brkm(TBROK, cleanup, "error parsing options: %s", msg); - } - setup(); /* global setup */ + setup(); - /* The following loop checks looping state if -i option given */ for (lc = 0; TEST_LOOPING(lc); lc++) { - - /* reset tst_count in case we are looping */ tst_count = 0; - /* loop through the test cases */ for (i = 0; i < TST_TOTAL; i++) { - /* perform test specific setup */ - if (TC[i].setupfunc != NULL) { + if (TC[i].setupfunc != NULL) TC[i].setupfunc(); - } + TEST(mincore(TC[i].addr, TC[i].len, TC[i].vector)); if (TEST_RETURN != -1) { @@ -147,56 +114,42 @@ int main(int ac, char **av) tst_exit(); } -/* - * setup1() - sets up conditions for the first test. the start address is not - * multiple of page size - */ -void setup1() +static void setup1(void) { TC[0].addr = global_pointer + 1; TC[0].len = global_len; TC[0].vector = global_vec; } -/* - * setup2() - sets up conditions for the test 2. the vector points to an - * invalid address. - */ -void setup2() +void setup2(void) { unsigned char *t; struct rlimit limit; + + t = mmap(NULL, global_len, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); /* Create pointer to invalid address */ - if (MAP_FAILED == - (t = - mmap(0, global_len, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS, 0, 0))) { - tst_brkm(TBROK, cleanup, "mmaping anonymous memory failed: %s", - strerror(errno)); + if (t == MAP_FAILED) { + tst_brkm(TBROK | TERRNO, cleanup, + "mmaping anonymous memory failed"); } + munmap(t, global_len); /* set stack limit so that the unmaped pointer is invalid for architectures like s390 */ limit.rlim_cur = STACK_LIMIT; limit.rlim_max = STACK_LIMIT; - if (setrlimit(RLIMIT_STACK, &limit) != 0) { - tst_brkm(TBROK, cleanup, "setrlimit failed: %s", - strerror(errno)); - } + if (setrlimit(RLIMIT_STACK, &limit) != 0) + tst_brkm(TBROK | TERRNO, cleanup, "setrlimit failed"); TC[1].addr = global_pointer; TC[1].len = global_len; TC[1].vector = t; } -/* - * setup3() - performs the setup for test3(the starting address + length - * contained unmapped memory). we give the length of mapped file equal to 5 - * times the mapped file size. - */ -void setup3() +static void setup3(void) { TC[2].addr = global_pointer; TC[2].len = global_len * 2; @@ -204,19 +157,18 @@ void setup3() TC[2].vector = global_vec; } -/* - * setup() - performs all ONE TIME setup for this test - */ -void setup() +static void setup(void) { char *buf; PAGESIZE = getpagesize(); + tst_tmpdir(); + /* global_pointer will point to a mmapped area of global_len bytes */ global_len = PAGESIZE * 2; - buf = (char *)malloc(global_len); + buf = malloc(global_len); memset(buf, 42, global_len); tst_sig(FORK, DEF_HANDLER, cleanup); @@ -224,60 +176,39 @@ void setup() TEST_PAUSE; /* create a temporary file */ - if (-1 == (file_desc = mkstemp(file_name))) { - tst_brkm(TBROK, cleanup, - "Error while creating temporary file: %s", - strerror(errno)); + fd = open("mincore01", O_CREAT | O_RDWR, S_IRUSR | S_IWUSR); + if (fd == -1) { + tst_brkm(TBROK | TERRNO, cleanup, + "Error while creating temporary file"); } /* fill the temporary file with two pages of data */ - if (-1 == write(file_desc, buf, global_len)) { - tst_brkm(TBROK, cleanup, - "Error while writing to temporary file: %s", - strerror(errno)); + if (write(fd, buf, global_len) == -1) { + tst_brkm(TBROK | TERRNO, cleanup, + "Error while writing to temporary file"); } free(buf); /* map the file in memory */ - if (MAP_FAILED == - (global_pointer = - (char *)mmap(NULL, global_len * 2, - PROT_READ | PROT_WRITE | PROT_EXEC, MAP_SHARED, - file_desc, 0))) { - tst_brkm(TBROK, cleanup, - "Temporary file could not be mmapped: %s", - strerror(errno)); + global_pointer = mmap(NULL, global_len * 2, + PROT_READ | PROT_WRITE | PROT_EXEC, MAP_SHARED, + fd, 0); + + if (global_pointer == MAP_FAILED) { + tst_brkm(TBROK | TERRNO, cleanup, + "Temporary file could not be mmapped"); } /* initialize the vector buffer to collect the page info */ global_vec = malloc((global_len + PAGESIZE - 1) / PAGESIZE); } -/* - * cleanup() - performs all the ONE TIME cleanup for this test at completion - * or premature exit. - */ -void cleanup() +static void cleanup(void) { - /* - * print timing status if that option was specified. - * print errno log if that option was specified - */ TEST_CLEANUP; free(global_vec); munmap(global_pointer, global_len); - close(file_desc); - remove(file_name); - -} - -#else - -int main() -{ - tst_resm(TINFO, "test is not available on uClinux"); - tst_exit(); + close(fd); + tst_rmdir(); } - -#endif /* if !defined(UCLINUX) */ diff --git a/testcases/kernel/syscalls/mincore/mincore02.c b/testcases/kernel/syscalls/mincore/mincore02.c index 6b51b69..11eaec6 100644 --- a/testcases/kernel/syscalls/mincore/mincore02.c +++ b/testcases/kernel/syscalls/mincore/mincore02.c @@ -1,49 +1,29 @@ /* + * Copyright (c) International Business Machines Corp., 2001 + * Author: Rajeev Tiwari: raj...@in... + * Copyright (c) 2004 Gernot Payer <gp...@su...> + * Copyright (c) 2013 Cyril Hrubis <ch...@su...> * - * Copyright (c) International Business Machines Corp., 2001 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This program 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 General Public License for more details. * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* - * NAME - * mincore02.c - * - * DESCRIPTION - * Testcase to check the error conditions for mincore - * - * ALGORITHM - * test1: - * This test case provides a functional validation for mincore system call. - * We mmap a file of known size (multiple of page size) and lock it in - * memory. Then we obtain page location information via mincore and compare - * the result with the expected value. - * - * USAGE: <for command-line> - * ./mincore02 - * - * HISTORY - * Author: Rajeev Tiwari: raj...@in... - * 08/2004 Rajeev Tiwari : Provides a functional validation of mincore system call. - * - * 2004/09/10 Gernot Payer <gp...@su...> - * - Original testcase was based on wrong assumptions - * - Major code cleanup - * - * RESTRICTIONS - * None + * This test case provides a functional validation for mincore system call. + * We mmap a file of known size (multiple of page size) and lock it in + * memory. Then we obtain page location information via mincore and compare + * the result with the expected value. */ #include <sys/mman.h> @@ -58,163 +38,106 @@ #include "test.h" #include "usctest.h" -/* comment out if you need to debug */ -/* #define DEBUG_MODE 1 */ - char *TCID = "mincore02"; int TST_TOTAL = 1; -static int file_desc = 0; /* this is for the file descriptor */ -static char *position = NULL; -static int p_size; /* page size obtained via getpagesize() */ -static int num_pages = 4; /* four pages are used in this test */ +static int fd = 0; +static void *addr = NULL; +static int page_size; +static int num_pages = 4; static unsigned char *vec = NULL; -#if !defined(UCLINUX) - -static char tmpfilename[] = "fooXXXXXX"; - -/* Extern Global Functions */ -/******************************************************************************/ -/* */ -/* Function: cleanup */ -/* */ -/* Description: Performs all one time clean up for this test on successful */ -/* completion, premature exit or failure. Closes all temporary */ -/* files, removes all temporary directories exits the test with */ -/* appropriate return code by calling tst_exit() function. */ -/* */ -/* Input: None. */ -/* */ -/* Output: None. */ -/* */ -/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */ -/* On success - Exits calling tst_exit(). With '0' return code. */ -/* */ -/******************************************************************************/ -void cleanup() +static void cleanup(void) { - - /* Close all open file descriptors. */ - free(vec); - munlock(position, p_size * num_pages); - munmap(position, p_size * num_pages); + munlock(addr, page_size * num_pages); + munmap(addr, page_size * num_pages); TEST_CLEANUP; - close(file_desc); - remove(tmpfilename); - + close(fd); + tst_rmdir(); } -/* Local Functions */ -/******************************************************************************/ -/* */ -/* Function: setup */ -/* */ -/* Description: Performs all one time setup for this test. This function is */ -/* typically used to capture signals, create temporary dirs */ -/* and temporary files that may be used in the course of this */ -/* test. */ -/* */ -/* Input: None. */ -/* */ -/* Output: None. */ -/* */ -/* Return: On failure - Exits by calling cleanup(). */ -/* */ -/* */ -/******************************************************************************/ - -void setup() +static void setup(void) { char *buf; - int size; - int status; + size_t size; - if (-1 == (p_size = getpagesize())) { - tst_brkm(TBROK, cleanup, "Unable to get page size: %s", - strerror(errno)); - } + tst_tmpdir(); - size = p_size * num_pages; - buf = (char *)malloc(p_size * num_pages); + page_size = getpagesize(); + if (page_size == -1) + tst_brkm(TBROK | TERRNO, cleanup, "Unable to get page size"); - memset(buf, 42, size); - vec = malloc((size + p_size - 1) / p_size); - - /* create a temporary file to be used */ + size = page_size * num_pages; + buf = malloc(size); - if (-1 == (file_desc = mkstemp(tmpfilename))) { - tst_brkm(TBROK, cleanup, "Unable to create temporary file: %s", - strerror(errno)); + memset(buf, 42, size); + vec = malloc((size + page_size - 1) / page_size); + + fd = open("mincore02", O_CREAT | O_RDWR, S_IRUSR | S_IWUSR); + if (fd == -1) { + tst_brkm(TBROK | TERRNO, cleanup, + "Unable to create temporary file"); } /* fill the temporary file with two pages of data */ - - if (-1 == write(file_desc, buf, size)) { - tst_brkm(TBROK, cleanup, "Error in writing to the file: %s", - strerror(errno)); + if (write(fd, buf, size) < 0) { + tst_brkm(TBROK | TERRNO, cleanup, + "Error in writing to the file"); } free(buf); - /* mmap the file in virtual address space in read , write and execute mode , the mapping should be shared */ + addr = mmap(NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, + MAP_SHARED, fd, 0); - if (MAP_FAILED == - (position = - (char *)mmap(0, size, PROT_READ | PROT_WRITE | PROT_EXEC, - MAP_SHARED, file_desc, 0))) { - tst_brkm(TBROK, cleanup, - "Unable to map file for read/write. Error: %d (%s)", - errno, strerror(errno)); + if (addr == MAP_FAILED) { + tst_brkm(TBROK | TERRNO, cleanup, + "Unable to map file for read/write"); } /* lock mmapped file, so mincore returns "in core" for all pages */ - if ((status = mlock(position, size)) == -1) { - tst_brkm(TBROK, cleanup, "Unable to lock the file: %s", - strerror(errno)); - } - return; + if (mlock(addr, size) == -1) + tst_brkm(TBROK | TERRNO, cleanup, "Unable to lock the file"); } int main(int argc, char **argv) { int lock_pages, counter; + char *msg; + int lc; - setup(); - - if (-1 == mincore((void *)position, num_pages * p_size, vec)) { - tst_brkm(TBROK, cleanup, - "Unable to execute mincore system call: %s", - strerror(errno)); - } - - /* check status of pages */ + msg = parse_opts(argc, argv, NULL, NULL); + if (msg != NULL) + tst_brkm(TBROK, cleanup, "error parsing options: %s", msg); - lock_pages = 0; - - for (counter = 0; counter < num_pages; counter++) { - if (vec[counter] & 1) - lock_pages++; + setup(); + + for (lc = 0; TEST_LOOPING(lc); lc++) { + tst_count = 0; + + if (mincore(addr, num_pages * page_size, vec) == -1) { + tst_brkm(TBROK | TERRNO, cleanup, + "Unable to execute mincore system call"); + } + + /* check status of pages */ + lock_pages = 0; + + for (counter = 0; counter < num_pages; counter++) { + if (vec[counter] & 1) + lock_pages++; + } + + if (lock_pages == num_pages) { + tst_resm(TPASS, "%d pages locked, %d pages in-core", num_pages, + lock_pages); + } else { + tst_resm(TFAIL, + "not all locked pages are in-core: no. locked: %d, no. in-core: %d", + num_pages, lock_pages); + } } - if (lock_pages == num_pages) - tst_resm(TPASS, "%d pages locked, %d pages in-core", num_pages, - lock_pages); - else - tst_resm(TFAIL, - "not all locked pages are in-core: no. locked: %d, no. in-core: %d", - num_pages, lock_pages); - cleanup(); tst_exit(); } - -#else - -int main() -{ - tst_resm(TINFO, "test is not available on uClinux"); - tst_exit(); -} - -#endif /* if !defined(UCLINUX) */ diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/14-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/14-1.c index 8fc8e5d..9431b97 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/14-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/14-1.c @@ -116,6 +116,7 @@ int main(void) munmap(pa, size); close(fd); + unlink(tmpfname); printf("Test PASSED\n"); return PTS_PASS; } hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-04-24 07:24:44
|
The branch, master, has been updated via db02e96d6424303e36b1fba58f35f636e7f7830b (commit) via 633e4acdbebac27a2e8fb5c0eeebd795ef742d9b (commit) via d753c212a8eed4f0fd9af12cf35d878205810549 (commit) from 4758cb19e6ffad42ba3b026938f9f63e85ac6d9f (commit) - Log ----------------------------------------------------------------- commit db02e96d6424303e36b1fba58f35f636e7f7830b Author: Wanlong Gao <gao...@cn...> Date: Wed Apr 24 14:03:21 2013 +0800 syscalls/accept4_01: code cleanups Cleanup the code. Signed-off-by: Wanlong Gao <gao...@cn...> commit 633e4acdbebac27a2e8fb5c0eeebd795ef742d9b Author: Wanlong Gao <gao...@cn...> Date: Wed Apr 24 14:03:21 2013 +0800 syscalls/accept01: code cleanups Cleanup the code. Signed-off-by: Wanlong Gao <gao...@cn...> commit d753c212a8eed4f0fd9af12cf35d878205810549 Author: Wanlong Gao <gao...@cn...> Date: Wed Apr 24 14:03:21 2013 +0800 syscalls/abort01: code cleanups Cleanup the code. Signed-off-by: Wanlong Gao <gao...@cn...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/syscalls/abort/abort01.c | 85 ++++++----------- testcases/kernel/syscalls/accept/accept01.c | 80 +++++++--------- testcases/kernel/syscalls/accept4/accept4_01.c | 122 ++++++------------------ 3 files changed, 97 insertions(+), 190 deletions(-) diff --git a/testcases/kernel/syscalls/abort/abort01.c b/testcases/kernel/syscalls/abort/abort01.c index 369d1a8..f302eed 100644 --- a/testcases/kernel/syscalls/abort/abort01.c +++ b/testcases/kernel/syscalls/abort/abort01.c @@ -1,6 +1,8 @@ /* - * * Copyright (c) International Business Machines Corp., 2002 + * 01/02/2003 Port to LTP av...@us... + * 11/11/2002: Ported to LTP Suite by Ananda + * 06/30/2001 Port to Linux nsh...@us... * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,25 +19,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -/* 01/02/2003 Port to LTP av...@us... */ -/* 06/30/2001 Port to Linux nsh...@us... */ - -/* - * NAME - * abort - * - * CALLS - * abort(3) - * - * ALGORITHM + /* ALGORITHM * Fork child. Have child abort, check return status. * * RESTRICTIONS * The ulimit for core file size must be greater than 0. - * - * CHANGE LOG: - * Nov 11 2002: Ported to LTP Suite by Ananda - * */ #include <sys/types.h> @@ -46,40 +34,18 @@ #include <stdlib.h> #include <unistd.h> -/***** LTP Port *****/ #include "test.h" #include "usctest.h" -#define ITER 3 -#define FAILED 0 -#define PASSED 1 +#define NUM 3 char *TCID = "abort01"; - -int local_flag = PASSED; -int block_number; -FILE *temp; int TST_TOTAL = 1; -void setup(void) -{ - temp = stderr; - tst_tmpdir(); -} - -void cleanup(void) -{ - unlink("core"); - tst_rmdir(); -} +static void setup(void); +static void cleanup(void); +static void do_child(); +static int instress(); -int instress(); -void setup(); -int forkfail(); -void do_child(); - -/*************/ - -/*--------------------------------------------------------------*/ int main(int argc, char *argv[]) { register int i; @@ -89,12 +55,12 @@ int main(int argc, char *argv[]) #ifdef WCOREDUMP int core; - core = 0; #endif ex = sig = 0; - if ((msg = parse_opts(argc, argv, NULL, NULL)) != NULL) + msg = parse_opts(argc, argv, NULL, NULL); + if (msg != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); #ifdef UCLINUX maybe_run_child(&do_child, ""); @@ -102,9 +68,9 @@ int main(int argc, char *argv[]) setup(); - for (i = 0; i < ITER; i++) { - - if ((kidpid = FORK_OR_VFORK()) == 0) { + for (i = 0; i < NUM; i++) { + kidpid = FORK_OR_VFORK(); + if (kidpid == 0) { #ifdef UCLINUX if (self_exec(argv[0], "")) { if (!instress()) { @@ -144,13 +110,13 @@ int main(int argc, char *argv[]) tst_brkm(TFAIL, cleanup, "Child did not dump core; exit code = %d, " "signal = %d", ex, sig); - } else if (core != -1) + } else if (core != -1) { tst_resm(TPASS, "abort dumped core"); + } #endif - - if (sig == SIGIOT) + if (sig == SIGIOT) { tst_resm(TPASS, "abort raised SIGIOT"); - else { + } else { tst_brkm(TFAIL, cleanup, "Child did not raise SIGIOT (%d); exit code = %d, " "signal = %d", SIGIOT, ex, sig); @@ -162,14 +128,25 @@ int main(int argc, char *argv[]) tst_exit(); } -void do_child() +static void setup(void) +{ + tst_tmpdir(); +} + +static void cleanup(void) +{ + unlink("core"); + tst_rmdir(); +} + +static void do_child() { abort(); fprintf(stderr, "\tchild - abort failed.\n"); exit(1); } -int instress() +static int instress() { tst_resm(TINFO, "System resources may be too low; fork(), select() etc are likely to fail."); diff --git a/testcases/kernel/syscalls/accept/accept01.c b/testcases/kernel/syscalls/accept/accept01.c index 453fe00..5d523d4 100644 --- a/testcases/kernel/syscalls/accept/accept01.c +++ b/testcases/kernel/syscalls/accept/accept01.c @@ -1,6 +1,7 @@ /* * * Copyright (c) International Business Machines Corp., 2001 + * 07/2001 Ported by Wayne Boyer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,27 +19,8 @@ */ /* - * Test Name: accept01 - * - * Test Description: + * Description: * Verify that accept() returns the proper errno for various failure cases - * - * Usage: <for command-line> - * accept01 [-c n] [-e] [-f] [-i n] [-I x] [-P x] [-t] - * where, -c n : Run n copies concurrently. - * -e : Turn on errno logging. - * -f : Turn off functionality Testing. - * -i n : Execute test n times. - * -I x : Execute test for x seconds. - * -P x : Pause for x seconds between iterations. - * -t : Turn on syscall timing. - * - * HISTORY - * 07/2001 Ported by Wayne Boyer - * - * RESTRICTIONS: - * None. - * */ #include <stdio.h> @@ -63,8 +45,14 @@ int s; /* socket descriptor */ struct sockaddr_in sin0, fsin1; socklen_t sinlen; -void setup(void), setup0(void), setup1(void), setup2(void), setup3(void), -cleanup(void), cleanup0(void), cleanup1(void); +static void setup(void); +static void cleanup(void); +static void setup0(void); +static void cleanup0(void); +static void setup1(void); +static void cleanup1(void); +static void setup2(void); +static void setup3(void); struct test_case_t { /* test case structure */ int domain; /* PF_INET, PF_UNIX, ... */ @@ -92,12 +80,14 @@ struct test_case_t { /* test case structure */ (socklen_t *) 1, -1, EINVAL, setup1, cleanup1, "invalid salen"}, { PF_INET, SOCK_STREAM, 0, (struct sockaddr *)&fsin1, - &sinlen, -1, EINVAL, setup2, cleanup1, "invalid salen"}, { + &sinlen, -1, EINVAL, setup2, cleanup1, + "invalid salen"}, { PF_INET, SOCK_STREAM, 0, (struct sockaddr *)&fsin1, &sinlen, -1, EINVAL, setup3, cleanup1, "no queued connections"}, { -PF_INET, SOCK_DGRAM, 0, (struct sockaddr *)&fsin1, - &sinlen, -1, EOPNOTSUPP, setup1, cleanup1, "UDP accept"},}; + PF_INET, SOCK_DGRAM, 0, (struct sockaddr *)&fsin1, + &sinlen, -1, EOPNOTSUPP, setup1, cleanup1, + "UDP accept"},}; int TST_TOTAL = sizeof(tdat) / sizeof(tdat[0]); @@ -108,7 +98,8 @@ int main(int ac, char *av[]) int lc; char *msg; - if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) + msg = parse_opts(ac, av, NULL, NULL); + if (msg != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); setup(); @@ -138,11 +129,12 @@ int main(int ac, char *av[]) tdat[testno].cleanup(); } } + cleanup(); tst_exit(); } -void setup(void) +static void setup(void) { TEST_PAUSE; @@ -154,12 +146,12 @@ void setup(void) sin0.sin_addr.s_addr = INADDR_ANY; } -void cleanup(void) +static void cleanup(void) { TEST_CLEANUP; } -void setup0(void) +static void setup0(void) { if (tdat[testno].experrno == EBADF) s = 400; /* anything not an open file */ @@ -167,12 +159,12 @@ void setup0(void) tst_brkm(TBROK | TERRNO, cleanup, "error opening /dev/null"); } -void cleanup0(void) +static void cleanup0(void) { s = -1; } -void setup1(void) +static void setup1(void) { s = socket(tdat[testno].domain, tdat[testno].type, tdat[testno].proto); if (s < 0) { @@ -186,25 +178,25 @@ void setup1(void) sinlen = sizeof(fsin1); } -void setup3(void) -{ - int one = 1; - - setup1(); - if (ioctl(s, FIONBIO, &one) < 0) { - tst_brkm(TBROK, cleanup, "socket ioctl failed for accept " - "test %d: %s", testno, strerror(errno)); - } -} - -void cleanup1(void) +static void cleanup1(void) { (void)close(s); s = -1; } -void setup2(void) +static void setup2(void) { setup1(); /* get a socket in s */ sinlen = 1; /* invalid s */ } + +static void setup3(void) +{ + int one = 1; + + setup1(); + if (ioctl(s, FIONBIO, &one) < 0) { + tst_brkm(TBROK, cleanup, "socket ioctl failed for accept " + "test %d: %s", testno, strerror(errno)); + } +} diff --git a/testcases/kernel/syscalls/accept4/accept4_01.c b/testcases/kernel/syscalls/accept4/accept4_01.c index 6e6f017..2629b1f 100644 --- a/testcases/kernel/syscalls/accept4/accept4_01.c +++ b/testcases/kernel/syscalls/accept4/accept4_01.c @@ -1,42 +1,24 @@ -/******************************************************************************/ -/* */ -/* Copyright (C) 2008, Linux Foundation, */ -/* written by Michael Kerrisk <mtk...@gm...> */ -/* */ -/* Licensed under the GNU GPLv2 or later. */ -/* This program is free software; you can redistribute it and/or modify */ -/* it under the terms of the GNU General Public License as published by */ -/* the Free Software Foundation; either version 2 of the License, or */ -/* (at your option) any later version. */ -/* */ -/* This program 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 General Public License for more details. */ -/* */ -/* You should have received a copy of the GNU General Public License */ -/* along with this program; if not, write to the Free Software */ -/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -/* */ -/******************************************************************************/ - -/******************************************************************************/ -/* */ -/* File: accept4_01.c */ -/* */ -/* Description: This will test the newly introduced syscall accept4() */ -/* */ -/* Total Tests: 4 */ -/* */ -/* Test Name: accept4_01 */ -/* */ -/* Author: Michael Kerrisk <mtk...@gm...> */ -/* */ -/* History: Created - Nov 17 2008 - Michael <mtk...@gm...> */ -/* Initial Porting to LTP */ -/* - Nov 17 2008 - Subrata <su...@li...> */ -/* */ -/******************************************************************************/ +/* + * + * Copyright (C) 2008, Linux Foundation, + * written by Michael Kerrisk <mtk...@gm...> + * Initial Porting to LTP by Subrata <su...@li...> + * + * Licensed under the GNU GPLv2 or later. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ #define _GNU_SOURCE #include <unistd.h> @@ -58,7 +40,6 @@ #define die(msg) tst_brkm(TBROK|TERRNO, cleanup, msg) -/**********************************************************************/ /* The following is what we need until glibc gets a wrapper for accept4() */ @@ -82,62 +63,21 @@ char *TCID = "accept04_01"; int TST_TOTAL = 1; -/* Extern Global Functions */ -/******************************************************************************/ -/* */ -/* Function: cleanup */ -/* */ -/* Description: Performs all one time clean up for this test on successful */ -/* completion, premature exit or failure. Closes all temporary */ -/* files, removes all temporary directories exits the test with */ -/* appropriate return code by calling tst_exit() function. */ -/* */ -/* Input: None. */ -/* */ -/* Output: None. */ -/* */ -/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */ -/* On success - Exits calling tst_exit(). With '0' return code. */ -/* */ -/******************************************************************************/ -/* We would need this for many more reasons in future */ -extern void cleanup() +static void setup(void) { - - TEST_CLEANUP; - tst_rmdir(); - + TEST_PAUSE; + tst_tmpdir(); } -/* Local Functions */ -/******************************************************************************/ -/* */ -/* Function: setup */ -/* */ -/* Description: Performs all one time setup for this test. This function is */ -/* typically used to capture signals, create temporary dirs */ -/* and temporary files that may be used in the course of this */ -/* test. */ -/* */ -/* Input: None. */ -/* */ -/* Output: None. */ -/* */ -/* Return: On failure - Exits by calling cleanup(). */ -/* On success - returns 0. */ -/* */ -/******************************************************************************/ -void setup() +static void cleanup(void) { - /* Capture signals if any */ - /* Create temporary directories */ - TEST_PAUSE; - tst_tmpdir(); + TEST_CLEANUP; + tst_rmdir(); } -#if !(__GLIBC_PREREQ(2,10)) +#if !(__GLIBC_PREREQ(2, 10)) static int -accept4_01(int fd, struct sockaddr *sockaddr, socklen_t * addrlen, int flags) +accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags) { #ifdef DEBUG tst_resm(TINFO, "Calling accept4(): flags = %x", flags); @@ -169,8 +109,6 @@ accept4_01(int fd, struct sockaddr *sockaddr, socklen_t * addrlen, int flags) } #endif -/**********************************************************************/ - static void do_test(int lfd, struct sockaddr_in *conn_addr, int closeonexec_flag, int nonblock_flag) @@ -192,7 +130,7 @@ do_test(int lfd, struct sockaddr_in *conn_addr, die("Connect Error"); addrlen = sizeof(struct sockaddr_in); -#if !(__GLIBC_PREREQ(2,10)) +#if !(__GLIBC_PREREQ(2, 10)) acceptfd = accept4_01(lfd, (struct sockaddr *)&claddr, &addrlen, closeonexec_flag | nonblock_flag); #else hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-04-23 19:21:21
|
The branch, master, has been updated via 4758cb19e6ffad42ba3b026938f9f63e85ac6d9f (commit) via d354733e75178bc1a33a91eff075dfecaf2dce57 (commit) from 738f74ec1a67ec9522508969a72e3e9f2d19b9f8 (commit) - Log ----------------------------------------------------------------- commit 4758cb19e6ffad42ba3b026938f9f63e85ac6d9f Author: Cyril Hrubis <ch...@su...> Date: Tue Apr 23 20:41:01 2013 +0200 syscalls/dup06: Fixes. The testcases had several problems: * Wasn't using tst_tmpdir() and created files in CWD * The test wasn't closing the filedescriptors and so the test has failed on second and any other run (-i or -I) * The fail flag was set only once at the start and not reset along the way, so after one failure the rest of the tests would be marked as failed * etc. Signed-off-by: Cyril Hrubis <ch...@su...> commit d354733e75178bc1a33a91eff075dfecaf2dce57 Author: Cyril Hrubis <ch...@su...> Date: Tue Apr 23 19:11:59 2013 +0200 syscalls/dup07: Fixes. The testcases had several problems: * Wasn't using tst_tmpdir() and created files in CWD * The main loop contained tst_exit() and because of that options as -i and -I weren't working at all * The fail flag was set only once at the start and not reset along the way, so after one failure the rest of the tests would be marked as failed * etc. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/syscalls/dup/dup06.c | 90 +++++++++++++-------------- testcases/kernel/syscalls/dup/dup07.c | 108 ++++++++++++-------------------- 2 files changed, 85 insertions(+), 113 deletions(-) diff --git a/testcases/kernel/syscalls/dup/dup06.c b/testcases/kernel/syscalls/dup/dup06.c index f9cbaa9..44d5b43 100644 --- a/testcases/kernel/syscalls/dup/dup06.c +++ b/testcases/kernel/syscalls/dup/dup06.c @@ -1,6 +1,7 @@ /* - * * Copyright (c) International Business Machines Corp., 2002 + * ported from SPIE, section2/iosuite/dup1.c, by Airong Zhang + * Copyright (c) 2013 Cyril Hrubis <ch...@su...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,17 +18,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -/* Pored from SPIE, section2/iosuite/dup1.c, by Airong Zhang */ - -/*====================================================================== - =================== TESTPLAN SEGMENT =================== ->KEYS: < dup() ->WHAT: < Does dup return -1 on the 21st file? ->HOW: < Create up to _NFILE (20) files and check for -1 return on the - < next attempt - < Should check NOFILE as well as _NFILE. 19-Jun-84 Dale. ->BUGS: < -======================================================================*/ +/* + WHAT: Does dup return -1 on the 21st file? + HOW: Create up to _NFILE (20) files and check for -1 return on the + next attempt + Should check NOFILE as well as _NFILE. 19-Jun-84 Dale. +*/ #include <stdio.h> #include <fcntl.h> @@ -41,12 +37,8 @@ char *TCID = "dup06"; int TST_TOTAL = 1; -int local_flag; -#define PASSED 1 -#define FAILED 0 - -int cnt_free_fds(int maxfd) +static int cnt_free_fds(int maxfd) { int freefds = 0; @@ -57,63 +49,69 @@ int cnt_free_fds(int maxfd) return (freefds); } +static void setup(void); +static void cleanup(void); + int main(int ac, char **av) { - int *fildes, j; - int ifile; - char pfilname[40]; + int *fildes, i; int min; int freefds; int lc; char *msg; - - ifile = -1; + const char *pfilname = "dup06"; if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); + setup(); + min = getdtablesize(); freefds = cnt_free_fds(min); - fildes = (int *)malloc((min + 5) * sizeof(int)); - local_flag = PASSED; - - for (lc = 0; TEST_LOOPING(lc); lc++) { + fildes = malloc((min + 5) * sizeof(int)); - for (j = 0; j < min + 5; j++) - fildes[j] = 0; + for (i = 0; i < min + 5; i++) + fildes[i] = 0; - sprintf(pfilname, "dup06.%d\n", getpid()); + for (lc = 0; TEST_LOOPING(lc); lc++) { unlink(pfilname); + if ((fildes[0] = creat(pfilname, 0666)) == -1) { tst_resm(TFAIL, "Cannot open first file"); - local_flag = FAILED; } else { - for (ifile = 1; ifile < min + 5; ifile++) { - if ((fildes[ifile] = - dup(fildes[ifile - 1])) == -1) { + for (i = 1; i < min + 5; i++) { + if ((fildes[i] = dup(fildes[i - 1])) == -1) break; - } - } - if (ifile < freefds) { + if (i < freefds) { tst_resm(TFAIL, "Not enough files duped"); - local_flag = FAILED; - } else if (ifile > freefds) { + } else if (i > freefds) { tst_resm(TFAIL, "Too many files duped"); - local_flag = FAILED; + } else { + tst_resm(TPASS, "Test passed."); } } - unlink(pfilname); - if (ifile > 0) - close(fildes[ifile - 1]); + unlink(pfilname); - if (local_flag == PASSED) - tst_resm(TPASS, "Test passed."); - else - tst_resm(TFAIL, "Test failed."); + for (i = 0; i < min + 5; i++) { + if (fildes[i] != 0 && fildes[i] != -1) + close(fildes[i]); + fildes[i] = 0; + } } + + cleanup(); tst_exit(); +} +static void setup(void) +{ + tst_tmpdir(); +} + +static void cleanup(void) +{ + tst_rmdir(); } diff --git a/testcases/kernel/syscalls/dup/dup07.c b/testcases/kernel/syscalls/dup/dup07.c index c9ddaf0..03b0ba4 100644 --- a/testcases/kernel/syscalls/dup/dup07.c +++ b/testcases/kernel/syscalls/dup/dup07.c @@ -1,6 +1,8 @@ /* * * Copyright (c) International Business Machines Corp., 2002 + * ported from SPIE, section2/iosuite/dup3.c, by Airong Zhang + * Copyright (c) 2013 Cyril Hrubis <ch...@su...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,20 +19,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -/* Pored from SPIE, section2/iosuite/dup3.c, by Airong Zhang */ - - /*dup3.c */ -/*====================================================================== - =================== TESTPLAN SEGMENT =================== ->KEYS: < dup() ->WHAT: < Is the access mode the same for both file descriptors? - < 0: read only? - < 1: write only? - < 2: read/write? ->HOW: < Creat a file with each access mode; dup each file descriptor; - < stat each file descriptor and compare mode of each pair ->BUGS: < -======================================================================*/ +/* + WHAT: Is the access mode the same for both file descriptors? + 0: read only? + 1: write only? + 2: read/write? + HOW: Creat a file with each access mode; dup each file descriptor; + stat each file descriptor and compare mode of each pair +*/ #include <stdio.h> #include <fcntl.h> @@ -42,15 +38,13 @@ #include "usctest.h" char *TCID = "dup07"; -int TST_TOTAL = 1; -int local_flag; +int TST_TOTAL = 3; -#define PASSED 1 -#define FAILED 0 +static const char *testfile = "dup07"; -char testfile[40] = ""; +static void setup(void); +static void cleanup(void); -/*--------------------------------------------------------------------*/ int main(int ac, char **av) { struct stat retbuf; @@ -58,107 +52,87 @@ int main(int ac, char **av) int rdoret, wroret, rdwret; int duprdo, dupwro, duprdwr; -/*--------------------------------------------------------------------*/ - int lc; char *msg; - /* - * parse standard options - */ - if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) { - tst_resm(TBROK, "OPTION PARSING ERROR - %s", msg); - tst_exit(); - } + if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) + tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); - local_flag = PASSED; + setup(); for (lc = 0; TEST_LOOPING(lc); lc++) { - sprintf(testfile, "dup07.%d", getpid()); if ((rdoret = creat(testfile, 0444)) == -1) { tst_resm(TFAIL, "Unable to creat file '%s'", testfile); - local_flag = FAILED; } else { if ((duprdo = dup(rdoret)) == -1) { tst_resm(TFAIL, "Unable to dup '%s'", testfile); - local_flag = FAILED; } else { fstat(rdoret, &retbuf); fstat(duprdo, &dupbuf); if (retbuf.st_mode != dupbuf.st_mode) { tst_resm(TFAIL, "rdonly and dup do not match"); - local_flag = FAILED; + } else { + tst_resm(TPASS, + "Passed in read mode."); } } } - if (local_flag == PASSED) { - tst_resm(TPASS, "Test passed in read mode."); - } else { - tst_resm(TFAIL, "Test failed in read mode."); - } - -/*--------------------------------------------------------------------*/ unlink(testfile); + if ((wroret = creat(testfile, 0222)) == -1) { tst_resm(TFAIL, "Unable to creat file '%s'", testfile); - local_flag = FAILED; } else { if ((dupwro = dup(wroret)) == -1) { tst_resm(TFAIL, "Unable to dup '%s'", testfile); - local_flag = FAILED; } else { fstat(wroret, &retbuf); fstat(dupwro, &dupbuf); if (retbuf.st_mode != dupbuf.st_mode) { tst_resm(TFAIL, "wronly and dup do not match"); - local_flag = FAILED; + } else { + tst_resm(TPASS, + "Passed in write mode."); } } } - if (local_flag == PASSED) { - tst_resm(TPASS, "Test passed in write mode."); - } else { - tst_resm(TFAIL, "Test failed in write mode."); - } -/*--------------------------------------------------------------------*/ unlink(testfile); + if ((rdwret = creat(testfile, 0666)) == -1) { tst_resm(TFAIL, "Unable to creat file '%s'", testfile); - local_flag = FAILED; } else { if ((duprdwr = dup(rdwret)) == -1) { tst_resm(TFAIL, "Unable to dup '%s'", testfile); - local_flag = FAILED; } else { fstat(rdwret, &retbuf); fstat(duprdwr, &dupbuf); if (retbuf.st_mode != dupbuf.st_mode) { tst_resm(TFAIL, "rdwr and dup do not match"); - local_flag = FAILED; + } else { + tst_resm(TPASS, + "Passed in read/write mode."); } } } - if (local_flag == PASSED) { - tst_resm(TPASS, "Test passed in read/write mode."); - } else { - tst_resm(TFAIL, "Test failed in read/write mode."); - } -/*--------------------------------------------------------------------*/ + unlink(testfile); + } - if (local_flag == PASSED) { - tst_resm(TPASS, "Test passed"); - } else { - tst_resm(TFAIL, "Test failed"); - } - - tst_exit(); - } /* end for */ + cleanup(); tst_exit(); } + +static void setup(void) +{ + tst_tmpdir(); +} + +static void cleanup(void) +{ + tst_rmdir(); +} hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-04-23 14:21:23
|
The branch, master, has been updated via 738f74ec1a67ec9522508969a72e3e9f2d19b9f8 (commit) from 3a48c063457d2bc61605fdcfc9f30a228b2b19c0 (commit) - Log ----------------------------------------------------------------- commit 738f74ec1a67ec9522508969a72e3e9f2d19b9f8 Author: Jan Stancek <jst...@re...> Date: Tue Apr 23 10:25:37 2013 +0200 sendmsg02: fix compilation on kernel < 2.6.27 Using SOCK_CLOEXEC and SOCK_NONBLOCK breaks compilation on older distros/kernels. These were originally taken from systemd sources, but as it turns out they are not needed to trigger this issue. I confirmed, that issue can still be reproduced on 3.8 kernel and that testcase can be compiled at least back to RHEL5.3 (2.6.18). Reported-by: DAN LI <li...@cn...> Signed-off-by: Jan Stancek <jst...@re...> Acked-by: Wanlong Gao <gao...@cn...> Acked-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/syscalls/sendmsg/sendmsg02.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/testcases/kernel/syscalls/sendmsg/sendmsg02.c b/testcases/kernel/syscalls/sendmsg/sendmsg02.c index 8f38f2c..c38d438 100644 --- a/testcases/kernel/syscalls/sendmsg/sendmsg02.c +++ b/testcases/kernel/syscalls/sendmsg/sendmsg02.c @@ -88,7 +88,7 @@ static void client(int id, int pipefd[]) mh.msg_iovlen = 1; do { - fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0); + fd = socket(AF_UNIX, SOCK_DGRAM, 0); write(pipefd[1], &fd, 1); sendmsg(fd, &mh, MSG_NOSIGNAL); close(fd); @@ -109,7 +109,7 @@ static void server(int id, int pipefd[]) snprintf(sa.sun_path, sizeof(sa.sun_path), "socket_test%d", id); do { - fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0); + fd = socket(AF_UNIX, SOCK_DGRAM, 0); unlink(sa.sun_path); bind(fd, (struct sockaddr *) &sa, sizeof(struct sockaddr_un)); read(pipefd[0], &fd, 1); hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-04-23 13:21:55
|
The branch, master, has been updated via 3a48c063457d2bc61605fdcfc9f30a228b2b19c0 (commit) from e0963391fb346daa313316a5d4daacf0c9a0b5ff (commit) - Log ----------------------------------------------------------------- commit 3a48c063457d2bc61605fdcfc9f30a228b2b19c0 Author: Cyril Hrubis <ch...@su...> Date: Mon Apr 22 21:15:14 2013 +0200 openposix: generate-makefiles.sh: Change test names. This commit changes the script that generates openposix Makefiles so that resulting binaries are prefixed with the directory name, i.e. 1-2.run-test becomes sigaction_1-2.run-test. Shell (*.sh) testcases are copied in the build process, i.e. 10-1.sh becomes sigaction_10-1.sh. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: .../scripts/generate-makefiles.sh | 42 +++++++++++++++----- 1 files changed, 32 insertions(+), 10 deletions(-) diff --git a/testcases/open_posix_testsuite/scripts/generate-makefiles.sh b/testcases/open_posix_testsuite/scripts/generate-makefiles.sh index 7d47985..5a1b175 100755 --- a/testcases/open_posix_testsuite/scripts/generate-makefiles.sh +++ b/testcases/open_posix_testsuite/scripts/generate-makefiles.sh @@ -32,7 +32,8 @@ generate_locate_test_makefile() { generate_makefile() { - local make_target_prereq_cache= + local make_rule_prereq_cache= + local make_copy_prereq_cache= local prereq_cache= local tests= @@ -43,6 +44,8 @@ generate_makefile() { prereq_cache=$* + test_prefix=$(basename "$prereq_dir") + # Add all source files to $make_target_prereq_cache. for prereq in $prereq_cache; do # Stuff that needs to be tested. @@ -50,18 +53,25 @@ generate_makefile() { if [ "$tests" != "" ]; then tests="$tests " fi - tests="$tests$prereq" + + tests="$tests${test_prefix}_$prereq" fi + # Stuff that needs to be compiled. case "$prereq" in *.sh) - # Catch. + # Note that the sh scripts are copied later in order to + # have the test_prefix as well + if [ "$make_copy_prereq_cache" != "" ]; then + make_copy_prereq_cache="$make_copy_prereq_cache " + fi + make_copy_prereq_cache="$make_copy_prereq_cache$prereq" ;; *) - if [ "$make_target_prereq_cache" != "" ]; then - make_target_prereq_cache="$make_target_prereq_cache " + if [ "$make_rule_prereq_cache" != "" ]; then + make_rule_prereq_cache="$make_rule_prereq_cache " fi - make_target_prereq_cache="$make_target_prereq_cache$prereq" + make_rule_prereq_cache="$make_rule_prereq_cache$prereq" ;; esac done @@ -122,7 +132,7 @@ EOF cat >> "$makefile.2" <<EOF INSTALL_TARGETS+= ${tests} -MAKE_TARGETS+= ${make_target_prereq_cache} +MAKE_TARGETS+= ${tests} EOF @@ -166,13 +176,15 @@ EOF fi # Produce _awesome_ target rules for everything that needs it. - for prereq in ${make_target_prereq_cache}; do + for prereq in ${make_rule_prereq_cache}; do test_name="$prereq" if [ "$suffix" != "" ]; then test_name=`echo "$test_name" | sed -e "s,$suffix,,"` fi + c_file="$test_name.c" + bin_file="${test_prefix}_$prereq" case "$suffix" in .run-test) @@ -186,7 +198,7 @@ EOF COMPILE_STR="\$(CC) $compiler_args \$(CFLAGS) \$(LDFLAGS) -o \$@ \$(srcdir)/$c_file \$(LDLIBS)" cat >> "$makefile.3" <<EOF -$prereq: \$(srcdir)/$c_file +$bin_file: \$(srcdir)/$c_file @if $COMPILE_STR > logfile.\$\$\$\$ 2>&1; then \\ cat logfile.\$\$\$\$; \\ echo "\$(subdir)/$test_name compile PASSED"; \\ @@ -199,9 +211,19 @@ $prereq: \$(srcdir)/$c_file rm -f logfile.\$\$\$\$ EOF - done + # Produce copy rules for .sh scripts. + for prereq in ${make_copy_prereq_cache}; do + src="$prereq" + dst="${test_prefix}_$prereq" + + cat >> "$makefile.3" <<EOF +$dst: \$(srcdir)/$src + @cp \$< \$@ + +EOF + done } generate_makefiles() { hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-04-23 08:22:35
|
The branch, master, has been updated via e0963391fb346daa313316a5d4daacf0c9a0b5ff (commit) from 41f5eb7679e7847cef987e7dc7c37d47a1403b26 (commit) - Log ----------------------------------------------------------------- commit e0963391fb346daa313316a5d4daacf0c9a0b5ff Author: Zhouping Liu <zl...@re...> Date: Tue Apr 23 15:12:55 2013 +0800 lib/mem: removed read_file() and write_file() SAFE_FILE_SCANF() and SAFE_FILE_PRINTF() can completely displace read_file() and write_file(), so removed them. Signed-off-by: Zhouping Liu <zl...@re...> Reviewed-by: Wanlong Gao <gao...@cn...> Reviewed-by: Caspar Zhang <ca...@ca...> Signed-off-by: Wanlong Gao <gao...@cn...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/mem/cpuset/cpuset01.c | 3 +- .../kernel/mem/hugetlb/hugeshmget/hugeshmget03.c | 11 +-- testcases/kernel/mem/include/mem.h | 3 +- testcases/kernel/mem/lib/mem.c | 93 ++++++-------------- testcases/kernel/mem/oom/oom03.c | 11 +-- testcases/kernel/mem/oom/oom05.c | 6 +- 6 files changed, 41 insertions(+), 86 deletions(-) diff --git a/testcases/kernel/mem/cpuset/cpuset01.c b/testcases/kernel/mem/cpuset/cpuset01.c index 99fbb9c..abba489 100644 --- a/testcases/kernel/mem/cpuset/cpuset01.c +++ b/testcases/kernel/mem/cpuset/cpuset01.c @@ -100,8 +100,7 @@ static void testcpuset(void) write_cpuset_files(CPATH_NEW, "cpus", buf); read_cpuset_files(CPATH, "mems", mems); write_cpuset_files(CPATH_NEW, "mems", mems); - snprintf(buf, BUFSIZ, "%d", getpid()); - write_file(CPATH_NEW "/tasks", buf); + SAFE_FILE_PRINTF(cleanup, CPATH_NEW "/tasks", "%d", getpid()); switch (child = fork()) { case -1: diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c index 3898618..8cf5cc6 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c +++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c @@ -113,7 +113,6 @@ int main(int ac, char **av) void setup(void) { long hpage_size; - char buf[BUFSIZ]; tst_require_root(NULL); tst_sig(NOFORK, DEF_HANDLER, cleanup); @@ -125,10 +124,8 @@ void setup(void) shm_size = hpage_size; - read_file(PATH_SHMMNI, buf); - orig_shmmni = SAFE_STRTOL(cleanup, buf, 0, LONG_MAX); - snprintf(buf, BUFSIZ, "%ld", hugepages / 2); - write_file(PATH_SHMMNI, buf); + SAFE_FILE_SCANF(NULL, PATH_SHMMNI, "%ld", &orig_shmmni); + SAFE_FILE_PRINTF(NULL, PATH_SHMMNI, "%ld", hugepages / 2); /* * Use a while loop to create the maximum number of memory segments. @@ -156,15 +153,13 @@ void setup(void) void cleanup(void) { int i; - char buf[BUFSIZ]; TEST_CLEANUP; for (i = 0; i < num_shms; i++) rm_shm(shm_id_arr[i]); - snprintf(buf, BUFSIZ, "%ld", orig_shmmni); - write_file(PATH_SHMMNI, buf); + SAFE_FILE_PRINTF(NULL, PATH_SHMMNI, "%ld", orig_shmmni); set_sys_tune("nr_hugepages", orig_hugepages, 0); tst_rmdir(); diff --git a/testcases/kernel/mem/include/mem.h b/testcases/kernel/mem/include/mem.h index 9e96b31..551c73e 100644 --- a/testcases/kernel/mem/include/mem.h +++ b/testcases/kernel/mem/include/mem.h @@ -67,6 +67,7 @@ void ksm_usage(void); #define CPATH_NEW CPATH "/1" #define MEMCG_PATH "/dev/cgroup" #define MEMCG_PATH_NEW MEMCG_PATH "/1" +#define MEMCG_LIMIT MEMCG_PATH_NEW "/memory.limit_in_bytes" #define MEMCG_SW_LIMIT MEMCG_PATH_NEW "/memory.memsw.limit_in_bytes" #if HAVE_SYS_EVENTFD_H #define PATH_OOMCTRL MEMCG_PATH_NEW "/memory.oom_control" @@ -85,8 +86,6 @@ int path_exist(const char *path, ...); long read_meminfo(char *item); void set_sys_tune(char *sys_file, long tune, int check); long get_sys_tune(char *sys_file); -void write_file(char *filename, char *buf); -void read_file(char *filename, char *retbuf); void cleanup(void); void setup(void); diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c index da98552..5397177 100644 --- a/testcases/kernel/mem/lib/mem.c +++ b/testcases/kernel/mem/lib/mem.c @@ -157,13 +157,11 @@ void testoom(int mempolicy, int lite) static void check(char *path, long int value) { - FILE *fp; - char buf[BUFSIZ], fullpath[BUFSIZ]; + char fullpath[BUFSIZ]; long actual_val; - snprintf(fullpath, BUFSIZ, "%s%s", PATH_KSM, path); - read_file(fullpath, buf); - actual_val = SAFE_STRTOL(cleanup, buf, 0, LONG_MAX); + snprintf(fullpath, BUFSIZ, PATH_KSM "%s", path); + SAFE_FILE_SCANF(cleanup, fullpath, "%ld", &actual_val); tst_resm(TINFO, "%s is %ld.", path, actual_val); if (actual_val != value) @@ -172,7 +170,6 @@ static void check(char *path, long int value) static void wait_ksmd_done(void) { - char buf[BUFSIZ]; long pages_shared, pages_sharing, pages_volatile, pages_unshared; long old_pages_shared = 0, old_pages_sharing = 0; long old_pages_volatile = 0, old_pages_unshared = 0; @@ -182,17 +179,17 @@ static void wait_ksmd_done(void) sleep(10); count++; - read_file(PATH_KSM "pages_shared", buf); - pages_shared = SAFE_STRTOL(cleanup, buf, 0, LONG_MAX); + SAFE_FILE_SCANF(cleanup, PATH_KSM "pages_shared", + "%ld", &pages_shared); - read_file(PATH_KSM "pages_sharing", buf); - pages_sharing = SAFE_STRTOL(cleanup, buf, 0, LONG_MAX); + SAFE_FILE_SCANF(cleanup, PATH_KSM "pages_sharing", + "%ld", &pages_sharing); - read_file(PATH_KSM "pages_volatile", buf); - pages_volatile = SAFE_STRTOL(cleanup, buf, 0, LONG_MAX); + SAFE_FILE_SCANF(cleanup, PATH_KSM "pages_volatile", + "%ld", &pages_volatile); - read_file(PATH_KSM "pages_unshared", buf); - pages_unshared = SAFE_STRTOL(cleanup, buf, 0, LONG_MAX); + SAFE_FILE_SCANF(cleanup, PATH_KSM "pages_unshared", + "%ld", &pages_unshared); if (pages_shared != old_pages_shared || pages_sharing != old_pages_sharing || @@ -254,13 +251,9 @@ static void verify(char **memory, char value, int proc, void write_memcg(void) { - char buf[BUFSIZ], mem[BUFSIZ]; - - snprintf(mem, BUFSIZ, "%ld", TESTMEM); - write_file(MEMCG_PATH_NEW "/memory.limit_in_bytes", mem); + SAFE_FILE_PRINTF(NULL, MEMCG_LIMIT, "%ld", TESTMEM); - snprintf(buf, BUFSIZ, "%d", getpid()); - write_file(MEMCG_PATH_NEW "/tasks", buf); + SAFE_FILE_PRINTF(NULL, MEMCG_PATH_NEW "/tasks", "%d", getpid()); } static struct ksm_merge_data { @@ -377,7 +370,6 @@ static void resume_ksm_children(int *child, int num) void create_same_memory(int size, int num, int unit) { - char buf[BUFSIZ]; int i, j, status, *child; unsigned long ps, pages; struct ksm_merge_data **ksm_data; @@ -437,10 +429,10 @@ void create_same_memory(int size, int num, int unit) stop_ksm_children(child, num); tst_resm(TINFO, "KSM merging..."); - write_file(PATH_KSM "run", "1"); - snprintf(buf, BUFSIZ, "%ld", size * pages * num); - write_file(PATH_KSM "pages_to_scan", buf); - write_file(PATH_KSM "sleep_millisecs", "0"); + SAFE_FILE_PRINTF(cleanup, PATH_KSM "run", "1"); + SAFE_FILE_PRINTF(cleanup, PATH_KSM "pages_to_scan", "%ld", + size * pages *num); + SAFE_FILE_PRINTF(cleanup, PATH_KSM "sleep_millisecs", "0"); resume_ksm_children(child, num); group_check(1, 2, size * num * pages - 2, 0, 0, 0, size * pages * num); @@ -460,13 +452,13 @@ void create_same_memory(int size, int num, int unit) stop_ksm_children(child, num); tst_resm(TINFO, "KSM unmerging..."); - write_file(PATH_KSM "run", "2"); + SAFE_FILE_PRINTF(cleanup, PATH_KSM "run", "2"); resume_ksm_children(child, num); group_check(2, 0, 0, 0, 0, 0, size * pages * num); tst_resm(TINFO, "stop KSM."); - write_file(PATH_KSM "run", "0"); + SAFE_FILE_PRINTF(cleanup, PATH_KSM "run", "0"); group_check(0, 0, 0, 0, 0, 0, size * pages * num); while (waitpid(-1, &status, WUNTRACED | WCONTINUED) > 0) @@ -624,7 +616,6 @@ void test_transparent_hugepage(int nr_children, int nr_thps, { unsigned long hugepagesize, memfree; int i, *pids, ret, status; - char path[BUFSIZ]; if (mempolicy) set_global_mempolicy(mempolicy); @@ -803,8 +794,7 @@ void write_cpusets(long nd) gather_node_cpus(cpus, nd); write_cpuset_files(CPATH_NEW, "cpus", cpus); - snprintf(buf, BUFSIZ, "%d", getpid()); - write_file(CPATH_NEW "/tasks", buf); + SAFE_FILE_PRINTF(NULL, CPATH_NEW "/tasks", "%d", getpid()); } void umount_mem(char *path, char *path_new) @@ -932,13 +922,12 @@ long read_meminfo(char *item) void set_sys_tune(char *sys_file, long tune, int check) { long val; - char buf[BUFSIZ], path[BUFSIZ]; + char path[BUFSIZ]; tst_resm(TINFO, "set %s to %ld", sys_file, tune); - snprintf(path, BUFSIZ, "%s%s", PATH_SYSVM, sys_file); - snprintf(buf, BUFSIZ, "%ld", tune); - write_file(path, buf); + snprintf(path, BUFSIZ, PATH_SYSVM "%s", sys_file); + SAFE_FILE_PRINTF(NULL, path, "%ld", tune); if (check) { val = get_sys_tune(sys_file); @@ -950,44 +939,20 @@ void set_sys_tune(char *sys_file, long tune, int check) long get_sys_tune(char *sys_file) { - char buf[BUFSIZ], path[BUFSIZ]; - - snprintf(path, BUFSIZ, "%s%s", PATH_SYSVM, sys_file); - read_file(path, buf); - return SAFE_STRTOL(cleanup, buf, LONG_MIN, LONG_MAX); -} - -void write_file(char *filename, char *buf) -{ - int fd; - - fd = open(filename, O_WRONLY); - if (fd == -1) - tst_brkm(TBROK | TERRNO, cleanup, "open %s", filename); - if (write(fd, buf, strlen(buf)) != strlen(buf)) - tst_brkm(TBROK | TERRNO, cleanup, "write %s", filename); - close(fd); -} + char path[BUFSIZ]; + long tune; -void read_file(char *filename, char *retbuf) -{ - int fd; + snprintf(path, BUFSIZ, PATH_SYSVM "%s", sys_file); + SAFE_FILE_SCANF(NULL, path, "%ld", &tune); - fd = open(filename, O_RDONLY); - if (fd == -1) - tst_brkm(TBROK | TERRNO, cleanup, "open %s", filename); - if (read(fd, retbuf, BUFSIZ) < 0) - tst_brkm(TBROK | TERRNO, cleanup, "read %s", filename); - close(fd); + return tune; } void update_shm_size(size_t * shm_size) { - char buf[BUFSIZ]; size_t shmmax; - read_file(PATH_SHMMAX, buf); - shmmax = SAFE_STRTOUL(cleanup, buf, 0, ULONG_MAX); + SAFE_FILE_SCANF(cleanup, PATH_SHMMAX, "%ld", &shmmax); if (*shm_size > shmmax) { tst_resm(TINFO, "Set shm_size to shmmax: %ld", shmmax); *shm_size = shmmax; diff --git a/testcases/kernel/mem/oom/oom03.c b/testcases/kernel/mem/oom/oom03.c index 124e95f..8faa3cd 100644 --- a/testcases/kernel/mem/oom/oom03.c +++ b/testcases/kernel/mem/oom/oom03.c @@ -48,7 +48,6 @@ int main(int argc, char *argv[]) { char *msg; int lc; - char buf[BUFSIZ], mem[BUFSIZ]; msg = parse_opts(argc, argv, NULL, NULL); if (msg != NULL) @@ -63,11 +62,10 @@ int main(int argc, char *argv[]) for (lc = 0; TEST_LOOPING(lc); lc++) { tst_count = 0; - snprintf(buf, BUFSIZ, "%d", getpid()); - write_file(MEMCG_PATH_NEW "/tasks", buf); + SAFE_FILE_PRINTF(cleanup, MEMCG_PATH_NEW "/tasks", + "%d", getpid()); + SAFE_FILE_PRINTF(cleanup, MEMCG_LIMIT, "%ld", TESTMEM); - snprintf(mem, BUFSIZ, "%ld", TESTMEM); - write_file(MEMCG_PATH_NEW "/memory.limit_in_bytes", mem); testoom(0, 0); if (access(MEMCG_SW_LIMIT, F_OK) == -1) { @@ -77,7 +75,8 @@ int main(int argc, char *argv[]) else tst_brkm(TBROK | TERRNO, cleanup, "access"); } else { - write_file(MEMCG_SW_LIMIT, mem); + SAFE_FILE_PRINTF(cleanup, MEMCG_SW_LIMIT, + "%ld", TESTMEM); testoom(0, 1); } diff --git a/testcases/kernel/mem/oom/oom05.c b/testcases/kernel/mem/oom/oom05.c index cd45f08..15feba5 100644 --- a/testcases/kernel/mem/oom/oom05.c +++ b/testcases/kernel/mem/oom/oom05.c @@ -51,7 +51,6 @@ int main(int argc, char *argv[]) char *msg; int lc; int swap_acc_on = 1; - char mem[BUFSIZ]; msg = parse_opts(argc, argv, NULL, NULL); if (msg != NULL) @@ -93,13 +92,12 @@ int main(int argc, char *argv[]) if (swap_acc_on) { tst_resm(TINFO, "OOM on CPUSET & MEMCG with " "special memswap limitation:"); - snprintf(mem, BUFSIZ, "%ld", TESTMEM); - write_file(MEMCG_SW_LIMIT, mem); + SAFE_FILE_PRINTF(cleanup, MEMCG_SW_LIMIT, "%ld", TESTMEM); testoom(0, 0); tst_resm(TINFO, "OOM on CPUSET & MEMCG with " "disabled memswap limitation:"); - write_file(MEMCG_SW_LIMIT, "-1"); + SAFE_FILE_PRINTF(cleanup, MEMCG_SW_LIMIT, "-1"); testoom(0, 0); } } hooks/post-receive -- ltp |