Port following ltp test cases for uClinux platform:
--
fcntl17
rt_sigqueueinfo01
exit_group01
umount03
mount03
eventfd01
--
Bellow is the patch:
--
Index: testcases/kernel/syscalls/fcntl/fcntl17.c
===================================================================
--- testcases/kernel/syscalls/fcntl/fcntl17.c
+++ testcases/kernel/syscalls/fcntl/fcntl17.c
@@ -477,7 +477,7 @@
/* parent */
- if ((child_pid2 = fork()) == 0) { /* second child */
+ if ((child_pid2 = FORK_OR_VFORK()) == 0) { /* second
child */
#ifdef UCLINUX
if (self_exec(av[0], "nddddddddd", 2, file_fd,
parent_pipe[0], parent_pipe[1],
@@ -501,7 +501,7 @@
/* parent */
- if ((child_pid3 = fork()) == 0) { /* third child */
+ if ((child_pid3 = FORK_OR_VFORK()) == 0) { /* third
child */
#ifdef UCLINUX
if (self_exec(av[0], "nddddddddd", 3, file_fd,
parent_pipe[0], parent_pipe[1],
Index: testcases/kernel/syscalls/rt_sigqueueinfo/rt_sigqueueinfo01.c
===================================================================
--- testcases/kernel/syscalls/rt_sigqueueinfo/rt_sigqueueinfo01.c
+++ testcases/kernel/syscalls/rt_sigqueueinfo/rt_sigqueueinfo01.c
@@ -128,7 +128,7 @@
for (lc = 0; TEST_LOOPING(lc); ++lc) {
Tst_count = 0;
for (testno = 0; testno < TST_TOTAL; ++testno) {
- TEST(pid = fork());
+ TEST(pid = FORK_OR_VFORK());
setup();
if (TEST_RETURN < 0) {
tst_resm(TFAIL, "fork() Failed, errno=%d :
%s", TEST_ERRNO,
@@ -146,6 +146,7 @@
strerror(TEST_ERRNO));
}
cleanup();
+ _exit(0);
}
tst_exit();
}
Index: testcases/kernel/syscalls/exit_group/exit_group01.c
===================================================================
--- testcases/kernel/syscalls/exit_group/exit_group01.c
+++ testcases/kernel/syscalls/exit_group/exit_group01.c
@@ -128,7 +128,7 @@
Tst_count = 0;
for (testno = 0; testno < TST_TOTAL; ++testno) {
- TEST(cpid = fork()); //call exit_group()
+ TEST(cpid = FORK_OR_VFORK()); //call exit_group()
if(TEST_RETURN == -1) {
tst_resm(TFAIL, "fork() error ...errno
%d",TEST_ERRNO);
cleanup();
Index: testcases/kernel/syscalls/umount/umount03.c
===================================================================
--- testcases/kernel/syscalls/umount/umount03.c
+++ testcases/kernel/syscalls/umount/umount03.c
@@ -170,7 +170,7 @@
/* reset Tst_count in case we are looping. */
Tst_count = 0;
- switch (fork()) {
+ switch (FORK_OR_VFORK()) {
case -1:
/* fork() failed */
Index: testcases/kernel/syscalls/mount/mount03.c
===================================================================
--- testcases/kernel/syscalls/mount/mount03.c
+++ testcases/kernel/syscalls/mount/mount03.c
@@ -391,7 +391,7 @@
/* Validate MS_NOSUID flag of mount call */
setup_uid();
- if ((pid = fork()) == 0) {
+ if ((pid = FORK_OR_VFORK()) == 0) {
snprintf(file, PATH_MAX, "%ssetuid_test",
Path_name);
if (chmod(file, SUID_MODE) != 0) {
tst_resm(TWARN, "chmod() failed to "
@@ -429,7 +429,7 @@
int pid, status;
char command[PATH_MAX];
- switch (pid = fork()) {
+ switch (pid = FORK_OR_VFORK()) {
case -1:
tst_resm(TWARN, "Unable to fork a child process"
" to exec over! Errno:%d, :%s",
Index: testcases/kernel/syscalls/eventfd/eventfd01.c
===================================================================
--- testcases/kernel/syscalls/eventfd/eventfd01.c
+++ testcases/kernel/syscalls/eventfd/eventfd01.c
@@ -438,7 +438,7 @@
uint64_t to_parent = 0xdeadbeef;
uint64_t dummy;
- cpid = fork();
+ cpid = FORK_OR_VFORK();
if (cpid == -1)
tst_resm(TBROK|TERRNO, "fork() failed");
if (cpid != 0) {
--
Best regards,
Vivi Li
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list