[wxs@bogon ltp]$ cd testcases/kernel/syscalls/ [wxs@bogon syscalls]$ mkdir _exit [wxs@bogon syscalls]$ cd _exit [wxs@bogon _exit]$ pwd /home/wxs/ltp/testcases/kernel/syscalls/_exit
编写Makefile文件,用于编译本章的所有测试用例:
1
[wxs@bogon _exit]$ vim Makefile
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
# # Author : jitwxs <jitwxs@foxmail.com> # # 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 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. #
top_srcdir ?= ../../../..
include $(top_srcdir)/include/mk/testcases.mk
include $(top_srcdir)/include/mk/generic_leaf_target.mk
/* * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 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. * * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc. */ /********************************************************** * * TEST IDENTIFIER : exit01 * * TEST TITLE : Basic tests for _exit(2) * * TEST CASE TOTAL : 1 * * AUTHOR : jitwxs * <jitwxs@foxmail.com> * * DESCRIPTION * After the process calls _exit() to test whether the process still * exists. * **********************************************************/
[wxs@bogon _exit]$ git format-patch -1 0001-syscall-_exit-create-_exit-syscall-and-add-_exit01-t.patch [wxs@bogon _exit]$ ~/linux/scripts/checkpatch.pl 0001-syscall-_exit-create-_exit-syscall-and-add-_exit01-t.patch WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #16: new file mode 100644
total: 0 errors, 1 warnings, 76 lines checked
NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace.
0001-syscall-_exit-create-_exit-syscall-and-add-_exit01-t.patch has style problems, please review.
NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS.
/* * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 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. * * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc. */ /********************************************************** * * TEST IDENTIFIER : exit02 * * TEST TITLE : Basic tests for _exit(2) * * TEST CASE TOTAL : 1 * * AUTHOR : jitwxs * <jitwxs@foxmail.com> * * DESCRIPTION * After the process call _exit () terminates, * tests if the child process's parent process PID is 1. * **********************************************************/
/* * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 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. * * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc. */ /********************************************************** * * TEST IDENTIFIER : exit03 * * TEST TITLE : Basic tests for _exit(2) * * TEST CASE TOTAL : 1 * * AUTHOR : jitwxs * <jitwxs@foxmail.com> * * DESCRIPTION * After the process call _exit () terminates, * it tests if the parent process received the SIGCHLD signal. * **********************************************************/
/* * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 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. * * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc. */ /********************************************************** * * TEST IDENTIFIER : exit04 * * TEST TITLE : Basic tests for _exit(2) * * TEST CASE TOTAL : 5 * * AUTHOR : jitwxs * <jitwxs@foxmail.com> * * DESCRIPTION * The process calls _exit () to append the parameter value and test * whether the value was obtained from the parent's wait (). * **********************************************************/
/* * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 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. * * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc. */ /********************************************************** * * TEST IDENTIFIER : exit05 * * TEST TITLE : Basic tests for _exit(2) * * TEST CASE TOTAL : 1 * * AUTHOR : jitwxs * <jitwxs@foxmail.com> * * DESCRIPTION * When process call _exit () terminates, atexit (3) or on_exit (3) is * not called as it did for exit (3), so you can test whether the * function registered in atexit (3) is called back. * **********************************************************/