ltp.lists.linux.it archive mirror
 help / color / mirror / Atom feed
* [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API
@ 2024-04-11 14:29 Petr Vorel
  2024-04-11 14:29 ` [LTP] [PATCH 01/31] m4: Remove UCLINUX (nommu detection) Petr Vorel
                   ` (31 more replies)
  0 siblings, 32 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:29 UTC (permalink / raw)
  To: ltp
  Cc: Giovanni Lostumbo, linux-kernel, linux-m68k, Geert Uytterhoeven,
	Rob Landley, John Paul Adrian Glaubitz

Hi all,

this is a patchset I announced 3 months ago [1]. I'm Cc you only in
cover letter (I don't want to fill your mailbox, the code itself is in
LTP ML [2], lore archive [3], patchwork [4]).

Kind regards,
Petr

[1] https://lore.kernel.org/ltp/20240103015240.1065284-1-pvorel@suse.cz/
[2] https://lists.linux.it/pipermail/ltp/2024-April/thread.html
[3] https://lore.kernel.org/ltp/
[4] https://patchwork.ozlabs.org/project/ltp/list/

Petr Vorel (31):
  m4: Remove UCLINUX (nommu detection)
  make: Remove WITH_POWER_MANAGEMENT_TESTSUITE
  make: Remove UCLINUX (nommu detection)
  test.h: Remove MAP_PRIVATE_EXCEPT_UCLINUX
  tree: Remove FORK_OR_VFORK and tst_vfork()
  lib/parse_opts.c: Remove UCLINUX
  tlibio.c: Remove UCLINUX
  clone02: Remove UCLINUX
  connect01: Remove UCLINUX
  creat06: Remove UCLINUX
  fcntl: Remove UCLINUX
  semctl06: Remove UCLINUX
  kill: Remove UCLINUX
  madvise02: Remove UCLINUX
  mlockall: Remove UCLINUX
  munmap: Remove UCLINUX
  writev05: Remove UCLINUX
  pipe: Remove UCLINUX
  pause: Remove UCLINUX
  recv*: Remove UCLINUX
  send*: Remove UCLINUX
  sock*: Remove UCLINUX
  read02: Remove UCLINUX
  setgroups04: Remove UCLINUX
  setsid01: Remove UCLINUX
  sigrelse01: Remove UCLINUX
  sysinfo02: Remove UCLINUX
  ustat02: Remove UCLINUX
  lib: Remove -C option and self_exec.c
  Remove doc/old/nommu-notes.txt
  doc: UCLINUX has been removed

 Makefile                                      |   7 -
 configure.ac                                  |   1 -
 doc/maintainers/patch_review.rst              |   4 -
 ...Maintainer-Patch-Review-Checklist.asciidoc |   3 -
 doc/old/nommu-notes.txt                       | 171 -------------
 include/mk/env_post.mk                        |   4 -
 include/mk/features.mk.in                     |  11 -
 include/old/test.h                            |  21 --
 lib/parse_opts.c                              |  23 +-
 lib/self_exec.c                               | 225 ------------------
 lib/tlibio.c                                  |   2 +-
 lib/tst_res.c                                 |   8 -
 lib/tst_test.c                                |  15 --
 m4/ltp-nommu-linux.m4                         |  14 --
 runtest/Makefile                              |   4 -
 testcases/kernel/Makefile                     |   7 +-
 testcases/kernel/syscalls/Makefile            |   5 -
 testcases/kernel/syscalls/access/Makefile     |   4 -
 testcases/kernel/syscalls/clone/clone02.c     |   5 -
 testcases/kernel/syscalls/connect/connect01.c |  17 +-
 testcases/kernel/syscalls/creat/creat06.c     |   6 -
 testcases/kernel/syscalls/epoll/epoll-ltp.c   |   4 +-
 testcases/kernel/syscalls/exit/exit01.c       |   2 +-
 testcases/kernel/syscalls/fcntl/fcntl07.c     |   2 +-
 testcases/kernel/syscalls/fcntl/fcntl11.c     |  16 +-
 testcases/kernel/syscalls/fcntl/fcntl14.c     |  52 +---
 testcases/kernel/syscalls/fcntl/fcntl16.c     |  29 +--
 testcases/kernel/syscalls/fcntl/fcntl17.c     |  59 +----
 testcases/kernel/syscalls/fcntl/fcntl18.c     |  12 +-
 testcases/kernel/syscalls/fcntl/fcntl19.c     |  15 +-
 testcases/kernel/syscalls/fcntl/fcntl20.c     |  16 +-
 testcases/kernel/syscalls/fcntl/fcntl21.c     |  18 +-
 testcases/kernel/syscalls/fcntl/fcntl22.c     |   2 +-
 testcases/kernel/syscalls/ipc/msgsnd/Makefile |   4 -
 .../syscalls/ipc/msgstress/msgstress01.c      |   4 +-
 .../syscalls/ipc/msgstress/msgstress02.c      |   6 +-
 .../syscalls/ipc/msgstress/msgstress03.c      |   4 +-
 .../syscalls/ipc/msgstress/msgstress04.c      |   6 +-
 .../kernel/syscalls/ipc/semctl/semctl06.c     |   9 +-
 testcases/kernel/syscalls/kill/kill02.c       | 101 +-------
 testcases/kernel/syscalls/kill/kill07.c       |  12 +-
 testcases/kernel/syscalls/kill/kill08.c       |  15 +-
 testcases/kernel/syscalls/kill/kill09.c       |  13 +-
 testcases/kernel/syscalls/kill/kill12.c       |   2 +-
 testcases/kernel/syscalls/madvise/madvise02.c |  25 +-
 .../kernel/syscalls/mlockall/mlockall01.c     |  12 -
 .../kernel/syscalls/mlockall/mlockall02.c     |  12 -
 .../kernel/syscalls/mlockall/mlockall03.c     |  12 -
 .../kernel/syscalls/modify_ldt/modify_ldt02.c |   2 +-
 .../kernel/syscalls/mprotect/mprotect02.c     |   4 +-
 .../kernel/syscalls/mprotect/mprotect03.c     |   2 +-
 testcases/kernel/syscalls/munmap/munmap01.c   |  18 +-
 testcases/kernel/syscalls/munmap/munmap02.c   |  18 --
 testcases/kernel/syscalls/munmap/munmap03.c   |   3 +-
 testcases/kernel/syscalls/pause/pause02.c     |  11 +-
 testcases/kernel/syscalls/pause/pause03.c     |  13 +-
 testcases/kernel/syscalls/pipe/pipe02.c       |   9 -
 testcases/kernel/syscalls/pipe/pipe04.c       |  23 +-
 testcases/kernel/syscalls/pipe/pipe09.c       |   4 +-
 testcases/kernel/syscalls/read/read02.c       |   4 -
 testcases/kernel/syscalls/recv/recv01.c       |  19 +-
 .../kernel/syscalls/recvfrom/recvfrom01.c     |  17 +-
 testcases/kernel/syscalls/rename/rename14.c   |   4 +-
 testcases/kernel/syscalls/send/send01.c       |  23 +-
 testcases/kernel/syscalls/sendmsg/sendmsg01.c |  16 +-
 testcases/kernel/syscalls/sendto/sendto01.c   |  23 +-
 .../kernel/syscalls/setfsuid/setfsuid04.c     |   4 +-
 .../kernel/syscalls/setgroups/setgroups04.c   |  12 -
 testcases/kernel/syscalls/setpgid/setpgid01.c |   2 +-
 testcases/kernel/syscalls/setpgrp/setpgrp01.c |   2 +-
 .../kernel/syscalls/setrlimit/setrlimit01.c   |   6 +-
 testcases/kernel/syscalls/setsid/setsid01.c   |  29 +--
 .../kernel/syscalls/sigrelse/sigrelse01.c     |  20 +-
 .../kernel/syscalls/socketpair/socketpair01.c |   2 -
 .../kernel/syscalls/sockioctl/sockioctl01.c   |   2 -
 testcases/kernel/syscalls/sysinfo/sysinfo02.c |  12 -
 testcases/kernel/syscalls/ustat/ustat02.c     |   2 -
 testcases/kernel/syscalls/writev/Makefile     |   4 -
 testcases/kernel/syscalls/writev/writev02.c   |   3 +-
 testcases/kernel/syscalls/writev/writev05.c   |  15 +-
 testcases/kernel/syscalls/writev/writev06.c   |   8 +-
 81 files changed, 100 insertions(+), 1257 deletions(-)
 delete mode 100644 doc/old/nommu-notes.txt
 delete mode 100644 lib/self_exec.c
 delete mode 100644 m4/ltp-nommu-linux.m4

-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 01/31] m4: Remove UCLINUX (nommu detection)
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
@ 2024-04-11 14:29 ` Petr Vorel
  2024-04-11 14:29 ` [LTP] [PATCH 02/31] make: Remove WITH_POWER_MANAGEMENT_TESTSUITE Petr Vorel
                   ` (30 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:29 UTC (permalink / raw)
  To: ltp

nommu detection was written for UCLINUX distribution, which is not
active any more.  While there are still some used nommu kernel
architectures (m68k and other), there is missing support in the new
C API and nobody from the community did not stand to implement and
maintain it. Therefore removing all UCLINUX/nommu related code in this
and following commits.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 configure.ac          |  1 -
 m4/ltp-nommu-linux.m4 | 14 --------------
 2 files changed, 15 deletions(-)
 delete mode 100644 m4/ltp-nommu-linux.m4

diff --git a/configure.ac b/configure.ac
index 1d7e862d8..1d7e7628f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -384,7 +384,6 @@ LTP_CHECK_KERNEL_DEVEL
 LTP_CHECK_KEYUTILS_SUPPORT
 LTP_CHECK_LIBMNL
 LTP_CHECK_LINUXRANDOM
-LTP_CHECK_NOMMU_LINUX
 LTP_CHECK_SELINUX
 LTP_CHECK_SYNC_ADD_AND_FETCH
 LTP_CHECK_SYSCALL_EVENTFD
diff --git a/m4/ltp-nommu-linux.m4 b/m4/ltp-nommu-linux.m4
deleted file mode 100644
index 7471ddd06..000000000
--- a/m4/ltp-nommu-linux.m4
+++ /dev/null
@@ -1,14 +0,0 @@
-dnl SPDX-License-Identifier: GPL-2.0-or-later
-dnl Copyright (c) Linux Test Project, 2010
-dnl Author: Mike Frysinger <vapier@gentoo.org>
-
-AC_DEFUN([LTP_CHECK_NOMMU_LINUX],
-[
-	AC_CHECK_FUNCS([fork daemon vfork])
-	UCLINUX=0
-	if test "x$ac_cv_func_fork" = "xno" ; then
-		UCLINUX=1
-		AC_DEFINE([UCLINUX], 1, [Target is running Linux w/out an MMU])
-	fi
-	AC_SUBST(UCLINUX)
-])
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 02/31] make: Remove WITH_POWER_MANAGEMENT_TESTSUITE
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
  2024-04-11 14:29 ` [LTP] [PATCH 01/31] m4: Remove UCLINUX (nommu detection) Petr Vorel
@ 2024-04-11 14:29 ` Petr Vorel
  2024-04-11 14:29 ` [LTP] [PATCH 03/31] make: Remove UCLINUX (nommu detection) Petr Vorel
                   ` (29 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:29 UTC (permalink / raw)
  To: ltp

It was introduced only for UCLINUX.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 include/mk/features.mk.in | 7 -------
 runtest/Makefile          | 4 ----
 testcases/kernel/Makefile | 5 +----
 3 files changed, 1 insertion(+), 15 deletions(-)

diff --git a/include/mk/features.mk.in b/include/mk/features.mk.in
index 802ee0ba8..c2b64b549 100644
--- a/include/mk/features.mk.in
+++ b/include/mk/features.mk.in
@@ -36,13 +36,6 @@ WITH_METADATA_PDF		:= @WITH_METADATA_PDF@
 
 # Test suite knobs
 
-# Enable testcases/kernel/power_management's compile and install?
-ifeq ($(UCLINUX),1)
-WITH_POWER_MANAGEMENT_TESTSUITE	:= no
-else
-WITH_POWER_MANAGEMENT_TESTSUITE	:= yes
-endif
-
 # Enable testcases/open_posix_testsuite's compile and install?
 WITH_OPEN_POSIX_TESTSUITE	:= @WITH_OPEN_POSIX_TESTSUITE@
 
diff --git a/runtest/Makefile b/runtest/Makefile
index 6a1565b6a..0f95e69fa 100644
--- a/runtest/Makefile
+++ b/runtest/Makefile
@@ -32,10 +32,6 @@ UNWANTED_FILES		:= Makefile CVS STAX
 
 INSTALL_MODE		:= 00644
 
-ifneq ($(WITH_POWER_MANAGEMENT_TESTSUITE),yes)
-UNWANTED_FILES		+= power_management_tests
-endif
-
 INSTALL_TARGETS		:= $(filter-out $(UNWANTED_FILES),$(notdir $(patsubst $(abs_srcdir)/%,%,$(sort $(wildcard $(abs_srcdir)/*)))))
 
 MAKE_TARGETS		:=
diff --git a/testcases/kernel/Makefile b/testcases/kernel/Makefile
index bf890e175..3ca0e74bd 100644
--- a/testcases/kernel/Makefile
+++ b/testcases/kernel/Makefile
@@ -32,6 +32,7 @@ SUBDIRS			+= connectors \
 			   logging \
 			   mem \
 			   numa \
+			   power_management \
 			   pty \
 			   sched \
 			   security \
@@ -40,10 +41,6 @@ SUBDIRS			+= connectors \
 			   uevents \
 			   watchqueue \
 
-ifeq ($(WITH_POWER_MANAGEMENT_TESTSUITE),yes)
-SUBDIRS			+= power_management
-endif
-
 ifeq ($(WITH_KVM_TESTSUITE),yes)
 SUBDIRS			+= kvm
 endif
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 03/31] make: Remove UCLINUX (nommu detection)
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
  2024-04-11 14:29 ` [LTP] [PATCH 01/31] m4: Remove UCLINUX (nommu detection) Petr Vorel
  2024-04-11 14:29 ` [LTP] [PATCH 02/31] make: Remove WITH_POWER_MANAGEMENT_TESTSUITE Petr Vorel
@ 2024-04-11 14:29 ` Petr Vorel
  2024-04-11 14:29 ` [LTP] [PATCH 04/31] test.h: Remove MAP_PRIVATE_EXCEPT_UCLINUX Petr Vorel
                   ` (28 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:29 UTC (permalink / raw)
  To: ltp

nommu detection was written for UCLINUX distribution, which is not
active any more.  While there are still some used nommu kernel
architectures (m68k and other), there is missing support in the new
C API and nobody from the community did not stand to implement and
maintain it. Therefore removing all UCLINUX/nommu related code also
from makefiles.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 Makefile                                      | 7 -------
 include/mk/env_post.mk                        | 4 ----
 include/mk/features.mk.in                     | 4 ----
 testcases/kernel/Makefile                     | 2 --
 testcases/kernel/syscalls/Makefile            | 5 -----
 testcases/kernel/syscalls/access/Makefile     | 4 ----
 testcases/kernel/syscalls/ipc/msgsnd/Makefile | 4 ----
 testcases/kernel/syscalls/writev/Makefile     | 4 ----
 8 files changed, 34 deletions(-)

diff --git a/Makefile b/Makefile
index 96edd5a80..d7d2815f1 100644
--- a/Makefile
+++ b/Makefile
@@ -24,10 +24,6 @@ vpath %.in		$(top_srcdir)/include
 vpath %.m4		$(top_srcdir)/m4
 vpath %.mk		$(top_srcdir)/mk:$(top_srcdir)/mk/include
 
-# User wants uclinux binaries?
-UCLINUX			?= 0
-export UCLINUX
-
 # CLEAN_TARGETS:	Targets which exist solely in clean.
 # COMMON_TARGETS:	Targets which exist in all, clean, and install.
 # INSTALL_TARGETS:	Targets which exist in clean and install (contains
@@ -35,10 +31,7 @@ export UCLINUX
 # BOOTSTRAP_TARGETS:	Directories required to bootstrap out-of-build-tree
 # 			support.
 
-# We're not using uclinux based targets (default).
-ifneq ($(UCLINUX),1)
 COMMON_TARGETS		:= pan utils
-endif
 
 define target_to_dir_dep_mapping
 ifeq ($$(filter %-clean,$(1)),) # not *-clean
diff --git a/include/mk/env_post.mk b/include/mk/env_post.mk
index a00f31b08..0bbbc3705 100644
--- a/include/mk/env_post.mk
+++ b/include/mk/env_post.mk
@@ -39,10 +39,6 @@ CPPFLAGS			+= -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/
 
 LDFLAGS				+= -L$(top_builddir)/lib
 
-ifeq ($(UCLINUX),1)
-CPPFLAGS			+= -D__UCLIBC__ -DUCLINUX
-endif
-
 ifeq ($(ANDROID),1)
 LDFLAGS				+= -L$(top_builddir)/lib/android_libpthread
 LDFLAGS				+= -L$(top_builddir)/lib/android_librt
diff --git a/include/mk/features.mk.in b/include/mk/features.mk.in
index c2b64b549..73a2f6658 100644
--- a/include/mk/features.mk.in
+++ b/include/mk/features.mk.in
@@ -40,11 +40,7 @@ WITH_METADATA_PDF		:= @WITH_METADATA_PDF@
 WITH_OPEN_POSIX_TESTSUITE	:= @WITH_OPEN_POSIX_TESTSUITE@
 
 # Enable testcases/realtime's compile and install?
-ifeq ($(UCLINUX),1)
-WITH_REALTIME_TESTSUITE		:= no
-else
 WITH_REALTIME_TESTSUITE		:= @WITH_REALTIME_TESTSUITE@
-endif
 
 # Enable testcases/kernel/kvm compile and install?
 WITH_KVM_TESTSUITE		:= @WITH_KVM_TESTSUITE@
diff --git a/testcases/kernel/Makefile b/testcases/kernel/Makefile
index 3ca0e74bd..98fd45a9d 100644
--- a/testcases/kernel/Makefile
+++ b/testcases/kernel/Makefile
@@ -15,7 +15,6 @@ SUBDIRS			:= syscalls
 # Build lib
 SUBDIRS			+= lib
 
-ifneq ($(UCLINUX),1)
 # KEEP THIS LIST ALPHABETIZED PLEASE!
 SUBDIRS			+= connectors \
 			   containers \
@@ -43,7 +42,6 @@ SUBDIRS			+= connectors \
 
 ifeq ($(WITH_KVM_TESTSUITE),yes)
 SUBDIRS			+= kvm
-endif
 
 endif
 
diff --git a/testcases/kernel/syscalls/Makefile b/testcases/kernel/syscalls/Makefile
index c6dc8d9e7..b2e1b1caf 100644
--- a/testcases/kernel/syscalls/Makefile
+++ b/testcases/kernel/syscalls/Makefile
@@ -10,11 +10,6 @@ top_srcdir		?= ../../..
 
 include	$(top_srcdir)/include/mk/env_pre.mk
 
-ifeq ($(UCLINUX),1)
-FILTER_OUT_DIRS	+= capget capset chmod chown clone fork getcontext llseek \
-		   mincore mprotect nftw profil remap_file_pages sbrk
-endif
-
 ifeq ($(UCLIBC),1)
 FILTER_OUT_DIRS	+= profil
 endif
diff --git a/testcases/kernel/syscalls/access/Makefile b/testcases/kernel/syscalls/access/Makefile
index 5d89a6c05..044619fb8 100644
--- a/testcases/kernel/syscalls/access/Makefile
+++ b/testcases/kernel/syscalls/access/Makefile
@@ -3,10 +3,6 @@
 
 top_srcdir		?= ../../../..
 
-ifeq ($(UCLINUX),1)
-FILTER_OUT_MAKE_TARGETS += access02 access03
-endif
-
 include $(top_srcdir)/include/mk/testcases.mk
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/ipc/msgsnd/Makefile b/testcases/kernel/syscalls/ipc/msgsnd/Makefile
index 85017fe90..63aee01d4 100644
--- a/testcases/kernel/syscalls/ipc/msgsnd/Makefile
+++ b/testcases/kernel/syscalls/ipc/msgsnd/Makefile
@@ -5,10 +5,6 @@ top_srcdir              ?= ../../../../..
 
 LTPLIBS = ltpnewipc
 
-ifeq ($(UCLINUX),1)
-FILTER_OUT_MAKE_TARGETS += msgsnd05 msgsnd06
-endif
-
 include $(top_srcdir)/include/mk/testcases.mk
 
 LTPLDLIBS  += -lltpnewipc
diff --git a/testcases/kernel/syscalls/writev/Makefile b/testcases/kernel/syscalls/writev/Makefile
index 6627abaed..2eb46974e 100644
--- a/testcases/kernel/syscalls/writev/Makefile
+++ b/testcases/kernel/syscalls/writev/Makefile
@@ -3,10 +3,6 @@
 
 top_srcdir		?= ../../../..
 
-ifeq ($(UCLINUX),1)
-FILTER_OUT_MAKE_TARGETS	+= writev02
-endif
-
 include $(top_srcdir)/include/mk/testcases.mk
 
 writev03: CFLAGS += -pthread
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 04/31] test.h: Remove MAP_PRIVATE_EXCEPT_UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (2 preceding siblings ...)
  2024-04-11 14:29 ` [LTP] [PATCH 03/31] make: Remove UCLINUX (nommu detection) Petr Vorel
@ 2024-04-11 14:29 ` Petr Vorel
  2024-04-11 14:29 ` [LTP] [PATCH 05/31] tree: Remove FORK_OR_VFORK and tst_vfork() Petr Vorel
                   ` (27 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:29 UTC (permalink / raw)
  To: ltp

Replace it with MAP_PRIVATE.
It was defined only to support UCLINUX.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 include/old/test.h                          | 5 -----
 testcases/kernel/syscalls/munmap/munmap03.c | 3 +--
 testcases/kernel/syscalls/writev/writev02.c | 3 +--
 testcases/kernel/syscalls/writev/writev05.c | 3 +--
 testcases/kernel/syscalls/writev/writev06.c | 8 ++++----
 5 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/include/old/test.h b/include/old/test.h
index b17fbf856..8ccd5f5e8 100644
--- a/include/old/test.h
+++ b/include/old/test.h
@@ -68,18 +68,13 @@
 /*
  * fork() can't be used on uClinux systems, so use FORK_OR_VFORK instead,
  * which will run vfork() on uClinux.
- * mmap() doesn't support MAP_PRIVATE on uClinux systems, so use
- * MAP_PRIVATE_EXCEPT_UCLINUX instead, which will skip the option on uClinux.
- * If MAP_PRIVATE really is required, the test can not be run on uClinux.
  */
 #ifdef UCLINUX
 # define FORK_OR_VFORK			tst_vfork
-# define MAP_PRIVATE_EXCEPT_UCLINUX	0
 /* tst_old_flush() + vfork() */
 pid_t tst_vfork(void);
 #else
 # define FORK_OR_VFORK			tst_fork
-# define MAP_PRIVATE_EXCEPT_UCLINUX	MAP_PRIVATE
 #endif
 
 /*
diff --git a/testcases/kernel/syscalls/munmap/munmap03.c b/testcases/kernel/syscalls/munmap/munmap03.c
index 23875e7b3..60bcb93b0 100644
--- a/testcases/kernel/syscalls/munmap/munmap03.c
+++ b/testcases/kernel/syscalls/munmap/munmap03.c
@@ -87,8 +87,7 @@ static void setup(void)
 
 	global_maplen = page_sz * 2;
 	global_addr = SAFE_MMAP(cleanup, NULL, global_maplen, PROT_READ |
-				PROT_WRITE, MAP_PRIVATE_EXCEPT_UCLINUX |
-				MAP_ANONYMOUS, -1, 0);
+				PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
 }
 
 static void check_and_print(int expected_errno)
diff --git a/testcases/kernel/syscalls/writev/writev02.c b/testcases/kernel/syscalls/writev/writev02.c
index 005f37a14..a7d11de30 100644
--- a/testcases/kernel/syscalls/writev/writev02.c
+++ b/testcases/kernel/syscalls/writev/writev02.c
@@ -179,8 +179,7 @@ void setup(void)
 	strcpy(name, DATA_FILE);
 	sprintf(f_name, "%s.%d", name, getpid());
 
-	bad_addr = mmap(0, 1, PROT_NONE,
-			MAP_PRIVATE_EXCEPT_UCLINUX | MAP_ANONYMOUS, 0, 0);
+	bad_addr = mmap(0, 1, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
 	if (bad_addr == MAP_FAILED)
 		tst_brkm(TBROK | TERRNO, cleanup, "mmap failed");
 	wr_iovec[0].iov_base = bad_addr;
diff --git a/testcases/kernel/syscalls/writev/writev05.c b/testcases/kernel/syscalls/writev/writev05.c
index c939e7de0..6add2bcd4 100644
--- a/testcases/kernel/syscalls/writev/writev05.c
+++ b/testcases/kernel/syscalls/writev/writev05.c
@@ -210,8 +210,7 @@ void setup(void)
 	strcpy(name, DATA_FILE);
 	sprintf(f_name, "%s.%d", name, getpid());
 
-	bad_addr = mmap(0, 1, PROT_NONE,
-			MAP_PRIVATE_EXCEPT_UCLINUX | MAP_ANONYMOUS, 0, 0);
+	bad_addr = mmap(0, 1, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
 	if (bad_addr == MAP_FAILED) {
 		printf("mmap failed\n");
 	}
diff --git a/testcases/kernel/syscalls/writev/writev06.c b/testcases/kernel/syscalls/writev/writev06.c
index e97ae6f21..b60c727b6 100644
--- a/testcases/kernel/syscalls/writev/writev06.c
+++ b/testcases/kernel/syscalls/writev/writev06.c
@@ -162,22 +162,22 @@ void setup(void)
 	/* Crate two readable and writeble mappings with non reabable
 	 * mapping around */
 	bad_addr[0] = mmap(NULL, page_size * 3, PROT_NONE,
-			   MAP_PRIVATE_EXCEPT_UCLINUX | MAP_ANONYMOUS, 0, 0);
+			   MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
 	if (bad_addr[0] == MAP_FAILED)
 		tst_brkm(TBROK, cleanup, "mmap failed for bad_addr[0]");
 
 	good_addr[0] = mmap(NULL, page_size, PROT_READ | PROT_WRITE,
-			    MAP_PRIVATE_EXCEPT_UCLINUX | MAP_ANONYMOUS, 0, 0);
+			    MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
 	if (good_addr[0] == MAP_FAILED)
 		tst_brkm(TBROK, cleanup, "mmap failed for good_addr[0]");
 
 	bad_addr[1] = mmap(NULL, page_size * 3, PROT_NONE,
-			   MAP_PRIVATE_EXCEPT_UCLINUX | MAP_ANONYMOUS, 0, 0);
+			   MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
 	if (bad_addr[1] == MAP_FAILED)
 		tst_brkm(TBROK, cleanup, "mmap failed for bad_addr[1]");
 
 	good_addr[1] = mmap(NULL, page_size, PROT_READ | PROT_WRITE,
-			    MAP_PRIVATE_EXCEPT_UCLINUX | MAP_ANONYMOUS, 0, 0);
+			    MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
 	if (good_addr[1] == MAP_FAILED)
 		tst_brkm(TBROK, cleanup, "mmap failed for good_addr[1]");
 
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 05/31] tree: Remove FORK_OR_VFORK and tst_vfork()
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (3 preceding siblings ...)
  2024-04-11 14:29 ` [LTP] [PATCH 04/31] test.h: Remove MAP_PRIVATE_EXCEPT_UCLINUX Petr Vorel
@ 2024-04-11 14:29 ` Petr Vorel
  2024-04-11 14:30 ` [LTP] [PATCH 06/31] lib/parse_opts.c: Remove UCLINUX Petr Vorel
                   ` (26 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:29 UTC (permalink / raw)
  To: ltp

It was defined only to support UCLINUX.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 doc/old/Maintainer-Patch-Review-Checklist.asciidoc   |  2 +-
 include/old/test.h                                   | 12 ------------
 lib/tst_res.c                                        |  8 --------
 testcases/kernel/syscalls/connect/connect01.c        |  2 +-
 testcases/kernel/syscalls/epoll/epoll-ltp.c          |  4 ++--
 testcases/kernel/syscalls/exit/exit01.c              |  2 +-
 testcases/kernel/syscalls/fcntl/fcntl07.c            |  2 +-
 testcases/kernel/syscalls/fcntl/fcntl11.c            |  2 +-
 testcases/kernel/syscalls/fcntl/fcntl14.c            |  6 +++---
 testcases/kernel/syscalls/fcntl/fcntl16.c            |  2 +-
 testcases/kernel/syscalls/fcntl/fcntl17.c            |  2 +-
 testcases/kernel/syscalls/fcntl/fcntl18.c            |  2 +-
 testcases/kernel/syscalls/fcntl/fcntl19.c            |  2 +-
 testcases/kernel/syscalls/fcntl/fcntl20.c            |  2 +-
 testcases/kernel/syscalls/fcntl/fcntl21.c            |  2 +-
 testcases/kernel/syscalls/fcntl/fcntl22.c            |  2 +-
 .../kernel/syscalls/ipc/msgstress/msgstress01.c      |  4 ++--
 .../kernel/syscalls/ipc/msgstress/msgstress02.c      |  6 +++---
 .../kernel/syscalls/ipc/msgstress/msgstress03.c      |  4 ++--
 .../kernel/syscalls/ipc/msgstress/msgstress04.c      |  6 +++---
 testcases/kernel/syscalls/ipc/semctl/semctl06.c      |  4 ++--
 testcases/kernel/syscalls/kill/kill02.c              |  8 ++++----
 testcases/kernel/syscalls/kill/kill07.c              |  2 +-
 testcases/kernel/syscalls/kill/kill08.c              |  4 ++--
 testcases/kernel/syscalls/kill/kill09.c              |  2 +-
 testcases/kernel/syscalls/kill/kill12.c              |  2 +-
 testcases/kernel/syscalls/modify_ldt/modify_ldt02.c  |  2 +-
 testcases/kernel/syscalls/mprotect/mprotect02.c      |  4 ++--
 testcases/kernel/syscalls/mprotect/mprotect03.c      |  2 +-
 testcases/kernel/syscalls/pause/pause02.c            |  2 +-
 testcases/kernel/syscalls/pause/pause03.c            |  2 +-
 testcases/kernel/syscalls/pipe/pipe04.c              |  4 ++--
 testcases/kernel/syscalls/pipe/pipe09.c              |  4 ++--
 testcases/kernel/syscalls/recv/recv01.c              |  2 +-
 testcases/kernel/syscalls/recvfrom/recvfrom01.c      |  2 +-
 testcases/kernel/syscalls/rename/rename14.c          |  4 ++--
 testcases/kernel/syscalls/send/send01.c              |  2 +-
 testcases/kernel/syscalls/sendmsg/sendmsg01.c        |  2 +-
 testcases/kernel/syscalls/sendto/sendto01.c          |  2 +-
 testcases/kernel/syscalls/setfsuid/setfsuid04.c      |  4 ++--
 testcases/kernel/syscalls/setpgid/setpgid01.c        |  2 +-
 testcases/kernel/syscalls/setpgrp/setpgrp01.c        |  2 +-
 testcases/kernel/syscalls/setrlimit/setrlimit01.c    |  6 +++---
 testcases/kernel/syscalls/setsid/setsid01.c          |  6 +++---
 testcases/kernel/syscalls/sigrelse/sigrelse01.c      |  2 +-
 45 files changed, 66 insertions(+), 86 deletions(-)

diff --git a/doc/old/Maintainer-Patch-Review-Checklist.asciidoc b/doc/old/Maintainer-Patch-Review-Checklist.asciidoc
index 1cd36b3c9..9cd8606f9 100644
--- a/doc/old/Maintainer-Patch-Review-Checklist.asciidoc
+++ b/doc/old/Maintainer-Patch-Review-Checklist.asciidoc
@@ -129,7 +129,7 @@ New test should
   (more in https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines#2238-test-tags[Test tags])
 * When rewriting old tests, https://en.wikipedia.org/wiki/%CE%9CClinux[uClinux]
   support should be removed (project has been discontinued).
-  E.g. remove `#ifdef UCLINUX`, replace `FORK_OR_VFORK()` with simple `fork()` or `SAFE_FORK()`.
+  E.g. remove `#ifdef UCLINUX`, replace `tst_fork()` with simple `fork()` or `SAFE_FORK()`.
 
 ### Shell tests
 * Use new https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines#23-writing-a-testcase-in-shell[shell API]
diff --git a/include/old/test.h b/include/old/test.h
index 8ccd5f5e8..7394a365e 100644
--- a/include/old/test.h
+++ b/include/old/test.h
@@ -65,18 +65,6 @@
 					/* strings to control tst_res output */
 					/* If not set, TOUT_VERBOSE_S is assumed */
 
-/*
- * fork() can't be used on uClinux systems, so use FORK_OR_VFORK instead,
- * which will run vfork() on uClinux.
- */
-#ifdef UCLINUX
-# define FORK_OR_VFORK			tst_vfork
-/* tst_old_flush() + vfork() */
-pid_t tst_vfork(void);
-#else
-# define FORK_OR_VFORK			tst_fork
-#endif
-
 /*
  * Macro to use for making functions called only once in
  * multi-threaded tests such as init or cleanup function.
diff --git a/lib/tst_res.c b/lib/tst_res.c
index e87918ed1..7c66d2f6c 100644
--- a/lib/tst_res.c
+++ b/lib/tst_res.c
@@ -471,14 +471,6 @@ void tst_record_childstatus(void (*cleanup)(void), pid_t child)
 	}
 }
 
-pid_t tst_vfork(void)
-{
-	NO_NEWLIB_ASSERT("Unknown", 0);
-
-	tst_old_flush();
-	return vfork();
-}
-
 /*
  * Make tst_brk reentrant so that one can call the SAFE_* macros from within
  * user-defined cleanup functions.
diff --git a/testcases/kernel/syscalls/connect/connect01.c b/testcases/kernel/syscalls/connect/connect01.c
index 1c1630fa7..d901427ff 100644
--- a/testcases/kernel/syscalls/connect/connect01.c
+++ b/testcases/kernel/syscalls/connect/connect01.c
@@ -261,7 +261,7 @@ pid_t start_server(struct sockaddr_in *sin0)
 	}
 	SAFE_GETSOCKNAME(cleanup, sfd, (struct sockaddr *)sin0, &slen);
 
-	switch ((pid = FORK_OR_VFORK())) {
+	switch ((pid = tst_fork())) {
 	case 0:		/* child */
 #ifdef UCLINUX
 		self_exec(argv0, "d", sfd);
diff --git a/testcases/kernel/syscalls/epoll/epoll-ltp.c b/testcases/kernel/syscalls/epoll/epoll-ltp.c
index 8b04f5326..dac132e2f 100644
--- a/testcases/kernel/syscalls/epoll/epoll-ltp.c
+++ b/testcases/kernel/syscalls/epoll/epoll-ltp.c
@@ -143,7 +143,7 @@ do {					\
 	int kid_status;			\
 					\
 	tst_old_flush();			\
-	kid_pid = FORK_OR_VFORK();	\
+	kid_pid = tst_fork();	\
 	if (kid_pid == 0) {
 
 #define PROTECT_REGION_EXIT(errval) return (errval);
@@ -177,7 +177,7 @@ do {					\
 	int kid_status;								\
 										\
 	tst_old_flush();								\
-	kid_pid = FORK_OR_VFORK();						\
+	kid_pid = tst_fork();						\
 	if (kid_pid == 0) { /* Run the function */				\
 		return fn(epoll_fd);						\
 	} else {								\
diff --git a/testcases/kernel/syscalls/exit/exit01.c b/testcases/kernel/syscalls/exit/exit01.c
index 1c15f43b0..ca62dba49 100644
--- a/testcases/kernel/syscalls/exit/exit01.c
+++ b/testcases/kernel/syscalls/exit/exit01.c
@@ -52,7 +52,7 @@ int main(int ac, char **av)
 		sig = 0;
 		exno = 1;
 
-		pid = FORK_OR_VFORK();
+		pid = tst_fork();
 
 		switch (pid) {
 		case 0:
diff --git a/testcases/kernel/syscalls/fcntl/fcntl07.c b/testcases/kernel/syscalls/fcntl/fcntl07.c
index 9108b79c1..10d1186fc 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl07.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl07.c
@@ -101,7 +101,7 @@ static void verify_cloexec(struct tcase *tc)
 
 	sprintf(pidname, "%d", fd);
 
-	switch (pid = FORK_OR_VFORK()) {
+	switch (pid = tst_fork()) {
 	case -1:
 		tst_resm(TBROK | TERRNO, "fork() failed");
 		return;
diff --git a/testcases/kernel/syscalls/fcntl/fcntl11.c b/testcases/kernel/syscalls/fcntl/fcntl11.c
index d042c6b9b..2ad3aee5e 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl11.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl11.c
@@ -257,7 +257,7 @@ int main(int ac, char **av)
 		/* reset tst_count in case we are looping */
 		tst_count = 0;
 
-		if ((child_pid = FORK_OR_VFORK()) == 0) {	/* parent */
+		if ((child_pid = tst_fork()) == 0) {	/* parent */
 #ifdef UCLINUX
 			if (self_exec(av[0], "ddddd", parent_pipe[0],
 				      parent_pipe[1], child_pipe[0],
diff --git a/testcases/kernel/syscalls/fcntl/fcntl14.c b/testcases/kernel/syscalls/fcntl/fcntl14.c
index ca68d0f98..09f5f0954 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl14.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl14.c
@@ -738,7 +738,7 @@ void dochild(void)
 		 * need some way to have fcntl() atomically unblock a
 		 * signal and wait for the lock.)
 		 */
-		pid = FORK_OR_VFORK();
+		pid = tst_fork();
 		switch (pid) {
 		case -1:
 			tst_resm(TFAIL, "Fork failed");
@@ -828,7 +828,7 @@ void run_test(int file_flag, int file_mode, int seek, int start, int end)
 		/* flush the stdout to avoid garbled output */
 		fflush(stdout);
 
-		if ((child = FORK_OR_VFORK()) == 0) {
+		if ((child = tst_fork()) == 0) {
 #ifdef UCLINUX
 			if (self_exec(argv0, "nddddddddd", 2, thiscase->c_type,
 				      thiscase->c_whence, thiscase->c_start,
@@ -1079,7 +1079,7 @@ int main(int ac, char **av)
 		if (sighold(SIGUSR1) < 0)
 			tst_brkm(TBROK, cleanup, "sighold failed");
 
-		if ((child = FORK_OR_VFORK()) == 0) {
+		if ((child = tst_fork()) == 0) {
 #ifdef UCLINUX
 			if (self_exec(argv0, "nddddddddd", 2, thiscase->c_type,
 				      thiscase->c_whence, thiscase->c_start,
diff --git a/testcases/kernel/syscalls/fcntl/fcntl16.c b/testcases/kernel/syscalls/fcntl/fcntl16.c
index a77a81298..2d895edd2 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl16.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl16.c
@@ -497,7 +497,7 @@ int run_test(int file_flag, int file_mode, int start, int end)
 		/* spawn child processes */
 		for (i = 0; i < 2; i++) {
 			if (thislock->l_type != IGNORED) {
-				if ((child = FORK_OR_VFORK()) == 0) {
+				if ((child = tst_fork()) == 0) {
 #ifdef UCLINUX
 					if (self_exec(argv0, "ddddd", i, parent,
 						      test, thislock, fd) < 0) {
diff --git a/testcases/kernel/syscalls/fcntl/fcntl17.c b/testcases/kernel/syscalls/fcntl/fcntl17.c
index e055f1a12..35769579f 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl17.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl17.c
@@ -467,7 +467,7 @@ int main(int ac, char **av)
 		tst_count = 0;
 
 		tst_resm(TINFO, "Enter preparation phase");
-		if ((child_pid1 = FORK_OR_VFORK()) == 0) {	/* first child */
+		if ((child_pid1 = tst_fork()) == 0) {	/* first child */
 #ifdef UCLINUX
 			if (self_exec(av[0], "nddddddddd", 1, file_fd,
 				      parent_pipe[0], parent_pipe[1],
diff --git a/testcases/kernel/syscalls/fcntl/fcntl18.c b/testcases/kernel/syscalls/fcntl/fcntl18.c
index 1105dd393..6bf39b981 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl18.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl18.c
@@ -123,7 +123,7 @@ int main(int ac, char **av)
 /* //block3: */
 	tst_resm(TINFO, "Enter block 3");
 	fail = 0;
-	if ((pid = FORK_OR_VFORK()) == 0) {	/* child */
+	if ((pid = tst_fork()) == 0) {	/* child */
 		fail = 0;
 		pass = getpwnam("nobody");
 		retval = setreuid(-1, pass->pw_uid);
diff --git a/testcases/kernel/syscalls/fcntl/fcntl19.c b/testcases/kernel/syscalls/fcntl/fcntl19.c
index f929aff99..368629d25 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl19.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl19.c
@@ -296,7 +296,7 @@ int main(int ac, char **av)
 		/* reset tst_count in case we are looping */
 		tst_count = 0;
 
-		if ((child_pid = FORK_OR_VFORK()) == 0) {	/* child */
+		if ((child_pid = tst_fork()) == 0) {	/* child */
 #ifdef UCLINUX
 			if (self_exec
 			    (av[0], "ddddd", parent_pipe[0], parent_pipe[1],
diff --git a/testcases/kernel/syscalls/fcntl/fcntl20.c b/testcases/kernel/syscalls/fcntl/fcntl20.c
index 4aa773451..0865140de 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl20.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl20.c
@@ -295,7 +295,7 @@ int main(int ac, char **av)
 		/* reset tst_count in case we are looping */
 		tst_count = 0;
 
-		if ((child_pid = FORK_OR_VFORK()) == 0) {	/* child */
+		if ((child_pid = tst_fork()) == 0) {	/* child */
 #ifdef UCLINUX
 			if (self_exec
 			    (av[0], "ddddd", parent_pipe[0], parent_pipe[1],
diff --git a/testcases/kernel/syscalls/fcntl/fcntl21.c b/testcases/kernel/syscalls/fcntl/fcntl21.c
index 824b8c059..d191a6bbd 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl21.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl21.c
@@ -303,7 +303,7 @@ int main(int ac, char **av)
 		/* reset tst_count in case we are looping */
 		tst_count = 0;
 
-		if ((child_pid = FORK_OR_VFORK()) == 0) {
+		if ((child_pid = tst_fork()) == 0) {
 #ifdef UCLINUX
 			if (self_exec
 			    (av[0], "ddddd", parent_pipe[0], parent_pipe[1],
diff --git a/testcases/kernel/syscalls/fcntl/fcntl22.c b/testcases/kernel/syscalls/fcntl/fcntl22.c
index 2e94a1257..507934389 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl22.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl22.c
@@ -60,7 +60,7 @@ int main(int ac, char **av)
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
 		tst_count = 0;
 
-		child_pid = FORK_OR_VFORK();
+		child_pid = tst_fork();
 		switch (child_pid) {
 		case 0:
 			TEST(fcntl(file, F_SETLK, &fl));
diff --git a/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c b/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
index 84e338437..572e43409 100644
--- a/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
+++ b/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
@@ -154,7 +154,7 @@ int main(int argc, char **argv)
 
 	for (i = 0; i < nprocs; i++) {
 		fflush(stdout);
-		if ((pid = FORK_OR_VFORK()) < 0) {
+		if ((pid = tst_fork()) < 0) {
 			tst_brkm(TFAIL,
 				 NULL,
 				 "\tFork failed (may be OK if under stress)");
@@ -216,7 +216,7 @@ static int dotest(key_t key, int child_process)
 	sigrelse(SIGTERM);
 
 	fflush(stdout);
-	if ((pid = FORK_OR_VFORK()) < 0) {
+	if ((pid = tst_fork()) < 0) {
 		printf("\tFork failed (may be OK if under stress)\n");
 		TEST(msgctl(tid, IPC_RMID, 0));
 		if (TEST_RETURN < 0) {
diff --git a/testcases/kernel/syscalls/ipc/msgstress/msgstress02.c b/testcases/kernel/syscalls/ipc/msgstress/msgstress02.c
index a0f894b05..ad3b0e309 100644
--- a/testcases/kernel/syscalls/ipc/msgstress/msgstress02.c
+++ b/testcases/kernel/syscalls/ipc/msgstress/msgstress02.c
@@ -164,7 +164,7 @@ int main(int argc, char **argv)
 
 	for (i = 0; i < nprocs; i++) {
 		fflush(stdout);
-		if ((pid = FORK_OR_VFORK()) < 0) {
+		if ((pid = tst_fork()) < 0) {
 			tst_brkm(TFAIL,
 				 NULL,
 				 "\tFork failed (may be OK if under stress)");
@@ -249,7 +249,7 @@ static int dotest(key_t key, int child_process)
 
 	for (i = 0; i < nkids; i++) {
 		fflush(stdout);
-		if ((pid = FORK_OR_VFORK()) < 0) {
+		if ((pid = tst_fork()) < 0) {
 			printf("Fork failure in the first child of child group %d\n",
 				child_process);
 			cleanup_msgqueue(i, tid);
@@ -263,7 +263,7 @@ static int dotest(key_t key, int child_process)
 		}
 		rkidarray[i] = pid;
 		fflush(stdout);
-		if ((pid = FORK_OR_VFORK()) < 0) {
+		if ((pid = tst_fork()) < 0) {
 			printf("Fork failure in the second child of child group %d\n",
 				child_process);
 			/*
diff --git a/testcases/kernel/syscalls/ipc/msgstress/msgstress03.c b/testcases/kernel/syscalls/ipc/msgstress/msgstress03.c
index aa37d9058..3ddd47be8 100644
--- a/testcases/kernel/syscalls/ipc/msgstress/msgstress03.c
+++ b/testcases/kernel/syscalls/ipc/msgstress/msgstress03.c
@@ -160,7 +160,7 @@ int main(int argc, char **argv)
 
 	for (i = 0; i < nprocs; i++) {
 		fflush(stdout);
-		if ((pid = FORK_OR_VFORK()) < 0) {
+		if ((pid = tst_fork()) < 0) {
 			tst_brkm(TFAIL,
 				 NULL,
 				 "\tFork failed (may be OK if under stress)");
@@ -221,7 +221,7 @@ static int dotest(key_t key, int child_process)
 	sigrelse(SIGTERM);
 
 	fflush(stdout);
-	if ((pid = FORK_OR_VFORK()) < 0) {
+	if ((pid = tst_fork()) < 0) {
 		printf("Fork failed (may be OK if under stress)\n");
 		TEST(msgctl(tid, IPC_RMID, 0));
 		if (TEST_RETURN < 0) {
diff --git a/testcases/kernel/syscalls/ipc/msgstress/msgstress04.c b/testcases/kernel/syscalls/ipc/msgstress/msgstress04.c
index b9ebf9035..bcbcf770a 100644
--- a/testcases/kernel/syscalls/ipc/msgstress/msgstress04.c
+++ b/testcases/kernel/syscalls/ipc/msgstress/msgstress04.c
@@ -200,7 +200,7 @@ static void dotest_iteration(int off)
 	for (i = 0; i < nprocs; i++) {
 		key = keyarray[off + i];
 
-		if ((pid = FORK_OR_VFORK()) < 0)
+		if ((pid = tst_fork()) < 0)
 			tst_brkm(TFAIL, cleanup,
 				 "Fork failed (may be OK if under stress)");
 
@@ -275,7 +275,7 @@ static int dotest(key_t key, int child_process)
 	exit_status = PASS;
 
 	for (i = 0; i < nkids; i++) {
-		if ((pid = FORK_OR_VFORK()) < 0) {
+		if ((pid = tst_fork()) < 0) {
 			printf("Fork failure in the first child of child group %d\n",
 				child_process);
 			cleanup_msgqueue(i, tid);
@@ -288,7 +288,7 @@ static int dotest(key_t key, int child_process)
 					child_process, nreps));
 		}
 		rkidarray[i] = pid;
-		if ((pid = FORK_OR_VFORK()) < 0) {
+		if ((pid = tst_fork()) < 0) {
 			printf("Fork failure in the second child of child group %d\n",
 				child_process);
 			/*
diff --git a/testcases/kernel/syscalls/ipc/semctl/semctl06.c b/testcases/kernel/syscalls/ipc/semctl/semctl06.c
index b3af41fb3..b00ee89d2 100644
--- a/testcases/kernel/syscalls/ipc/semctl/semctl06.c
+++ b/testcases/kernel/syscalls/ipc/semctl/semctl06.c
@@ -112,7 +112,7 @@ int main(int argc, char **argv)
 	}
 
 	for (i = 0; i < NPROCS; i++) {
-		if ((pid = FORK_OR_VFORK()) < 0) {
+		if ((pid = tst_fork()) < 0) {
 			tst_resm(TFAIL,
 				 "\tFork failed (may be OK if under stress)");
 
@@ -188,7 +188,7 @@ static void dotest(key_t key)
 	}
 
 	for (i = 0; i < NKIDS; i++) {
-		if ((pid = FORK_OR_VFORK()) < 0) {
+		if ((pid = tst_fork()) < 0) {
 			tst_resm(TFAIL, "\tfork failed");
 		}
 		if (pid == 0)
diff --git a/testcases/kernel/syscalls/kill/kill02.c b/testcases/kernel/syscalls/kill/kill02.c
index 7ae2427c8..21aacffa1 100644
--- a/testcases/kernel/syscalls/kill/kill02.c
+++ b/testcases/kernel/syscalls/kill/kill02.c
@@ -231,8 +231,8 @@ int main(int ac, char **av)
 
 		tst_count = 0;
 
-		if ((pid1 = FORK_OR_VFORK()) > 0) {
-			if ((pid2 = FORK_OR_VFORK()) > 0) {
+		if ((pid1 = tst_fork()) > 0) {
+			if ((pid2 = tst_fork()) > 0) {
 				(void)parent_rout();
 			} else if (pid2 == 0) {
 #ifdef UCLINUX
@@ -452,11 +452,11 @@ void child1_rout(void)
 	/*
 	 *  Create children A & B.
 	 */
-	if ((pidA = FORK_OR_VFORK()) > 0) {
+	if ((pidA = tst_fork()) > 0) {
 		/*
 		 *  This is the parent(child1), fork again to create child B.
 		 */
-		if ((pidB = FORK_OR_VFORK()) == 0) {
+		if ((pidB = tst_fork()) == 0) {
 			/* This is child B. */
 #ifdef UCLINUX
 			if (self_exec(argv0, "nd", 2, pipeB_fd[1]) < 0) {
diff --git a/testcases/kernel/syscalls/kill/kill07.c b/testcases/kernel/syscalls/kill/kill07.c
index c566a0a09..21dd7ff4f 100644
--- a/testcases/kernel/syscalls/kill/kill07.c
+++ b/testcases/kernel/syscalls/kill/kill07.c
@@ -124,7 +124,7 @@ int main(int ac, char **av)
 		/* setup the signal handler */
 		ret = sigaction(TEST_SIG, &my_act, &old_act);
 
-		pid = FORK_OR_VFORK();
+		pid = tst_fork();
 		if (pid < 0) {
 			tst_brkm(TBROK, cleanup, "Fork of child failed");
 		} else if (pid == 0) {
diff --git a/testcases/kernel/syscalls/kill/kill08.c b/testcases/kernel/syscalls/kill/kill08.c
index b0826c2e5..d75a4db46 100644
--- a/testcases/kernel/syscalls/kill/kill08.c
+++ b/testcases/kernel/syscalls/kill/kill08.c
@@ -95,13 +95,13 @@ int main(int ac, char **av)
 		/* Fork a process and set the process group so that */
 		/* it is different from this one.  Fork 5 more children. */
 
-		pid1 = FORK_OR_VFORK();
+		pid1 = tst_fork();
 		if (pid1 < 0) {
 			tst_brkm(TBROK, cleanup, "Fork of first child failed");
 		} else if (pid1 == 0) {
 			setpgrp();
 			for (i = 0; i < 5; i++) {
-				pid2 = FORK_OR_VFORK();
+				pid2 = tst_fork();
 				if (pid2 < 0) {
 					tst_brkm(TBROK, cleanup, "Fork failed");
 				} else if (pid2 == 0) {
diff --git a/testcases/kernel/syscalls/kill/kill09.c b/testcases/kernel/syscalls/kill/kill09.c
index c5878923c..ad93c5d81 100644
--- a/testcases/kernel/syscalls/kill/kill09.c
+++ b/testcases/kernel/syscalls/kill/kill09.c
@@ -145,7 +145,7 @@ int main(int ac, char **av)
 
 		tst_count = 0;
 
-		if ((fork_pid = FORK_OR_VFORK()) == -1)
+		if ((fork_pid = tst_fork()) == -1)
 			tst_brkm(TBROK | TERRNO, cleanup, "fork failed");
 
 		if (fork_pid == 0) {
diff --git a/testcases/kernel/syscalls/kill/kill12.c b/testcases/kernel/syscalls/kill/kill12.c
index 8ab641d39..f864bdcb6 100644
--- a/testcases/kernel/syscalls/kill/kill12.c
+++ b/testcases/kernel/syscalls/kill/kill12.c
@@ -95,7 +95,7 @@ int main(int argc, char **argv)
 		fflush(temp);
 		chflag = 0;
 
-		pid = FORK_OR_VFORK();
+		pid = tst_fork();
 		if (pid < 0) {
 			forkfail();
 		}
diff --git a/testcases/kernel/syscalls/modify_ldt/modify_ldt02.c b/testcases/kernel/syscalls/modify_ldt/modify_ldt02.c
index f911aa5fd..5113b3fb4 100644
--- a/testcases/kernel/syscalls/modify_ldt/modify_ldt02.c
+++ b/testcases/kernel/syscalls/modify_ldt/modify_ldt02.c
@@ -119,7 +119,7 @@ int main(int ac, char **av)
 		}
 
 		tst_old_flush();
-		if ((pid = FORK_OR_VFORK()) == 0) {
+		if ((pid = tst_fork()) == 0) {
 			signal(SIGSEGV, SIG_DFL);
 			val = read_segment(0);
 			exit(1);
diff --git a/testcases/kernel/syscalls/mprotect/mprotect02.c b/testcases/kernel/syscalls/mprotect/mprotect02.c
index af282bba7..de894868f 100644
--- a/testcases/kernel/syscalls/mprotect/mprotect02.c
+++ b/testcases/kernel/syscalls/mprotect/mprotect02.c
@@ -89,7 +89,7 @@ int main(int ac, char **av)
 		addr = SAFE_MMAP(cleanup, 0, sizeof(buf), PROT_READ,
 				 MAP_SHARED, fd, 0);
 
-		if ((pid = FORK_OR_VFORK()) == -1)
+		if ((pid = tst_fork()) == -1)
 			tst_brkm(TBROK | TERRNO, cleanup, "fork #1 failed");
 
 		if (pid == 0) {
@@ -118,7 +118,7 @@ int main(int ac, char **av)
 		TEST(mprotect(addr, sizeof(buf), PROT_WRITE));
 
 		if (TEST_RETURN != -1) {
-			if ((pid = FORK_OR_VFORK()) == -1)
+			if ((pid = tst_fork()) == -1)
 				tst_brkm(TBROK | TERRNO, cleanup,
 					 "fork #2 failed");
 
diff --git a/testcases/kernel/syscalls/mprotect/mprotect03.c b/testcases/kernel/syscalls/mprotect/mprotect03.c
index ed0c1a7de..8ef64f212 100644
--- a/testcases/kernel/syscalls/mprotect/mprotect03.c
+++ b/testcases/kernel/syscalls/mprotect/mprotect03.c
@@ -95,7 +95,7 @@ int main(int ac, char **av)
 		TEST(mprotect(addr, strlen(buf), PROT_READ));
 
 		if (TEST_RETURN != -1) {
-			if ((pid = FORK_OR_VFORK()) == -1) {
+			if ((pid = tst_fork()) == -1) {
 				tst_brkm(TBROK, cleanup, "fork failed");
 			}
 
diff --git a/testcases/kernel/syscalls/pause/pause02.c b/testcases/kernel/syscalls/pause/pause02.c
index 32b41bd7d..335bb3b35 100644
--- a/testcases/kernel/syscalls/pause/pause02.c
+++ b/testcases/kernel/syscalls/pause/pause02.c
@@ -54,7 +54,7 @@ int main(int ac, char **av)
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
 		tst_count = 0;
 
-		cpid = FORK_OR_VFORK();
+		cpid = tst_fork();
 		switch (cpid) {
 		case -1:
 			tst_brkm(TBROK, cleanup, "fork() failed");
diff --git a/testcases/kernel/syscalls/pause/pause03.c b/testcases/kernel/syscalls/pause/pause03.c
index b1503fc5c..4c30d9614 100644
--- a/testcases/kernel/syscalls/pause/pause03.c
+++ b/testcases/kernel/syscalls/pause/pause03.c
@@ -53,7 +53,7 @@ int main(int ac, char **av)
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
 		tst_count = 0;
 
-		if ((cpid = FORK_OR_VFORK()) == -1)
+		if ((cpid = tst_fork()) == -1)
 			tst_brkm(TBROK | TERRNO, NULL, "fork() failed");
 
 		if (cpid == 0) {
diff --git a/testcases/kernel/syscalls/pipe/pipe04.c b/testcases/kernel/syscalls/pipe/pipe04.c
index a3c56e337..047fdb523 100644
--- a/testcases/kernel/syscalls/pipe/pipe04.c
+++ b/testcases/kernel/syscalls/pipe/pipe04.c
@@ -98,7 +98,7 @@ int main(int ac, char **av)
 
 		SAFE_PIPE(cleanup, fildes);
 
-		if ((c1pid = FORK_OR_VFORK()) == -1)
+		if ((c1pid = tst_fork()) == -1)
 			tst_brkm(TBROK, cleanup, "fork() failed - "
 				 "errno %d", errno);
 		if (c1pid == 0)
@@ -110,7 +110,7 @@ int main(int ac, char **av)
 #else
 			c1func();
 #endif
-		if ((c2pid = FORK_OR_VFORK()) == -1)
+		if ((c2pid = tst_fork()) == -1)
 			tst_brkm(TBROK, cleanup, "fork() failed - "
 				 "errno %d", errno);
 		if (c2pid == 0)
diff --git a/testcases/kernel/syscalls/pipe/pipe09.c b/testcases/kernel/syscalls/pipe/pipe09.c
index a4b2f8231..86282de49 100644
--- a/testcases/kernel/syscalls/pipe/pipe09.c
+++ b/testcases/kernel/syscalls/pipe/pipe09.c
@@ -98,7 +98,7 @@ int main(int ac, char **av)
 			continue;
 		}
 
-		if ((fork_1 = FORK_OR_VFORK()) == -1) {
+		if ((fork_1 = tst_fork()) == -1) {
 			tst_brkm(TBROK, cleanup, "fork() #1 failed");
 		}
 
@@ -125,7 +125,7 @@ int main(int ac, char **av)
 			tst_brkm(TBROK, cleanup, "child exited abnormally");
 		}
 
-		if ((fork_2 = FORK_OR_VFORK()) == -1) {
+		if ((fork_2 = tst_fork()) == -1) {
 			tst_brkm(TBROK, cleanup, "fork() #2 failed");
 		}
 
diff --git a/testcases/kernel/syscalls/recv/recv01.c b/testcases/kernel/syscalls/recv/recv01.c
index 2f09864a5..64658ae32 100644
--- a/testcases/kernel/syscalls/recv/recv01.c
+++ b/testcases/kernel/syscalls/recv/recv01.c
@@ -240,7 +240,7 @@ pid_t start_server(struct sockaddr_in *sin0)
 	}
 	SAFE_GETSOCKNAME(cleanup, sfd, (struct sockaddr *)sin0, &slen);
 
-	switch ((pid = FORK_OR_VFORK())) {
+	switch ((pid = tst_fork())) {
 	case 0:		/* child */
 #ifdef UCLINUX
 		if (self_exec(argv0, "d", sfd) < 0)
diff --git a/testcases/kernel/syscalls/recvfrom/recvfrom01.c b/testcases/kernel/syscalls/recvfrom/recvfrom01.c
index 853d1cb9f..a05256003 100644
--- a/testcases/kernel/syscalls/recvfrom/recvfrom01.c
+++ b/testcases/kernel/syscalls/recvfrom/recvfrom01.c
@@ -269,7 +269,7 @@ pid_t start_server(struct sockaddr_in *sin0)
 	}
 	SAFE_GETSOCKNAME(cleanup, sfd, (struct sockaddr *)sin0, &slen);
 
-	switch ((pid = FORK_OR_VFORK())) {
+	switch ((pid = tst_fork())) {
 	case 0:		/* child */
 #ifdef UCLINUX
 		if (self_exec(argv0, "d", sfd) < 0) {
diff --git a/testcases/kernel/syscalls/rename/rename14.c b/testcases/kernel/syscalls/rename/rename14.c
index 726b35ce2..c0e96cef0 100644
--- a/testcases/kernel/syscalls/rename/rename14.c
+++ b/testcases/kernel/syscalls/rename/rename14.c
@@ -89,14 +89,14 @@ int main(int argc, char *argv[])
 	parent_pid = getpid();
 	tst_tmpdir();
 
-	pid = FORK_OR_VFORK();
+	pid = tst_fork();
 	if (pid < 0)
 		tst_brkm(TBROK, NULL, "fork() returned %d", pid);
 	if (pid == 0)
 		dochild1();
 
 	kidpid[0] = pid;
-	pid = FORK_OR_VFORK();
+	pid = tst_fork();
 	if (pid < 0) {
 		(void)kill(kidpid[0], SIGTERM);
 		(void)unlink("./rename14");
diff --git a/testcases/kernel/syscalls/send/send01.c b/testcases/kernel/syscalls/send/send01.c
index 2e0ae2177..1f97daf5f 100644
--- a/testcases/kernel/syscalls/send/send01.c
+++ b/testcases/kernel/syscalls/send/send01.c
@@ -185,7 +185,7 @@ static pid_t start_server(struct sockaddr_in *sin0)
 	}
 	SAFE_GETSOCKNAME(cleanup, sfd, (struct sockaddr *)sin0, &slen);
 
-	switch ((pid = FORK_OR_VFORK())) {
+	switch ((pid = tst_fork())) {
 	case 0:
 #ifdef UCLINUX
 		if (self_exec(argv0, "d", sfd) < 0)
diff --git a/testcases/kernel/syscalls/sendmsg/sendmsg01.c b/testcases/kernel/syscalls/sendmsg/sendmsg01.c
index cf6e74289..62477e56b 100644
--- a/testcases/kernel/syscalls/sendmsg/sendmsg01.c
+++ b/testcases/kernel/syscalls/sendmsg/sendmsg01.c
@@ -457,7 +457,7 @@ static pid_t start_server(struct sockaddr_in *sin0, struct sockaddr_un *sun0)
 		return -1;
 	}
 
-	switch ((pid = FORK_OR_VFORK())) {
+	switch ((pid = tst_fork())) {
 	case 0:
 #ifdef UCLINUX
 		if (self_exec(argv0, "dd", sfd, ufd) < 0)
diff --git a/testcases/kernel/syscalls/sendto/sendto01.c b/testcases/kernel/syscalls/sendto/sendto01.c
index 6fe0274ee..654e6057e 100644
--- a/testcases/kernel/syscalls/sendto/sendto01.c
+++ b/testcases/kernel/syscalls/sendto/sendto01.c
@@ -255,7 +255,7 @@ static pid_t start_server(struct sockaddr_in *sin0)
 	}
 	SAFE_GETSOCKNAME(cleanup, sfd, (struct sockaddr *)sin0, &slen);
 
-	switch ((pid = FORK_OR_VFORK())) {
+	switch ((pid = tst_fork())) {
 	case 0:
 #ifdef UCLINUX
 		if (self_exec(argv0, "d", sfd) < 0)
diff --git a/testcases/kernel/syscalls/setfsuid/setfsuid04.c b/testcases/kernel/syscalls/setfsuid/setfsuid04.c
index 8585d6207..e1525a731 100644
--- a/testcases/kernel/syscalls/setfsuid/setfsuid04.c
+++ b/testcases/kernel/syscalls/setfsuid/setfsuid04.c
@@ -62,7 +62,7 @@ int main(int ac, char **av)
 
 	setup();
 
-	pid = FORK_OR_VFORK();
+	pid = tst_fork();
 	if (pid < 0)
 		tst_brkm(TBROK, cleanup, "Fork failed");
 
@@ -106,7 +106,7 @@ static void do_master_child(void)
 	/* Test 2: Check a son process cannot open the file
 	 *         with RDWR permissions.
 	 */
-	pid = FORK_OR_VFORK();
+	pid = tst_fork();
 	if (pid < 0) {
 		perror("Fork failed");
 		exit(TFAIL);
diff --git a/testcases/kernel/syscalls/setpgid/setpgid01.c b/testcases/kernel/syscalls/setpgid/setpgid01.c
index 89c9a3779..60034e016 100644
--- a/testcases/kernel/syscalls/setpgid/setpgid01.c
+++ b/testcases/kernel/syscalls/setpgid/setpgid01.c
@@ -108,7 +108,7 @@ static void setpgid_test2(void)
 	int ret;
 	pid_t pgid, pid;
 
-	pid = FORK_OR_VFORK();
+	pid = tst_fork();
 	if (pid == -1)
 		tst_brkm(TBROK | TERRNO, cleanup, "fork()");
 
diff --git a/testcases/kernel/syscalls/setpgrp/setpgrp01.c b/testcases/kernel/syscalls/setpgrp/setpgrp01.c
index 3fdb8cb4c..543106f14 100644
--- a/testcases/kernel/syscalls/setpgrp/setpgrp01.c
+++ b/testcases/kernel/syscalls/setpgrp/setpgrp01.c
@@ -92,7 +92,7 @@ void setup(void)
 	 * Make sure current process is NOT a session or pgrp leader
 	 */
 	if (getpgrp() == getpid()) {
-		if ((pid = FORK_OR_VFORK()) == -1) {
+		if ((pid = tst_fork()) == -1) {
 			tst_brkm(TBROK, cleanup,
 				 "fork() in setup() failed - errno %d", errno);
 		}
diff --git a/testcases/kernel/syscalls/setrlimit/setrlimit01.c b/testcases/kernel/syscalls/setrlimit/setrlimit01.c
index 7b133ef9e..188d310b2 100644
--- a/testcases/kernel/syscalls/setrlimit/setrlimit01.c
+++ b/testcases/kernel/syscalls/setrlimit/setrlimit01.c
@@ -134,7 +134,7 @@ static void test2(void)
 	 * output will be saved to the logfile (instead of stdout)
 	 * when the testcase (parent) is run from the driver.
 	 */
-	pid = FORK_OR_VFORK();
+	pid = tst_fork();
 	if (pid == -1)
 		tst_brkm(TBROK, cleanup, "fork() failed");
 
@@ -218,7 +218,7 @@ static void test3(void)
 	}
 
 	for (i = 0; i < 20; i++) {
-		pid = FORK_OR_VFORK();
+		pid = tst_fork();
 		if (pid == -1) {
 			if (errno != EAGAIN) {
 				tst_resm(TWARN, "Expected EAGAIN got %d",
@@ -251,7 +251,7 @@ static void test4(void)
 		return;
 	}
 
-	pid = FORK_OR_VFORK();
+	pid = tst_fork();
 	if (pid == -1)
 		tst_brkm(TBROK, cleanup, "fork() failed");
 
diff --git a/testcases/kernel/syscalls/setsid/setsid01.c b/testcases/kernel/syscalls/setsid/setsid01.c
index 08a7e2595..5df2c1ff4 100644
--- a/testcases/kernel/syscalls/setsid/setsid01.c
+++ b/testcases/kernel/syscalls/setsid/setsid01.c
@@ -90,10 +90,10 @@ int main(int ac, char **av)
 		 * and then it attached itself to another process
 		 * group and tries to setsid
 		 */
-		pid = FORK_OR_VFORK();
+		pid = tst_fork();
 
 		if (pid == 0) {
-			if ((pid = FORK_OR_VFORK()) == -1) {
+			if ((pid = tst_fork()) == -1) {
 				tst_resm(TFAIL, "Fork failed");
 
 			}
@@ -161,7 +161,7 @@ void do_child_1(void)
 		exno = 1;
 	}
 
-	if ((pid = FORK_OR_VFORK()) == -1) {
+	if ((pid = tst_fork()) == -1) {
 		tst_brkm(TFAIL, NULL, "Fork failed");
 	}
 	if (pid == 0) {
diff --git a/testcases/kernel/syscalls/sigrelse/sigrelse01.c b/testcases/kernel/syscalls/sigrelse/sigrelse01.c
index 38086caa7..a9d509cba 100644
--- a/testcases/kernel/syscalls/sigrelse/sigrelse01.c
+++ b/testcases/kernel/syscalls/sigrelse/sigrelse01.c
@@ -208,7 +208,7 @@ int main(int argc, char **argv)
 		/*
 		 * fork off a child process
 		 */
-		if ((pid = FORK_OR_VFORK()) < 0) {
+		if ((pid = tst_fork()) < 0) {
 			tst_brkm(TBROK | TERRNO, cleanup, "fork() failed");
 
 		} else if (pid > 0) {
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 06/31] lib/parse_opts.c: Remove UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (4 preceding siblings ...)
  2024-04-11 14:29 ` [LTP] [PATCH 05/31] tree: Remove FORK_OR_VFORK and tst_vfork() Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 14:30 ` [LTP] [PATCH 07/31] tlibio.c: " Petr Vorel
                   ` (25 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 lib/parse_opts.c | 23 ++---------------------
 1 file changed, 2 insertions(+), 21 deletions(-)

diff --git a/lib/parse_opts.c b/lib/parse_opts.c
index a9d50589a..03e833312 100644
--- a/lib/parse_opts.c
+++ b/lib/parse_opts.c
@@ -88,11 +88,6 @@ static struct std_option_t {
 	{"h", "  -h      Show this help screen\n", NULL, NULL},
 	{"i:", "  -i n    Execute test n times\n", NULL, NULL},
 	{"I:", "  -I x    Execute test for x seconds\n", NULL, NULL},
-#ifdef UCLINUX
-	{"C:",
-	      "  -C ARG  Run the child process with arguments ARG (for internal use)\n",
-		    NULL, NULL},
-#endif
 	{NULL, NULL, NULL, NULL}
 };
 
@@ -118,11 +113,6 @@ static void usc_recressive_func();
 #define OPT_duration		04
 #define OPT_delay		010
 
-#ifdef UCLINUX
-/* Allocated and used in self_exec.c: */
-extern char *child_args;	/* Arguments to child when -C is used */
-#endif
-
 static void print_help(void (*user_help)(void))
 {
 	int i;
@@ -219,11 +209,6 @@ const char *parse_opts(int ac, char **av, const option_t * user_optarr,
 			print_help(uhf);
 			exit(0);
 			break;
-#ifdef UCLINUX
-		case 'C':	/* Run child */
-			child_args = optarg;
-			break;
-#endif
 		default:
 
 			/* Check all the user specified options */
@@ -400,7 +385,7 @@ const char *parse_opts(int ac, char **av, const option_t * user_optarr,
 				     STD_TP_sbrk);
 		}
 	}
-#if !defined(UCLINUX)
+
 	if ((ptr = getenv("USC_LP_SBRK")) != NULL) {
 		if (sscanf(ptr, "%i", &k) == 1 && k >= 0) {
 			STD_LP_sbrk = k;
@@ -410,7 +395,6 @@ const char *parse_opts(int ac, char **av, const option_t * user_optarr,
 				     STD_LP_sbrk);
 		}
 	}
-#endif /* if !defined(UCLINUX) */
 
 	if ((ptr = getenv("USC_LP_RECFUN")) != NULL) {
 		if (sscanf(ptr, "%i", &k) == 1 && k >= 0) {
@@ -453,7 +437,6 @@ const char *parse_opts(int ac, char **av, const option_t * user_optarr,
  ***********************************************************************/
 int usc_global_setup_hook(void)
 {
-#ifndef UCLINUX
 	if (STD_TP_sbrk || STD_LP_sbrk)
 		STD_start_break = sbrk(0);	/* get original sbreak size */
 
@@ -462,7 +445,6 @@ int usc_global_setup_hook(void)
 		if (Debug)
 			printf("after sbrk(%d)\n", STD_TP_sbrk);
 	}
-#endif
 	return 0;
 }
 
@@ -538,13 +520,12 @@ int usc_test_looping(int counter)
 			     STD_LP_recfun);
 		usc_recressive_func(0, STD_LP_recfun, *STD_bigstack);
 	}
-#if !defined(UCLINUX)
+
 	if (STD_LP_sbrk) {
 		if (Debug)
 			printf("about to do sbrk(%d)\n", STD_LP_sbrk);
 		sbrk(STD_LP_sbrk);
 	}
-#endif
 
 	if (keepgoing)
 		return 1;
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 07/31] tlibio.c: Remove UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (5 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 06/31] lib/parse_opts.c: Remove UCLINUX Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 14:59   ` Cyril Hrubis
  2024-04-11 14:30 ` [LTP] [PATCH 08/31] clone02: " Petr Vorel
                   ` (24 subsequent siblings)
  31 siblings, 1 reply; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 lib/tlibio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/tlibio.c b/lib/tlibio.c
index bfb4ea023..ed82a85b4 100644
--- a/lib/tlibio.c
+++ b/lib/tlibio.c
@@ -108,7 +108,7 @@
 #include <string.h>
 #endif
 #if defined(__linux__) || defined(__sun) || defined(__hpux) || defined(_AIX)
-#if !defined(UCLINUX) && !defined(__UCLIBC__)
+#ifndef __UCLIBC__
 #include <aio.h>
 #endif
 #endif
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 08/31] clone02: Remove UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (6 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 07/31] tlibio.c: " Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 14:30 ` [LTP] [PATCH 09/31] connect01: " Petr Vorel
                   ` (23 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/clone/clone02.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/testcases/kernel/syscalls/clone/clone02.c b/testcases/kernel/syscalls/clone/clone02.c
index 42eea135a..821adc2d9 100644
--- a/testcases/kernel/syscalls/clone/clone02.c
+++ b/testcases/kernel/syscalls/clone/clone02.c
@@ -49,11 +49,6 @@
  *			test failed
  */
 
-#if defined UCLINUX && !__THROW
-/* workaround for libc bug */
-#define __THROW
-#endif
-
 #define _GNU_SOURCE
 
 #include <errno.h>
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 09/31] connect01: Remove UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (7 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 08/31] clone02: " Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 14:30 ` [LTP] [PATCH 10/31] creat06: " Petr Vorel
                   ` (22 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/connect/connect01.c | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/testcases/kernel/syscalls/connect/connect01.c b/testcases/kernel/syscalls/connect/connect01.c
index d901427ff..660c4f7a9 100644
--- a/testcases/kernel/syscalls/connect/connect01.c
+++ b/testcases/kernel/syscalls/connect/connect01.c
@@ -83,13 +83,10 @@ struct test_case_t {		/* test case structure */
 	PF_INET, SOCK_STREAM, 0, (struct sockaddr *)&sin1,
 		    sizeof(struct sockaddr_in), -1, EBADF, setup0,
 		    cleanup0, "bad file descriptor"},
-#ifndef UCLINUX
-	    /* Skip since uClinux does not implement memory protection */
 	{
 	PF_INET, SOCK_STREAM, 0, (struct sockaddr *)-1,
 		    sizeof(struct sockaddr_in), -1, EFAULT, setup1,
 		    cleanup1, "invalid socket buffer"},
-#endif
 	{
 	PF_INET, SOCK_STREAM, 0, (struct sockaddr *)&sin1,
 		    3, -1, EINVAL, setup1, cleanup1, "invalid salen"}, {
@@ -112,10 +109,6 @@ struct test_case_t {		/* test case structure */
 
 int TST_TOTAL = sizeof(tdat) / sizeof(tdat[0]);
 
-#ifdef UCLINUX
-static char *argv0;
-#endif
-
 /**
  * bionic's connect() implementation calls netdClientInitConnect() before
  * sending the request to the kernel.  We need to bypass this, or the test will
@@ -139,10 +132,6 @@ int main(int argc, char *argv[])
 	int lc;
 
 	tst_parse_opts(argc, argv, NULL, NULL);
-#ifdef UCLINUX
-	argv0 = argv[0];
-	maybe_run_child(&do_child, "d", &sfd);
-#endif
 
 	setup();
 
@@ -263,11 +252,7 @@ pid_t start_server(struct sockaddr_in *sin0)
 
 	switch ((pid = tst_fork())) {
 	case 0:		/* child */
-#ifdef UCLINUX
-		self_exec(argv0, "d", sfd);
-#else
 		do_child();
-#endif
 		break;
 	case -1:
 		tst_brkm(TBROK | TERRNO, cleanup, "server fork failed");
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 10/31] creat06: Remove UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (8 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 09/31] connect01: " Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 14:30 ` [LTP] [PATCH 11/31] fcntl: " Petr Vorel
                   ` (21 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/creat/creat06.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/testcases/kernel/syscalls/creat/creat06.c b/testcases/kernel/syscalls/creat/creat06.c
index 5c82e4757..bd9835ea3 100644
--- a/testcases/kernel/syscalls/creat/creat06.c
+++ b/testcases/kernel/syscalls/creat/creat06.c
@@ -60,9 +60,7 @@
 static void setup(void);
 static void test6_setup(void);
 static void test6_cleanup(void);
-#if !defined(UCLINUX)
 static void bad_addr_setup(int);
-#endif
 
 static struct passwd *ltpuser;
 static char long_name[PATH_MAX+2];
@@ -78,9 +76,7 @@ static struct test_case_t {
 	{long_name, MODE1, ENAMETOOLONG, NULL, NULL},
 	{NO_DIR, MODE1, ENOENT, NULL, NULL},
 	{NOT_DIR, MODE1, ENOTDIR, NULL, NULL},
-#if !defined(UCLINUX)
 	{NULL, MODE1, EFAULT, bad_addr_setup, NULL},
-#endif
 	{TEST6_FILE, MODE1, EACCES, test6_setup, test6_cleanup},
 	{TEST7_FILE, MODE1, ELOOP, NULL, NULL},
 	{TEST8_FILE, MODE1, EROFS, NULL, NULL},
@@ -127,7 +123,6 @@ static void setup(void)
 	SAFE_SYMLINK("test_file_eloop2", TEST7_FILE);
 }
 
-#if !defined(UCLINUX)
 static void bad_addr_setup(int i)
 {
 	if (tcases[i].fname)
@@ -136,7 +131,6 @@ static void bad_addr_setup(int i)
 	tcases[i].fname = SAFE_MMAP(0, 1, PROT_NONE,
 	                            MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
 }
-#endif
 
 static void test6_setup(void)
 {
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 11/31] fcntl: Remove UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (9 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 10/31] creat06: " Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 14:30 ` [LTP] [PATCH 12/31] semctl06: " Petr Vorel
                   ` (20 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/fcntl/fcntl11.c | 16 +-----
 testcases/kernel/syscalls/fcntl/fcntl14.c | 50 ++-----------------
 testcases/kernel/syscalls/fcntl/fcntl16.c | 29 +----------
 testcases/kernel/syscalls/fcntl/fcntl17.c | 59 ++---------------------
 testcases/kernel/syscalls/fcntl/fcntl18.c | 10 ----
 testcases/kernel/syscalls/fcntl/fcntl19.c | 13 -----
 testcases/kernel/syscalls/fcntl/fcntl20.c | 16 +-----
 testcases/kernel/syscalls/fcntl/fcntl21.c | 18 +------
 8 files changed, 14 insertions(+), 197 deletions(-)

diff --git a/testcases/kernel/syscalls/fcntl/fcntl11.c b/testcases/kernel/syscalls/fcntl/fcntl11.c
index 2ad3aee5e..4fd9fcca9 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl11.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl11.c
@@ -245,10 +245,6 @@ int main(int ac, char **av)
 	int lc;
 
 	tst_parse_opts(ac, av, NULL, NULL);
-#ifdef UCLINUX
-	maybe_run_child(&do_child, "ddddd", &parent_pipe[0],
-			&parent_pipe[1], &child_pipe[0], &child_pipe[1], &fd);
-#endif
 
 	setup();		/* global setup */
 
@@ -257,17 +253,9 @@ int main(int ac, char **av)
 		/* reset tst_count in case we are looping */
 		tst_count = 0;
 
-		if ((child_pid = tst_fork()) == 0) {	/* parent */
-#ifdef UCLINUX
-			if (self_exec(av[0], "ddddd", parent_pipe[0],
-				      parent_pipe[1], child_pipe[0],
-				      child_pipe[1], fd) < 0)
-				tst_brkm(TBROK | TERRNO, cleanup,
-					 "self_exec failed");
-#else
+		if ((child_pid = tst_fork()) == 0) /* parent */
 			do_child();
-#endif
-		} else if (child_pid == -1)
+		else if (child_pid == -1)
 			tst_brkm(TBROK | TERRNO, cleanup, "fork failed");
 
 		SAFE_CLOSE(cleanup, parent_pipe[0]);
diff --git a/testcases/kernel/syscalls/fcntl/fcntl14.c b/testcases/kernel/syscalls/fcntl/fcntl14.c
index 09f5f0954..d38220951 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl14.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl14.c
@@ -547,10 +547,6 @@ char *TCID = "fcntl14";
 int TST_TOTAL = 1;
 int NO_NFS = 1;
 
-#ifdef UCLINUX
-static char *argv0;
-#endif
-
 void cleanup(void)
 {
 	tst_rmdir();
@@ -745,14 +741,7 @@ void dochild(void)
 			fail = 1;
 			break;
 		case 0:
-#ifdef UCLINUX
-			if (self_exec(argv0, "nd", 1, parent) < 0) {
-				tst_resm(TFAIL, "self_exec failed");
-				break;
-			}
-#else
 			do_usleep_child();
-#endif
 			break;
 
 		default:
@@ -828,19 +817,9 @@ void run_test(int file_flag, int file_mode, int seek, int start, int end)
 		/* flush the stdout to avoid garbled output */
 		fflush(stdout);
 
-		if ((child = tst_fork()) == 0) {
-#ifdef UCLINUX
-			if (self_exec(argv0, "nddddddddd", 2, thiscase->c_type,
-				      thiscase->c_whence, thiscase->c_start,
-				      thiscase->c_len, thiscase->c_flag,
-				      thiscase->a_type, fd, test, parent) < 0) {
-				tst_resm(TFAIL, "self_exec failed");
-				cleanup();
-			}
-#else
+		if ((child = tst_fork()) == 0)
 			dochild();
-#endif
-		}
+
 		if (child < 0)
 			tst_brkm(TBROK|TERRNO, cleanup, "Fork failed");
 
@@ -943,17 +922,6 @@ int main(int ac, char **av)
 	int lc;
 
 	tst_parse_opts(ac, av, NULL, NULL);
-#ifdef UCLINUX
-	argv0 = av[0];
-
-	maybe_run_child(&do_usleep_child, "nd", 1, &parent);
-	thiscase = malloc(sizeof(testcase));
-
-	maybe_run_child(&dochild, "nddddddddd", 2, &thiscase->c_type,
-			&thiscase->c_whence, &thiscase->c_start,
-			&thiscase->c_len, &thiscase->c_flag, &thiscase->a_type,
-			&fd, &test, &parent);
-#endif
 
 	setup();
 
@@ -1079,19 +1047,9 @@ int main(int ac, char **av)
 		if (sighold(SIGUSR1) < 0)
 			tst_brkm(TBROK, cleanup, "sighold failed");
 
-		if ((child = tst_fork()) == 0) {
-#ifdef UCLINUX
-			if (self_exec(argv0, "nddddddddd", 2, thiscase->c_type,
-				      thiscase->c_whence, thiscase->c_start,
-				      thiscase->c_len, thiscase->c_flag,
-				      thiscase->a_type, fd, test, parent) < 0) {
-				tst_resm(TFAIL, "self_exec failed");
-				cleanup();
-			}
-#else
+		if ((child = tst_fork()) == 0)
 			dochild();
-#endif
-		}
+
 		if (child < 0)
 			tst_brkm(TBROK|TERRNO, cleanup, "Fork failed");
 
diff --git a/testcases/kernel/syscalls/fcntl/fcntl16.c b/testcases/kernel/syscalls/fcntl/fcntl16.c
index 2d895edd2..4ae9e6e7a 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl16.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl16.c
@@ -279,10 +279,6 @@ extern void catch_int(int sig);	/* signal catching subroutine */
 char *TCID = "fcntl16";
 int TST_TOTAL = 1;
 
-#ifdef UCLINUX
-static char *argv0;
-#endif
-
 /*
  * cleanup - performs all the ONE TIME cleanup for this test at completion or
  *	premature exit
@@ -339,15 +335,6 @@ void dochild(int kid)
 	exit(0);
 }				/* end of child process */
 
-#ifdef UCLINUX
-static int kid_uc;
-
-void dochild_uc(void)
-{
-	dochild(kid_uc);
-}
-#endif
-
 void catch_alarm(int sig)
 {
 	alarm_flag = 1;
@@ -497,17 +484,8 @@ int run_test(int file_flag, int file_mode, int start, int end)
 		/* spawn child processes */
 		for (i = 0; i < 2; i++) {
 			if (thislock->l_type != IGNORED) {
-				if ((child = tst_fork()) == 0) {
-#ifdef UCLINUX
-					if (self_exec(argv0, "ddddd", i, parent,
-						      test, thislock, fd) < 0) {
-						perror("self_exec failed");
-						return 1;
-					}
-#else
+				if ((child = tst_fork()) == 0)
 					dochild(i);
-#endif
-				}
 				if (child < 0) {
 					perror("Fork failed");
 					return 1;
@@ -654,11 +632,6 @@ int main(int ac, char **av)
 	int lc;
 
 	tst_parse_opts(ac, av, NULL, NULL);
-#ifdef UCLINUX
-	maybe_run_child(dochild_uc, "ddddd", &kid_uc, &parent, &test,
-			&thislock, &fd);
-	argv0 = av[0];
-#endif
 
 	setup();		/* global setup */
 
diff --git a/testcases/kernel/syscalls/fcntl/fcntl17.c b/testcases/kernel/syscalls/fcntl/fcntl17.c
index 35769579f..5a52f0af3 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl17.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl17.c
@@ -438,23 +438,6 @@ int main(int ac, char **av)
 	int fail = 0;
 
 	tst_parse_opts(ac, av, NULL, NULL);
-#ifdef UCLINUX
-	maybe_run_child(&do_child1, "nddddddddd", 1, &file_fd,
-			&parent_pipe[0], &parent_pipe[1],
-			&child_pipe1[0], &child_pipe1[1],
-			&child_pipe2[0], &child_pipe2[1],
-			&child_pipe3[0], &child_pipe3[1]);
-	maybe_run_child(&do_child2, "nddddddddd", 2, &file_fd,
-			&parent_pipe[0], &parent_pipe[1],
-			&child_pipe1[0], &child_pipe1[1],
-			&child_pipe2[0], &child_pipe2[1],
-			&child_pipe3[0], &child_pipe3[1]);
-	maybe_run_child(&do_child3, "nddddddddd", 3, &file_fd,
-			&parent_pipe[0], &parent_pipe[1],
-			&child_pipe1[0], &child_pipe1[1],
-			&child_pipe2[0], &child_pipe2[1],
-			&child_pipe3[0], &child_pipe3[1]);
-#endif
 
 	if (setup()) {		/* global testup */
 		tst_resm(TINFO, "setup failed");
@@ -467,56 +450,22 @@ int main(int ac, char **av)
 		tst_count = 0;
 
 		tst_resm(TINFO, "Enter preparation phase");
-		if ((child_pid1 = tst_fork()) == 0) {	/* first child */
-#ifdef UCLINUX
-			if (self_exec(av[0], "nddddddddd", 1, file_fd,
-				      parent_pipe[0], parent_pipe[1],
-				      child_pipe1[0], child_pipe1[1],
-				      child_pipe2[0], child_pipe2[1],
-				      child_pipe3[0], child_pipe3[1]) < 0) {
-				perror("self_exec failed, child 1");
-				cleanup();
-			}
-#else
+		if ((child_pid1 = tst_fork()) == 0)	/* first child */
 			do_child1();
-#endif
-		} else if (child_pid1 < 0)
+		else if (child_pid1 < 0)
 			tst_brkm(TBROK|TERRNO, cleanup, "Fork failed: child 1");
 
 		/* parent */
 
-		if ((child_pid2 = fork()) == 0) {	/* second child */
-#ifdef UCLINUX
-			if (self_exec(av[0], "nddddddddd", 2, file_fd,
-				      parent_pipe[0], parent_pipe[1],
-				      child_pipe1[0], child_pipe1[1],
-				      child_pipe2[0], child_pipe2[1],
-				      child_pipe3[0], child_pipe3[1]) < 0) {
-				perror("self_exec failed, child 2");
-				cleanup();
-			}
-#else
+		if ((child_pid2 = fork()) == 0)	/* second child */
 			do_child2();
-#endif
-		} else if (child_pid2 < 0) {
+		else if (child_pid2 < 0)
 			tst_brkm(TBROK|TERRNO, cleanup, "Fork failed: child 2");
-		}
 
 		/* parent */
 
 		if ((child_pid3 = fork()) == 0) {	/* third child */
-#ifdef UCLINUX
-			if (self_exec(av[0], "nddddddddd", 3, file_fd,
-				      parent_pipe[0], parent_pipe[1],
-				      child_pipe1[0], child_pipe1[1],
-				      child_pipe2[0], child_pipe2[1],
-				      child_pipe3[0], child_pipe3[1]) < 0) {
-				perror("self_exec failed, child 3");
-				cleanup();
-			}
-#else
 			do_child3();
-#endif
 			do_child3();
 		} else if (child_pid3 < 0) {
 			tst_brkm(TBROK|TERRNO, cleanup, "Fork failed: child 3");
diff --git a/testcases/kernel/syscalls/fcntl/fcntl18.c b/testcases/kernel/syscalls/fcntl/fcntl18.c
index 6bf39b981..7a26f65a2 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl18.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl18.c
@@ -70,8 +70,6 @@ int main(int ac, char **av)
 	setup();		/* global setup */
 
 /* //block1: */
-#ifndef UCLINUX
-	/* Skip since uClinux does not implement memory protection */
 	tst_resm(TINFO, "Enter block 1");
 	fail = 0;
 	if ((fd = open("temp.dat", O_CREAT | O_RDWR, 0777)) < 0) {	//mode must be specified when O_CREATE is in the flag
@@ -93,13 +91,8 @@ int main(int ac, char **av)
 		tst_resm(TINFO, "Block 1 PASSED");
 	}
 	tst_resm(TINFO, "Exit block 1");
-#else
-	tst_resm(TINFO, "Skip block 1 on uClinux");
-#endif
 
 /* //block2: */
-#ifndef UCLINUX
-	/* Skip since uClinux does not implement memory protection */
 	tst_resm(TINFO, "Enter block 2");
 	fail = 0;
 	/* Error condition if address is bad */
@@ -116,9 +109,6 @@ int main(int ac, char **av)
 		tst_resm(TINFO, "Block 2 PASSED");
 	}
 	tst_resm(TINFO, "Exit block 2");
-#else
-	tst_resm(TINFO, "Skip block 2 on uClinux");
-#endif
 
 /* //block3: */
 	tst_resm(TINFO, "Enter block 3");
diff --git a/testcases/kernel/syscalls/fcntl/fcntl19.c b/testcases/kernel/syscalls/fcntl/fcntl19.c
index 368629d25..a58e921c3 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl19.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl19.c
@@ -284,10 +284,6 @@ int main(int ac, char **av)
 	int lc;
 
 	tst_parse_opts(ac, av, NULL, NULL);
-#ifdef UCLINUX
-	maybe_run_child(&do_child, "ddddd", &parent_pipe[0], &parent_pipe[1],
-			&child_pipe[0], &child_pipe[1], &fd);
-#endif
 
 	setup();		/* global setup */
 
@@ -297,16 +293,7 @@ int main(int ac, char **av)
 		tst_count = 0;
 
 		if ((child_pid = tst_fork()) == 0) {	/* child */
-#ifdef UCLINUX
-			if (self_exec
-			    (av[0], "ddddd", parent_pipe[0], parent_pipe[1],
-			     child_pipe[0], child_pipe[1], fd) < 0) {
-				tst_resm(TFAIL, "self_exec failed");
-				cleanup();
-			}
-#else
 			do_child();
-#endif
 		} else if (child_pid < 0) {
 			tst_resm(TFAIL, "Fork failed");
 			cleanup();
diff --git a/testcases/kernel/syscalls/fcntl/fcntl20.c b/testcases/kernel/syscalls/fcntl/fcntl20.c
index 0865140de..f271eeb2d 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl20.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl20.c
@@ -283,10 +283,6 @@ int main(int ac, char **av)
 	int lc;
 
 	tst_parse_opts(ac, av, NULL, NULL);
-#ifdef UCLINUX
-	maybe_run_child(&do_child, "ddddd", &parent_pipe[0], &parent_pipe[1],
-			&child_pipe[0], &child_pipe[1], &fd);
-#endif
 
 	setup();		/* global setup */
 
@@ -295,18 +291,8 @@ int main(int ac, char **av)
 		/* reset tst_count in case we are looping */
 		tst_count = 0;
 
-		if ((child_pid = tst_fork()) == 0) {	/* child */
-#ifdef UCLINUX
-			if (self_exec
-			    (av[0], "ddddd", parent_pipe[0], parent_pipe[1],
-			     child_pipe[0], child_pipe[1], fd) < 0) {
-				tst_resm(TFAIL, "self_exec failed");
-				cleanup();
-			}
-#else
+		if ((child_pid = tst_fork()) == 0)	/* child */
 			do_child();
-#endif
-		}
 
 		if (child_pid < 0) {
 			tst_resm(TFAIL, "Fork failed");
diff --git a/testcases/kernel/syscalls/fcntl/fcntl21.c b/testcases/kernel/syscalls/fcntl/fcntl21.c
index d191a6bbd..a262ae8dd 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl21.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl21.c
@@ -291,11 +291,6 @@ int main(int ac, char **av)
 	int lc;
 
 	tst_parse_opts(ac, av, NULL, NULL);
-#ifdef UCLINUX
-	maybe_run_child(&do_child, "ddddd", &parent_pipe[0], &parent_pipe[1],
-			&child_pipe[0], &child_pipe[1], &fd);
-#endif
-
 	setup();		/* global setup */
 
 	/* Check for looping state if -i option is given */
@@ -303,18 +298,9 @@ int main(int ac, char **av)
 		/* reset tst_count in case we are looping */
 		tst_count = 0;
 
-		if ((child_pid = tst_fork()) == 0) {
-#ifdef UCLINUX
-			if (self_exec
-			    (av[0], "ddddd", parent_pipe[0], parent_pipe[1],
-			     child_pipe[0], child_pipe[1], fd) < 0) {
-				tst_resm(TFAIL, "self_exec failed");
-				cleanup();
-			}
-#else
+		if ((child_pid = tst_fork()) == 0)
 			do_child();
-#endif
-		}
+
 		if (child_pid < 0) {
 			tst_resm(TFAIL, "Fork failed");
 			cleanup();
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 12/31] semctl06: Remove UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (10 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 11/31] fcntl: " Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 14:30 ` [LTP] [PATCH 13/31] kill: " Petr Vorel
                   ` (19 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/ipc/semctl/semctl06.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/testcases/kernel/syscalls/ipc/semctl/semctl06.c b/testcases/kernel/syscalls/ipc/semctl/semctl06.c
index b00ee89d2..b8734c2fa 100644
--- a/testcases/kernel/syscalls/ipc/semctl/semctl06.c
+++ b/testcases/kernel/syscalls/ipc/semctl/semctl06.c
@@ -44,11 +44,6 @@
 
 #define DEBUG 0
 
-#ifdef UCLINUX
-#define _GNU_SOURCE
-#include <stdio.h>
-#endif
-
 #include <sys/types.h>
 #include <sys/ipc.h>
 #include <sys/sem.h>
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 13/31] kill: Remove UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (11 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 12/31] semctl06: " Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 14:30 ` [LTP] [PATCH 14/31] madvise02: " Petr Vorel
                   ` (18 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/kill/kill02.c | 93 +------------------------
 testcases/kernel/syscalls/kill/kill07.c | 10 ---
 testcases/kernel/syscalls/kill/kill08.c | 11 ---
 testcases/kernel/syscalls/kill/kill09.c | 11 ---
 4 files changed, 1 insertion(+), 124 deletions(-)

diff --git a/testcases/kernel/syscalls/kill/kill02.c b/testcases/kernel/syscalls/kill/kill02.c
index 21aacffa1..776540b4e 100644
--- a/testcases/kernel/syscalls/kill/kill02.c
+++ b/testcases/kernel/syscalls/kill/kill02.c
@@ -203,28 +203,12 @@ void cleanup();
 char *TCID = "kill02";
 int TST_TOTAL = 2;
 
-#ifdef UCLINUX
-static char *argv0;
-void childA_rout_uclinux();
-void childB_rout_uclinux();
-#endif
-
 int main(int ac, char **av)
 {
 	int lc;
 
 	tst_parse_opts(ac, av, NULL, NULL);
 
-#ifdef UCLINUX
-	argv0 = av[0];
-
-	maybe_run_child(&childA_rout_uclinux, "nd", 1, &pipeA_fd[1]);
-	maybe_run_child(&childB_rout_uclinux, "nd", 2, &pipeB_fd[1]);
-	maybe_run_child(&child1_rout, "ndddddd", 3, &pipe1_fd[1], &pipe2_fd[1],
-			&pipeA_fd[0], &pipeA_fd[1], &pipeB_fd[0], &pipeB_fd[1]);
-	maybe_run_child(&child2_rout, "nd", 4, &pipe2_fd[1]);
-#endif
-
 	setup();
 
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
@@ -235,19 +219,7 @@ int main(int ac, char **av)
 			if ((pid2 = tst_fork()) > 0) {
 				(void)parent_rout();
 			} else if (pid2 == 0) {
-#ifdef UCLINUX
-				if (self_exec(argv0, "nd", 4, pipe2_fd[1]) < 0) {
-					if (kill(pid1, SIGKILL) == -1
-					    && errno != ESRCH) {
-						tst_resm(TWARN,
-							 "Child process may not have been killed.");
-					}
-					tst_brkm(TBROK | TERRNO, cleanup,
-						 "fork failed");
-				}
-#else
 				(void)child2_rout();
-#endif
 			} else {
 				/*
 				 *  The second fork failed kill the first child.
@@ -264,17 +236,7 @@ int main(int ac, char **av)
 			/*
 			 *  This is child 1.
 			 */
-#ifdef UCLINUX
-			if (self_exec
-			    (argv0, "ndddddd", 3, pipe1_fd[1], pipe2_fd[1],
-			     pipeA_fd[0], pipeA_fd[1], pipeB_fd[0],
-			     pipeB_fd[1]) < 0) {
-				tst_brkm(TBROK | TERRNO, cleanup,
-					 "self_exec() failed");
-			}
-#else
 			(void)child1_rout();
-#endif
 		} else {
 			/*
 			 * Fork failed.
@@ -456,18 +418,10 @@ void child1_rout(void)
 		/*
 		 *  This is the parent(child1), fork again to create child B.
 		 */
+
 		if ((pidB = tst_fork()) == 0) {
 			/* This is child B. */
-#ifdef UCLINUX
-			if (self_exec(argv0, "nd", 2, pipeB_fd[1]) < 0) {
-				tst_brkm(TBROK | TERRNO, NULL,
-					 "self_exec() failed");
-				(void)write(pipe1_fd[1], CHAR_SET_FAILED, 1);
-				exit(0);
-			}
-#else
 			(void)childB_rout();
-#endif
 		}
 
 		else if (pidB == -1) {
@@ -485,16 +439,7 @@ void child1_rout(void)
 
 	else if (pidA == 0) {
 		/* This is child A. */
-#ifdef UCLINUX
-		if (self_exec(argv0, "nd", 1, pipeA_fd[1]) < 0) {
-			tst_brkm(TBROK | TERRNO, NULL, "self_exec() failed");
-			(void)write(pipe1_fd[1], CHAR_SET_FAILED, 1);
-			exit(0);
-		}
-#else
 		(void)childA_rout();
-#endif
-
 	}
 
 	else if (pidA == -1) {
@@ -625,24 +570,6 @@ void childA_rout(void)
 	exit(0);
 }				/*End of childA_rout */
 
-#ifdef UCLINUX
-/*******************************************************************************
- *  This is the routine for child A after self_exec
- ******************************************************************************/
-void childA_rout_uclinux(void)
-{
-	/* Setup the signal handler again */
-	if (signal(SIGUSR1, usr1_rout) == SIG_ERR) {
-		tst_brkm(TBROK, NULL,
-			 "Could not set to catch the childrens signal.");
-		(void)write(pipeA_fd[1], CHAR_SET_FAILED, 1);
-		exit(0);
-	}
-
-	childA_rout();
-}
-#endif
-
 /*******************************************************************************
  *  This is the routine for child B, which should not receive the parents signal.
  ******************************************************************************/
@@ -667,24 +594,6 @@ void childB_rout(void)
 	exit(0);
 }
 
-#ifdef UCLINUX
-/*******************************************************************************
- *  This is the routine for child B after self_exec
- ******************************************************************************/
-void childB_rout_uclinux(void)
-{
-	/* Setup the signal handler again */
-	if (signal(SIGUSR1, usr1_rout) == SIG_ERR) {
-		tst_brkm(TBROK, NULL,
-			 "Could not set to catch the childrens signal.");
-		(void)write(pipeB_fd[1], CHAR_SET_FAILED, 1);
-		exit(0);
-	}
-
-	childB_rout();
-}
-#endif
-
 /*******************************************************************************
  *  This routine sets up the interprocess communication pipes, signal handling,
  *  and process group information.
diff --git a/testcases/kernel/syscalls/kill/kill07.c b/testcases/kernel/syscalls/kill/kill07.c
index 21dd7ff4f..ac4ebd941 100644
--- a/testcases/kernel/syscalls/kill/kill07.c
+++ b/testcases/kernel/syscalls/kill/kill07.c
@@ -91,9 +91,6 @@ int main(int ac, char **av)
 	struct sigaction my_act, old_act;
 
 	tst_parse_opts(ac, av, NULL, NULL);
-#ifdef UCLINUX
-	maybe_run_child(&do_child, "");
-#endif
 
 	setup();		/* global setup */
 
@@ -128,14 +125,7 @@ int main(int ac, char **av)
 		if (pid < 0) {
 			tst_brkm(TBROK, cleanup, "Fork of child failed");
 		} else if (pid == 0) {
-#ifdef UCLINUX
-			if (self_exec(av[0], "") < 0) {
-				tst_brkm(TBROK, cleanup,
-					 "self_exec of child failed");
-			}
-#else
 			do_child();
-#endif
 		} else {
 			/* sighandler should not catch this signal */
 			/* if it does flag will be set to 1 */
diff --git a/testcases/kernel/syscalls/kill/kill08.c b/testcases/kernel/syscalls/kill/kill08.c
index d75a4db46..9302f5470 100644
--- a/testcases/kernel/syscalls/kill/kill08.c
+++ b/testcases/kernel/syscalls/kill/kill08.c
@@ -78,9 +78,6 @@ int main(int ac, char **av)
 	int exno, status, nsig, i;
 
 	tst_parse_opts(ac, av, NULL, NULL);
-#ifdef UCLINUX
-	maybe_run_child(&do_child, "");
-#endif
 
 	setup();		/* global setup */
 
@@ -105,15 +102,7 @@ int main(int ac, char **av)
 				if (pid2 < 0) {
 					tst_brkm(TBROK, cleanup, "Fork failed");
 				} else if (pid2 == 0) {
-#ifdef UCLINUX
-					if (self_exec(av[0], "") < 0) {
-						tst_brkm(TBROK, cleanup,
-							 "self_exec of "
-							 "child failed");
-					}
-#else
 					do_child();
-#endif
 				}
 			}
 			/* Kill all processes in this process group */
diff --git a/testcases/kernel/syscalls/kill/kill09.c b/testcases/kernel/syscalls/kill/kill09.c
index ad93c5d81..c0b703119 100644
--- a/testcases/kernel/syscalls/kill/kill09.c
+++ b/testcases/kernel/syscalls/kill/kill09.c
@@ -135,10 +135,6 @@ int main(int ac, char **av)
 
 	tst_parse_opts(ac, av, NULL, NULL);
 
-#ifdef UCLINUX
-	maybe_run_child(&do_child, "");
-#endif
-
 	setup();
 
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
@@ -149,14 +145,7 @@ int main(int ac, char **av)
 			tst_brkm(TBROK | TERRNO, cleanup, "fork failed");
 
 		if (fork_pid == 0) {
-#ifdef UCLINUX
-			if (self_exec(av[0], "") < 0) {
-				tst_brkm(TBROK, cleanup,
-					 "self_exec of child failed");
-			}
-#else
 			do_child();
-#endif
 		}
 
 		TEST(kill(fork_pid, SIGKILL));
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 14/31] madvise02: Remove UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (12 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 13/31] kill: " Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 15:37   ` Cyril Hrubis
  2024-04-11 14:30 ` [LTP] [PATCH 15/31] mlockall: " Petr Vorel
                   ` (17 subsequent siblings)
  31 siblings, 1 reply; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

skip is now off by default for all cases.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/madvise/madvise02.c | 25 ++++++++-----------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/testcases/kernel/syscalls/madvise/madvise02.c b/testcases/kernel/syscalls/madvise/madvise02.c
index 90c0431c5..793bda98d 100644
--- a/testcases/kernel/syscalls/madvise/madvise02.c
+++ b/testcases/kernel/syscalls/madvise/madvise02.c
@@ -65,17 +65,17 @@ static struct tcase {
 	int exp_errno;
 	int skip;
 } tcases[] = {
-	{MADV_NORMAL,      "MADV_NORMAL",      &nonalign, EINVAL, 0},
-	{1212,             "MADV_NORMAL",      &file1,    EINVAL, 0},
-	{MADV_REMOVE,      "MADV_REMOVE",      &file1,    EINVAL, 0},
-	{MADV_DONTNEED,    "MADV_DONTNEED",    &file1,    EINVAL, 1},
-	{MADV_MERGEABLE,   "MADV_MERGEABLE",   &file1,    EINVAL, 0},
-	{MADV_UNMERGEABLE, "MADV_UNMERGEABLE", &file1,    EINVAL, 0},
-	{MADV_NORMAL,      "MADV_NORMAL",      &file2,    ENOMEM, 0},
-	{MADV_WILLNEED,    "MADV_WILLNEED",    &file2,    ENOMEM, 0},
-	{MADV_WILLNEED,    "MADV_WILLNEED",    &tmp_addr,  EBADF, 0},
-	{MADV_FREE,        "MADV_FREE",        &file1,    EINVAL, 0},
-	{MADV_WIPEONFORK,  "MADV_WIPEONFORK",  &file1,    EINVAL, 0},
+	{MADV_NORMAL,      "MADV_NORMAL",      &nonalign, EINVAL},
+	{1212,             "MADV_NORMAL",      &file1,    EINVAL},
+	{MADV_REMOVE,      "MADV_REMOVE",      &file1,    EINVAL},
+	{MADV_DONTNEED,    "MADV_DONTNEED",    &file1,    EINVAL},
+	{MADV_MERGEABLE,   "MADV_MERGEABLE",   &file1,    EINVAL},
+	{MADV_UNMERGEABLE, "MADV_UNMERGEABLE", &file1,    EINVAL},
+	{MADV_NORMAL,      "MADV_NORMAL",      &file2,    ENOMEM},
+	{MADV_WILLNEED,    "MADV_WILLNEED",    &file2,    ENOMEM},
+	{MADV_WILLNEED,    "MADV_WILLNEED",    &tmp_addr,  EBADF},
+	{MADV_FREE,        "MADV_FREE",        &file1,    EINVAL},
+	{MADV_WIPEONFORK,  "MADV_WIPEONFORK",  &file1,    EINVAL},
 	{MADV_WIPEONFORK,  "MADV_WIPEONFORK shared_anon", &shared_anon, EINVAL, 0},
 	{MADV_WIPEONFORK,  "MADV_WIPEONFORK private file backed", &file3, EINVAL, 0},
 };
@@ -89,11 +89,8 @@ static void tcases_filter(void)
 
 		switch (tc->advice) {
 		case MADV_DONTNEED:
-#if !defined(UCLINUX)
 			if (mlock(file1, st.st_size) < 0)
 				tst_brk(TBROK | TERRNO, "mlock failed");
-			tc->skip = 0;
-#endif /* if !defined(UCLINUX) */
 		break;
 		case MADV_MERGEABLE:
 		case MADV_UNMERGEABLE:
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 15/31] mlockall: Remove UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (13 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 14/31] madvise02: " Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 14:30 ` [LTP] [PATCH 16/31] munmap: " Petr Vorel
                   ` (16 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/mlockall/mlockall01.c | 12 ------------
 testcases/kernel/syscalls/mlockall/mlockall02.c | 12 ------------
 testcases/kernel/syscalls/mlockall/mlockall03.c | 12 ------------
 3 files changed, 36 deletions(-)

diff --git a/testcases/kernel/syscalls/mlockall/mlockall01.c b/testcases/kernel/syscalls/mlockall/mlockall01.c
index fa43dad33..50cdfc256 100644
--- a/testcases/kernel/syscalls/mlockall/mlockall01.c
+++ b/testcases/kernel/syscalls/mlockall/mlockall01.c
@@ -75,8 +75,6 @@ void cleanup();
 char *TCID = "mlockall01";
 int TST_TOTAL = 3;
 
-#if !defined(UCLINUX)
-
 struct test_case_t {
 	int flag;
 	char *fdesc;
@@ -127,16 +125,6 @@ int main(int ac, char **av)
 	tst_exit();
 }
 
-#else
-
-int main(void)
-{
-	tst_resm(TINFO, "test is not available on uClinux");
-	tst_exit();
-}
-
-#endif
-
 /*
  * setup() - performs all ONE TIME setup for this test.
  */
diff --git a/testcases/kernel/syscalls/mlockall/mlockall02.c b/testcases/kernel/syscalls/mlockall/mlockall02.c
index 94d6e3270..6524cb4a8 100644
--- a/testcases/kernel/syscalls/mlockall/mlockall02.c
+++ b/testcases/kernel/syscalls/mlockall/mlockall02.c
@@ -99,8 +99,6 @@ struct test_case_t {
 	0, EINVAL, "Unknown flag"}
 };
 
-#if !defined(UCLINUX)
-
 int main(int ac, char **av)
 {
 	int lc, i;
@@ -258,13 +256,3 @@ void cleanup(void)
 {
 	return;
 }
-
-#else
-
-int main(void)
-{
-	tst_resm(TINFO, "test is not available on uClinux");
-	tst_exit();
-}
-
-#endif /* if !defined(UCLINUX) */
diff --git a/testcases/kernel/syscalls/mlockall/mlockall03.c b/testcases/kernel/syscalls/mlockall/mlockall03.c
index 7418dd64d..a505891fc 100644
--- a/testcases/kernel/syscalls/mlockall/mlockall03.c
+++ b/testcases/kernel/syscalls/mlockall/mlockall03.c
@@ -92,8 +92,6 @@ void cleanup();
 char *TCID = "mlockall03";
 int TST_TOTAL = 3;
 
-#if !defined(UCLINUX)
-
 char *ref_release = "2.6.8\0";
 
 struct test_case_t {
@@ -286,16 +284,6 @@ void cleanup_test(int i)
 	}
 }
 
-#else
-
-int main(void)
-{
-	tst_resm(TINFO, "test is not available on uClinux");
-	tst_exit();
-}
-
-#endif /* if !defined(UCLINUX) */
-
 /*
  * cleanup() - performs all ONE TIME cleanup for this test at
  *		completion or premature exit.
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 16/31] munmap: Remove UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (14 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 15/31] mlockall: " Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 14:30 ` [LTP] [PATCH 17/31] writev05: " Petr Vorel
                   ` (15 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/munmap/munmap01.c | 18 ++----------------
 testcases/kernel/syscalls/munmap/munmap02.c | 18 ------------------
 2 files changed, 2 insertions(+), 34 deletions(-)

diff --git a/testcases/kernel/syscalls/munmap/munmap01.c b/testcases/kernel/syscalls/munmap/munmap01.c
index 7d10c0eac..dfd81fa2b 100644
--- a/testcases/kernel/syscalls/munmap/munmap01.c
+++ b/testcases/kernel/syscalls/munmap/munmap01.c
@@ -114,13 +114,7 @@ int main(int ac, char **av)
 				 TEST_ERRNO, strerror(TEST_ERRNO));
 			continue;
 		}
-#ifdef UCLINUX
-		/*
-		 * No SIGSEGV on uClinux since
-		 * MMU not implemented on uClinux
-		 */
-		tst_resm(TPASS, "call succedded");
-#else
+
 		/*
 		 * Check whether further reference is possible
 		 * to the unmapped memory region by writing
@@ -130,9 +124,7 @@ int main(int ac, char **av)
 		*addr = 50;
 
 		/* This message is printed if no SIGSEGV */
-		tst_resm(TFAIL, "process succeeds to refer unmapped "
-			 "memory region");
-#endif
+		tst_resm(TFAIL, "process succeeds to refer unmapped memory region");
 
 		cleanup();
 
@@ -195,14 +187,8 @@ void setup(void)
 	 * into the calling process's address space at the system choosen
 	 * with read/write permissions to the mapped region.
 	 */
-#ifdef UCLINUX
-	/* MAP_SHARED is not implemented on uClinux */
-	addr = mmap(0, map_len, PROT_READ | PROT_WRITE,
-		    MAP_FILE | MAP_PRIVATE, fildes, 0);
-#else
 	addr = mmap(0, map_len, PROT_READ | PROT_WRITE,
 		    MAP_FILE | MAP_SHARED, fildes, 0);
-#endif
 
 	/* check for the return value of mmap system call */
 	if (addr == (char *)MAP_FAILED) {
diff --git a/testcases/kernel/syscalls/munmap/munmap02.c b/testcases/kernel/syscalls/munmap/munmap02.c
index cd85d9436..311c0ea14 100644
--- a/testcases/kernel/syscalls/munmap/munmap02.c
+++ b/testcases/kernel/syscalls/munmap/munmap02.c
@@ -92,8 +92,6 @@ void setup();			/* Main setup function of test */
 void cleanup();			/* cleanup function for the test */
 void sig_handler();		/* signal catching function */
 
-#ifndef UCLINUX
-
 int main(int ac, char **av)
 {
 	int lc;
@@ -136,16 +134,6 @@ int main(int ac, char **av)
 	tst_exit();
 }
 
-#else
-
-int main(void)
-{
-	tst_resm(TINFO, "munmap02 test is not available on uClinux");
-	tst_exit();
-}
-
-#endif /* ifndef UCLINUX */
-
 /*
  * setup() - performs all ONE TIME setup for this test.
  * Setup signal handler to catch SIGSEGV.
@@ -199,14 +187,8 @@ void setup(void)
 	 * into the calling process's address space at the system choosen
 	 * with read/write permissions to the mapped region.
 	 */
-#ifdef UCLINUX
-	/* mmap() doesn't support MAP_SHARED on uClinux */
-	addr = mmap(0, map_len, PROT_READ | PROT_WRITE,
-		    MAP_FILE | MAP_PRIVATE, fildes, 0);
-#else
 	addr = mmap(0, map_len, PROT_READ | PROT_WRITE,
 		    MAP_FILE | MAP_SHARED, fildes, 0);
-#endif
 
 	/* check for the return value of mmap system call */
 	if (addr == (char *)MAP_FAILED) {
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 17/31] writev05: Remove UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (15 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 16/31] munmap: " Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 14:30 ` [LTP] [PATCH 18/31] pipe: " Petr Vorel
                   ` (14 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/writev/writev05.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/testcases/kernel/syscalls/writev/writev05.c b/testcases/kernel/syscalls/writev/writev05.c
index 6add2bcd4..3bee6f59c 100644
--- a/testcases/kernel/syscalls/writev/writev05.c
+++ b/testcases/kernel/syscalls/writev/writev05.c
@@ -83,8 +83,6 @@ long l_seek(int, long, int);
 void setup(void);
 void cleanup(void);
 
-#if !defined(UCLINUX)
-
 int main(int argc, char **argv)
 {
 	int lc;
@@ -178,16 +176,6 @@ int main(int argc, char **argv)
 
 }
 
-#else
-
-int main(void)
-{
-	tst_resm(TINFO, "test is not available on uClinux");
-	tst_exit();
-}
-
-#endif /* if !defined(UCLINUX) */
-
 /*
  * setup()
  *	performs all ONE TIME setup for this test
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 18/31] pipe: Remove UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (16 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 17/31] writev05: " Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 14:30 ` [LTP] [PATCH 19/31] pause: " Petr Vorel
                   ` (13 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/pipe/pipe02.c |  9 ---------
 testcases/kernel/syscalls/pipe/pipe04.c | 19 -------------------
 2 files changed, 28 deletions(-)

diff --git a/testcases/kernel/syscalls/pipe/pipe02.c b/testcases/kernel/syscalls/pipe/pipe02.c
index 2247037b1..d6cbff92d 100644
--- a/testcases/kernel/syscalls/pipe/pipe02.c
+++ b/testcases/kernel/syscalls/pipe/pipe02.c
@@ -41,10 +41,6 @@ static void verify_pipe(void)
 
 	memset(wrbuf, 'a', SIZE);
 
-#ifdef UCLINUX
-	maybe_run_child(&do_child, "dd", &fd[0], &fd[1]);
-#endif
-
 	TEST(pipe(fd));
 	if (TST_RET == -1) {
 		tst_res(TFAIL|TTERRNO, "pipe() failed");
@@ -53,12 +49,7 @@ static void verify_pipe(void)
 
 	pid = SAFE_FORK();
 	if (pid == 0) {
-#ifdef UCLINUX
-		if (self_exec(av[0], "dd", fd[0], fd[1]) < 0)
-			tst_brk(TBROK, "self_exec failed");
-#else
 		do_child();
-#endif
 	}
 
 	memset(rdbuf, 0, SIZE);
diff --git a/testcases/kernel/syscalls/pipe/pipe04.c b/testcases/kernel/syscalls/pipe/pipe04.c
index 047fdb523..219daecd8 100644
--- a/testcases/kernel/syscalls/pipe/pipe04.c
+++ b/testcases/kernel/syscalls/pipe/pipe04.c
@@ -84,11 +84,6 @@ int main(int ac, char **av)
 	char rbuf[BUFSIZ];
 
 	tst_parse_opts(ac, av, NULL, NULL);
-#ifdef UCLINUX
-	maybe_run_child(&c1func, "ndd", 1, &fildes[0], &fildes[1]);
-	maybe_run_child(&c2func, "ndd", 2, &fildes[0], &fildes[1]);
-#endif
-
 	setup();
 
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
@@ -102,26 +97,12 @@ int main(int ac, char **av)
 			tst_brkm(TBROK, cleanup, "fork() failed - "
 				 "errno %d", errno);
 		if (c1pid == 0)
-#ifdef UCLINUX
-			if (self_exec(av[0], "ndd", 1, fildes[0], fildes[1]) <
-			    0) {
-				tst_brkm(TBROK, cleanup, "self_exec failed");
-			}
-#else
 			c1func();
-#endif
 		if ((c2pid = tst_fork()) == -1)
 			tst_brkm(TBROK, cleanup, "fork() failed - "
 				 "errno %d", errno);
 		if (c2pid == 0)
-#ifdef UCLINUX
-			if (self_exec(av[0], "ndd", 2, fildes[0], fildes[1]) <
-			    0) {
-				tst_brkm(TBROK, cleanup, "self_exec failed");
-			}
-#else
 			c2func();
-#endif
 
 		/* PARENT */
 		if (close(fildes[1]) == -1)
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 19/31] pause: Remove UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (17 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 18/31] pipe: " Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 14:30 ` [LTP] [PATCH 20/31] recv*: " Petr Vorel
                   ` (12 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/pause/pause02.c |  9 ---------
 testcases/kernel/syscalls/pause/pause03.c | 11 +----------
 2 files changed, 1 insertion(+), 19 deletions(-)

diff --git a/testcases/kernel/syscalls/pause/pause02.c b/testcases/kernel/syscalls/pause/pause02.c
index 335bb3b35..0853232fd 100644
--- a/testcases/kernel/syscalls/pause/pause02.c
+++ b/testcases/kernel/syscalls/pause/pause02.c
@@ -45,10 +45,6 @@ int main(int ac, char **av)
 
 	tst_parse_opts(ac, av, NULL, NULL);
 
-#ifdef UCLINUX
-	maybe_run_child(&do_child, "");
-#endif
-
 	setup();
 
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
@@ -60,12 +56,7 @@ int main(int ac, char **av)
 			tst_brkm(TBROK, cleanup, "fork() failed");
 		break;
 		case 0:
-#ifdef UCLINUX
-			if (self_exec(av[0], "") < 0)
-				tst_brkm(TBROK, cleanup, "self_exec failed");
-#else
 			do_child();
-#endif
 		break;
 		default:
 		break;
diff --git a/testcases/kernel/syscalls/pause/pause03.c b/testcases/kernel/syscalls/pause/pause03.c
index 4c30d9614..459222045 100644
--- a/testcases/kernel/syscalls/pause/pause03.c
+++ b/testcases/kernel/syscalls/pause/pause03.c
@@ -44,9 +44,6 @@ int main(int ac, char **av)
 	int status;
 
 	tst_parse_opts(ac, av, NULL, NULL);
-#ifdef UCLINUX
-	maybe_run_child(&do_child, "");
-#endif
 
 	setup();
 
@@ -56,14 +53,8 @@ int main(int ac, char **av)
 		if ((cpid = tst_fork()) == -1)
 			tst_brkm(TBROK | TERRNO, NULL, "fork() failed");
 
-		if (cpid == 0) {
-#ifdef UCLINUX
-			if (self_exec(av[0], "") < 0)
-				tst_brkm(TBROK, cleanup, "self_exec failed");
-#else
+		if (cpid == 0)
 			do_child();
-#endif
-		}
 
 		TST_PROCESS_STATE_WAIT(cleanup, cpid, 'S');
 
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 20/31] recv*: Remove UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (18 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 19/31] pause: " Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 14:30 ` [LTP] [PATCH 21/31] send*: " Petr Vorel
                   ` (11 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/recv/recv01.c         | 17 -----------------
 testcases/kernel/syscalls/recvfrom/recvfrom01.c | 15 ---------------
 2 files changed, 32 deletions(-)

diff --git a/testcases/kernel/syscalls/recv/recv01.c b/testcases/kernel/syscalls/recv/recv01.c
index 64658ae32..d71243c30 100644
--- a/testcases/kernel/syscalls/recv/recv01.c
+++ b/testcases/kernel/syscalls/recv/recv01.c
@@ -87,13 +87,10 @@ struct test_case_t {		/* test case structure */
 	0, 0, 0, buf, sizeof(buf), 0,
 		    -1, ENOTSOCK, setup0, cleanup0, "invalid socket"}
 	,
-#ifndef UCLINUX
-	    /* Skip since uClinux does not implement memory protection */
 	{
 	PF_INET, SOCK_STREAM, 0, (void *)-1, sizeof(buf), 0,
 		    -1, EFAULT, setup1, cleanup1, "invalid recv buffer"}
 	,
-#endif
 	{
 	PF_INET, SOCK_STREAM, 0, buf, sizeof(buf), MSG_OOB,
 		    -1, EINVAL, setup1, cleanup1, "invalid MSG_OOB flag set"}
@@ -105,19 +102,11 @@ struct test_case_t {		/* test case structure */
 
 int TST_TOTAL = sizeof(tdat) / sizeof(tdat[0]);
 
-#ifdef UCLINUX
-static char *argv0;
-#endif
-
 int main(int argc, char *argv[])
 {
 	int lc;
 
 	tst_parse_opts(argc, argv, NULL, NULL);
-#ifdef UCLINUX
-	argv0 = argv[0];
-	maybe_run_child(&do_child, "d", &sfd);
-#endif
 
 	setup();
 
@@ -242,13 +231,7 @@ pid_t start_server(struct sockaddr_in *sin0)
 
 	switch ((pid = tst_fork())) {
 	case 0:		/* child */
-#ifdef UCLINUX
-		if (self_exec(argv0, "d", sfd) < 0)
-			tst_brkm(TBROK | TERRNO, cleanup,
-				 "server self_exec failed");
-#else
 		do_child();
-#endif
 		break;
 	case -1:
 		tst_brkm(TBROK | TERRNO, cleanup, "server fork failed");
diff --git a/testcases/kernel/syscalls/recvfrom/recvfrom01.c b/testcases/kernel/syscalls/recvfrom/recvfrom01.c
index a05256003..f26f85688 100644
--- a/testcases/kernel/syscalls/recvfrom/recvfrom01.c
+++ b/testcases/kernel/syscalls/recvfrom/recvfrom01.c
@@ -126,21 +126,12 @@ struct test_case_t {		/* test case structure */
 
 int TST_TOTAL = sizeof(tdat) / sizeof(tdat[0]);
 
-#ifdef UCLINUX
-static char *argv0;
-#endif
-
 int main(int argc, char *argv[])
 {
 	int lc;
 
 	tst_parse_opts(argc, argv, NULL, NULL);
 
-#ifdef UCLINUX
-	argv0 = argv[0];
-	maybe_run_child(&do_child, "d", &sfd);
-#endif
-
 	setup();
 
 	for (lc = 0; TEST_LOOPING(lc); ++lc) {
@@ -271,13 +262,7 @@ pid_t start_server(struct sockaddr_in *sin0)
 
 	switch ((pid = tst_fork())) {
 	case 0:		/* child */
-#ifdef UCLINUX
-		if (self_exec(argv0, "d", sfd) < 0) {
-			tst_brkm(TBROK, cleanup, "server self_exec failed");
-		}
-#else
 		do_child();
-#endif
 		break;
 	case -1:
 		tst_brkm(TBROK | TERRNO, cleanup, "server fork failed");
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 21/31] send*: Remove UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (19 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 20/31] recv*: " Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 14:30 ` [LTP] [PATCH 22/31] sock*: " Petr Vorel
                   ` (10 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/send/send01.c       | 21 -------------------
 testcases/kernel/syscalls/sendmsg/sendmsg01.c | 14 -------------
 testcases/kernel/syscalls/sendto/sendto01.c   | 21 -------------------
 3 files changed, 56 deletions(-)

diff --git a/testcases/kernel/syscalls/send/send01.c b/testcases/kernel/syscalls/send/send01.c
index 1f97daf5f..41859ff6f 100644
--- a/testcases/kernel/syscalls/send/send01.c
+++ b/testcases/kernel/syscalls/send/send01.c
@@ -100,8 +100,6 @@ static struct test_case_t tdat[] = {
 	 .cleanup = cleanup0,
 	 .desc = "invalid socket"}
 	,
-#ifndef UCLINUX
-	/* Skip since uClinux does not implement memory protection */
 	{.domain = PF_INET,
 	 .type = SOCK_STREAM,
 	 .proto = 0,
@@ -114,7 +112,6 @@ static struct test_case_t tdat[] = {
 	 .cleanup = cleanup1,
 	 .desc = "invalid send buffer"}
 	,
-#endif
 	{.domain = PF_INET,
 	 .type = SOCK_DGRAM,
 	 .proto = 0,
@@ -139,8 +136,6 @@ static struct test_case_t tdat[] = {
 	 .cleanup = cleanup1,
 	 .desc = "local endpoint shutdown"}
 	,
-#ifndef UCLINUX
-	/* Skip since uClinux does not implement memory protection */
 	{.domain = PF_INET,
 	 .type = SOCK_DGRAM,
 	 .proto = 0,
@@ -152,15 +147,10 @@ static struct test_case_t tdat[] = {
 	 .setup = setup1,
 	 .cleanup = cleanup1,
 	 .desc = "invalid flags set"}
-#endif
 };
 
 int TST_TOTAL = sizeof(tdat) / sizeof(tdat[0]);
 
-#ifdef UCLINUX
-static char *argv0;
-#endif
-
 static pid_t start_server(struct sockaddr_in *sin0)
 {
 	pid_t pid;
@@ -187,13 +177,7 @@ static pid_t start_server(struct sockaddr_in *sin0)
 
 	switch ((pid = tst_fork())) {
 	case 0:
-#ifdef UCLINUX
-		if (self_exec(argv0, "d", sfd) < 0)
-			tst_brkm(TBROK | TERRNO, cleanup,
-				 "server self_exec failed");
-#else
 		do_child();
-#endif
 		break;
 	case -1:
 		tst_brkm(TBROK | TERRNO, cleanup, "server fork failed");
@@ -253,11 +237,6 @@ int main(int ac, char *av[])
 
 	tst_parse_opts(ac, av, NULL, NULL);
 
-#ifdef UCLINUX
-	argv0 = av[0];
-	maybe_run_child(&do_child, "d", &sfd);
-#endif
-
 	setup();
 
 	for (lc = 0; TEST_LOOPING(lc); ++lc) {
diff --git a/testcases/kernel/syscalls/sendmsg/sendmsg01.c b/testcases/kernel/syscalls/sendmsg/sendmsg01.c
index 62477e56b..38cd7182c 100644
--- a/testcases/kernel/syscalls/sendmsg/sendmsg01.c
+++ b/testcases/kernel/syscalls/sendmsg/sendmsg01.c
@@ -358,21 +358,12 @@ struct test_case_t tdat[] = {
 
 int TST_TOTAL = sizeof(tdat) / sizeof(tdat[0]);
 
-#ifdef UCLINUX
-static char *argv0;
-#endif
-
 int main(int argc, char *argv[])
 {
 	int lc;
 
 	tst_parse_opts(argc, argv, NULL, NULL);
 
-#ifdef UCLINUX
-	argv0 = argv[0];
-	maybe_run_child(&do_child, "dd", &sfd, &ufd);
-#endif
-
 	setup();
 
 	for (lc = 0; TEST_LOOPING(lc); ++lc) {
@@ -459,12 +450,7 @@ static pid_t start_server(struct sockaddr_in *sin0, struct sockaddr_un *sun0)
 
 	switch ((pid = tst_fork())) {
 	case 0:
-#ifdef UCLINUX
-		if (self_exec(argv0, "dd", sfd, ufd) < 0)
-			tst_brkm(TBROK, cleanup, "server self_exec failed");
-#else
 		do_child();
-#endif
 		break;
 	case -1:
 		tst_brkm(TBROK, cleanup, "server fork failed: %s",
diff --git a/testcases/kernel/syscalls/sendto/sendto01.c b/testcases/kernel/syscalls/sendto/sendto01.c
index 654e6057e..b3b7b6efd 100644
--- a/testcases/kernel/syscalls/sendto/sendto01.c
+++ b/testcases/kernel/syscalls/sendto/sendto01.c
@@ -106,8 +106,6 @@ struct test_case_t tdat[] = {
 	 .cleanup = cleanup0,
 	 .desc = "invalid socket"}
 	,
-#ifndef UCLINUX
-	/* Skip since uClinux does not implement memory protection */
 	{.domain = PF_INET,
 	 .type = SOCK_DGRAM,
 	 .proto = 0,
@@ -122,7 +120,6 @@ struct test_case_t tdat[] = {
 	 .cleanup = cleanup1,
 	 .desc = "invalid send buffer"}
 	,
-#endif
 	{.domain = PF_INET,
 	 .type = SOCK_STREAM,
 	 .proto = 0,
@@ -165,8 +162,6 @@ struct test_case_t tdat[] = {
 	 .cleanup = cleanup1,
 	 .desc = "invalid to buffer length"}
 	,
-#ifndef UCLINUX
-	/* Skip since uClinux does not implement memory protection */
 	{.domain = PF_INET,
 	 .type = SOCK_DGRAM,
 	 .proto = 0,
@@ -181,7 +176,6 @@ struct test_case_t tdat[] = {
 	 .cleanup = cleanup1,
 	 .desc = "invalid to buffer"}
 	,
-#endif
 	{.domain = PF_INET,
 	 .type = SOCK_DGRAM,
 	 .proto = 0,
@@ -227,10 +221,6 @@ struct test_case_t tdat[] = {
 
 int TST_TOTAL = sizeof(tdat) / sizeof(tdat[0]);
 
-#ifdef UCLINUX
-static char *argv0;
-#endif
-
 static pid_t start_server(struct sockaddr_in *sin0)
 {
 	pid_t pid;
@@ -257,13 +247,7 @@ static pid_t start_server(struct sockaddr_in *sin0)
 
 	switch ((pid = tst_fork())) {
 	case 0:
-#ifdef UCLINUX
-		if (self_exec(argv0, "d", sfd) < 0)
-			tst_brkm(TBROK | TERRNO, cleanup,
-				 "server self_exec failed");
-#else
 		do_child();
-#endif
 		break;
 	case -1:
 		tst_brkm(TBROK | TERRNO, cleanup, "server fork failed");
@@ -323,11 +307,6 @@ int main(int ac, char *av[])
 
 	tst_parse_opts(ac, av, NULL, NULL);
 
-#ifdef UCLINUX
-	argv0 = av[0];
-	maybe_run_child(&do_child, "d", &sfd);
-#endif
-
 	setup();
 
 	for (lc = 0; TEST_LOOPING(lc); ++lc) {
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 22/31] sock*: Remove UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (20 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 21/31] send*: " Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 14:30 ` [LTP] [PATCH 23/31] read02: " Petr Vorel
                   ` (9 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/socketpair/socketpair01.c | 2 --
 testcases/kernel/syscalls/sockioctl/sockioctl01.c   | 2 --
 2 files changed, 4 deletions(-)

diff --git a/testcases/kernel/syscalls/socketpair/socketpair01.c b/testcases/kernel/syscalls/socketpair/socketpair01.c
index 675eb535d..5d9610b12 100644
--- a/testcases/kernel/syscalls/socketpair/socketpair01.c
+++ b/testcases/kernel/syscalls/socketpair/socketpair01.c
@@ -34,10 +34,8 @@ struct test_case_t {
 	{PF_INET, 75, 0, fds, -1, EINVAL, "invalid type"},
 	{PF_UNIX, SOCK_DGRAM, 0, fds, 0, 0, "UNIX domain dgram"},
 	{PF_INET, SOCK_RAW, 0, fds, -1, EPROTONOSUPPORT, "raw open as non-root"},
-#ifndef UCLINUX
 	{PF_UNIX, SOCK_STREAM, 0, 0, -1, EFAULT, "bad aligned pointer"},
 	{PF_UNIX, SOCK_STREAM, 0, (int *)7, -1, EFAULT, "bad unaligned pointer"},
-#endif
 	{PF_INET, SOCK_DGRAM, 17, fds, -1, EOPNOTSUPP, "UDP socket"},
 	{PF_INET, SOCK_DGRAM, 6, fds, -1, EPROTONOSUPPORT, "TCP dgram"},
 	{PF_INET, SOCK_STREAM, 6, fds, -1, EOPNOTSUPP, "TCP socket"},
diff --git a/testcases/kernel/syscalls/sockioctl/sockioctl01.c b/testcases/kernel/syscalls/sockioctl/sockioctl01.c
index ff3738f32..e81ec20a5 100644
--- a/testcases/kernel/syscalls/sockioctl/sockioctl01.c
+++ b/testcases/kernel/syscalls/sockioctl/sockioctl01.c
@@ -87,13 +87,11 @@ struct test_case_t {
 		    (struct sockaddr *)&fsin1, sizeof(fsin1), -1,
 		    EINVAL, setup0, cleanup0, "not a socket"}
 	,
-#if !defined(UCLINUX)
 	{
 	PF_INET, SOCK_STREAM, 0, SIOCATMARK, 0,
 		    (struct sockaddr *)&fsin1, sizeof(fsin1), -1,
 		    EFAULT, setup1, cleanup1, "invalid option buffer"}
 	,
-#endif
 	{
 	PF_INET, SOCK_DGRAM, 0, SIOCATMARK, &optval,
 		    (struct sockaddr *)&fsin1, sizeof(fsin1), -1,
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 23/31] read02: Remove UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (21 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 22/31] sock*: " Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 14:30 ` [LTP] [PATCH 24/31] setgroups04: " Petr Vorel
                   ` (8 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/read/read02.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/testcases/kernel/syscalls/read/read02.c b/testcases/kernel/syscalls/read/read02.c
index 9199a95f6..3b4af1643 100644
--- a/testcases/kernel/syscalls/read/read02.c
+++ b/testcases/kernel/syscalls/read/read02.c
@@ -52,9 +52,7 @@ static struct tcase {
 } tcases[] = {
 	{&badfd, &bufaddr, 1, EBADF},
 	{&fd2, &bufaddr, 1, EISDIR},
-#ifndef UCLINUX
 	{&fd3, &outside_buf, 1, EFAULT},
-#endif
 	{&fd4, &addr4, 1, EINVAL},
 	{&fd4, &addr5, 4096, EINVAL},
 };
@@ -98,10 +96,8 @@ static void setup(void)
 
 	fd3 = SAFE_OPEN("test_file", O_RDWR);
 
-#if !defined(UCLINUX)
 	outside_buf = SAFE_MMAP(0, 1, PROT_NONE,
 				MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
-#endif
 
 	addr4 = SAFE_MEMALIGN(getpagesize(), (4096 * 10));
 	addr5 = addr4 + 1;
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 24/31] setgroups04: Remove UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (22 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 23/31] read02: " Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 14:30 ` [LTP] [PATCH 25/31] setsid01: " Petr Vorel
                   ` (7 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/setgroups/setgroups04.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/testcases/kernel/syscalls/setgroups/setgroups04.c b/testcases/kernel/syscalls/setgroups/setgroups04.c
index 93a064cda..71e2ca105 100644
--- a/testcases/kernel/syscalls/setgroups/setgroups04.c
+++ b/testcases/kernel/syscalls/setgroups/setgroups04.c
@@ -84,8 +84,6 @@ GID_T groups_list[NGROUPS];
 void setup();			/* setup function for the test */
 void cleanup();			/* cleanup function for the test */
 
-#if !defined(UCLINUX)
-
 int main(int ac, char **av)
 {
 	int lc;
@@ -135,16 +133,6 @@ int main(int ac, char **av)
 
 }
 
-#else
-
-int main(void)
-{
-	tst_resm(TINFO, "test is not available on uClinux");
-	tst_exit();
-}
-
-#endif /* if !defined(UCLINUX) */
-
 /*
  * setup()
  */
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 25/31] setsid01: Remove UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (23 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 24/31] setgroups04: " Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 14:30 ` [LTP] [PATCH 26/31] sigrelse01: " Petr Vorel
                   ` (6 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/setsid/setsid01.c | 23 ---------------------
 1 file changed, 23 deletions(-)

diff --git a/testcases/kernel/syscalls/setsid/setsid01.c b/testcases/kernel/syscalls/setsid/setsid01.c
index 5df2c1ff4..197e865cb 100644
--- a/testcases/kernel/syscalls/setsid/setsid01.c
+++ b/testcases/kernel/syscalls/setsid/setsid01.c
@@ -49,10 +49,6 @@
 char *TCID = "setsid01";
 int TST_TOTAL = 1;
 
-#ifdef UCLINUX
-static char *argv0;
-#endif
-
 void do_child_1(void);
 void do_child_2(void);
 void setup(void);
@@ -68,12 +64,6 @@ int main(int ac, char **av)
 	int lc;
 
 	tst_parse_opts(ac, av, NULL, NULL);
-#ifdef UCLINUX
-	argv0 = av[0];
-
-	maybe_run_child(&do_child_1, "n", 1);
-	maybe_run_child(&do_child_2, "n", 2);
-#endif
 
 	/*
 	 * perform global setup for the test
@@ -98,14 +88,7 @@ int main(int ac, char **av)
 
 			}
 			if (pid == 0) {
-#ifdef UCLINUX
-				if (self_exec(argv0, "n", 1) < 0) {
-					tst_resm(TFAIL, "self_exec failed");
-
-				}
-#else
 				do_child_1();
-#endif
 			} else {
 				if (setpgid(0, 0) < 0) {
 					tst_resm(TFAIL,
@@ -165,13 +148,7 @@ void do_child_1(void)
 		tst_brkm(TFAIL, NULL, "Fork failed");
 	}
 	if (pid == 0) {
-#ifdef UCLINUX
-		if (self_exec(argv0, "n", 2) < 0) {
-			tst_brkm(TFAIL, NULL, "self_exec failed");
-		}
-#else
 		do_child_2();
-#endif
 	} else {
 		retval = setpgid(0, getppid());
 		if (retval < 0) {
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 26/31] sigrelse01: Remove UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (24 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 25/31] setsid01: " Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 14:30 ` [LTP] [PATCH 27/31] sysinfo02: " Petr Vorel
                   ` (5 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 .../kernel/syscalls/sigrelse/sigrelse01.c     | 20 +++----------------
 1 file changed, 3 insertions(+), 17 deletions(-)

diff --git a/testcases/kernel/syscalls/sigrelse/sigrelse01.c b/testcases/kernel/syscalls/sigrelse/sigrelse01.c
index a9d509cba..957542120 100644
--- a/testcases/kernel/syscalls/sigrelse/sigrelse01.c
+++ b/testcases/kernel/syscalls/sigrelse/sigrelse01.c
@@ -192,9 +192,6 @@ int main(int argc, char **argv)
 	 * parse standard options
 	 */
 	tst_parse_opts(argc, argv, NULL, NULL);
-#ifdef UCLINUX
-	maybe_run_child(&child, "dd", &pipe_fd[1], &pipe_fd2[0]);
-#endif
 
 	/*
 	 * perform global setup for test
@@ -208,23 +205,12 @@ int main(int argc, char **argv)
 		/*
 		 * fork off a child process
 		 */
-		if ((pid = tst_fork()) < 0) {
+		if ((pid = tst_fork()) < 0)
 			tst_brkm(TBROK | TERRNO, cleanup, "fork() failed");
-
-		} else if (pid > 0) {
+		else if (pid > 0)
 			parent();
-
-		} else {
-#ifdef UCLINUX
-			if (self_exec(argv[0], "dd", pipe_fd[1], pipe_fd2[0]) <
-			    0) {
-				tst_brkm(TBROK | TERRNO, cleanup,
-					 "self_exec() failed");
-			}
-#else
+		else
 			child();
-#endif
-		}
 
 	}
 
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 27/31] sysinfo02: Remove UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (25 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 26/31] sigrelse01: " Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 14:30 ` [LTP] [PATCH 28/31] ustat02: " Petr Vorel
                   ` (4 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/sysinfo/sysinfo02.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/testcases/kernel/syscalls/sysinfo/sysinfo02.c b/testcases/kernel/syscalls/sysinfo/sysinfo02.c
index 7ad0e8bdc..4ce06e0a7 100644
--- a/testcases/kernel/syscalls/sysinfo/sysinfo02.c
+++ b/testcases/kernel/syscalls/sysinfo/sysinfo02.c
@@ -78,8 +78,6 @@ void cleanup();
 char *TCID = "sysinfo02";
 int TST_TOTAL = 1;
 
-#if !defined(UCLINUX)
-
 int main(int ac, char **av)
 {
 	struct sysinfo *sysinfo_buf;
@@ -115,16 +113,6 @@ int main(int ac, char **av)
 
 }
 
-#else
-
-int main(void)
-{
-	tst_resm(TINFO, "test is not available on uClinux");
-	tst_exit();
-}
-
-#endif /* if !defined(UCLINUX) */
-
 /*
  * setup()
  *	performs one time setup
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 28/31] ustat02: Remove UCLINUX
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (26 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 27/31] sysinfo02: " Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 14:30 ` [LTP] [PATCH 29/31] lib: Remove -C option and self_exec.c Petr Vorel
                   ` (3 subsequent siblings)
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/ustat/ustat02.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/testcases/kernel/syscalls/ustat/ustat02.c b/testcases/kernel/syscalls/ustat/ustat02.c
index 965766698..84becaa1f 100644
--- a/testcases/kernel/syscalls/ustat/ustat02.c
+++ b/testcases/kernel/syscalls/ustat/ustat02.c
@@ -30,9 +30,7 @@ static struct test_case_t {
 	struct ustat *buf;
 } tc[] = {
 	{"Invalid parameter", EINVAL, "EINVAL", &invalid_dev, &ubuf},
-#ifndef UCLINUX
 	{"Bad address", EFAULT, "EFAULT", &root_dev, (void*)-1}
-#endif
 };
 
 int TST_TOTAL = ARRAY_SIZE(tc);
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 29/31] lib: Remove -C option and self_exec.c
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (27 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 28/31] ustat02: " Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 16:02   ` Cyril Hrubis
  2024-04-11 14:30 ` [LTP] [PATCH 30/31] Remove doc/old/nommu-notes.txt Petr Vorel
                   ` (2 subsequent siblings)
  31 siblings, 1 reply; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

It was added only for UCLINUX.

These unused functions were removed:

void maybe_run_child(void (*child)(), const char *fmt, ...);
int self_exec(const char *argv0, const char *fmt, ...);

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 include/old/test.h |   4 -
 lib/self_exec.c    | 225 ---------------------------------------------
 lib/tst_test.c     |  15 ---
 3 files changed, 244 deletions(-)
 delete mode 100644 lib/self_exec.c

diff --git a/include/old/test.h b/include/old/test.h
index 7394a365e..0e210e4ef 100644
--- a/include/old/test.h
+++ b/include/old/test.h
@@ -167,10 +167,6 @@ extern int tst_count;
 /* lib/tst_sig.c */
 void tst_sig(int fork_flag, void (*handler)(), void (*cleanup)());
 
-/* lib/self_exec.c */
-void maybe_run_child(void (*child)(), const char *fmt, ...);
-int self_exec(const char *argv0, const char *fmt, ...);
-
 /* lib/tst_mkfs.c
  *
  * @dev: path to a device
diff --git a/lib/self_exec.c b/lib/self_exec.c
deleted file mode 100644
index de7d09517..000000000
--- a/lib/self_exec.c
+++ /dev/null
@@ -1,225 +0,0 @@
-/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: t -*- */
-/*
- * self_exec.c: self_exec magic required to run child functions on uClinux
- *
- * Copyright (C) 2005 Paul J.Y. Lahaie <pjlahaie-at-steamballoon.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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * This software was produced by Steamballoon Incorporated
- * 55 Byward Market Square, 2nd Floor North, Ottawa, ON K1N 9C3, Canada
- */
-
-#define _GNU_SOURCE		/* for asprintf */
-
-#include "config.h"
-
-#ifdef UCLINUX
-
-#include <stdarg.h>
-#include <string.h>
-#include <stdio.h>
-#include "test.h"
-#include "safe_macros.h"
-
-/* Set from parse_opts.c: */
-char *child_args;		/* Arguments to child when -C is used */
-
-static char *start_cwd;		/* Stores the starting directory for self_exec */
-
-int asprintf(char **app, const char *fmt, ...)
-{
-	va_list ptr;
-	int rv;
-	char *p;
-
-	/*
-	 * First iteration - find out size of buffer required and allocate it.
-	 */
-	va_start(ptr, fmt);
-	rv = vsnprintf(NULL, 0, fmt, ptr);
-	va_end(ptr);
-
-	p = malloc(++rv);	/* allocate the buffer */
-	*app = p;
-	if (!p) {
-		return -1;
-	}
-
-	/*
-	 * Second iteration - actually produce output.
-	 */
-	va_start(ptr, fmt);
-	rv = vsnprintf(p, rv, fmt, ptr);
-	va_end(ptr);
-
-	return rv;
-}
-
-void maybe_run_child(void (*child) (), const char *fmt, ...)
-{
-	va_list ap;
-	char *child_dir;
-	char *p, *tok;
-	int *iptr, i, j;
-	char *s;
-	char **sptr;
-	char *endptr;
-
-	/* Store the current directory for later use. */
-	start_cwd = getcwd(NULL, 0);
-
-	if (child_args) {
-		char *args = strdup(child_args);
-
-		child_dir = strtok(args, ",");
-		if (strlen(child_dir) == 0) {
-			tst_brkm(TBROK, NULL,
-				 "Could not get directory from -C option");
-			return;
-		}
-
-		va_start(ap, fmt);
-
-		for (p = fmt; *p; p++) {
-			tok = strtok(NULL, ",");
-			if (!tok || strlen(tok) == 0) {
-				tst_brkm(TBROK, NULL,
-					 "Invalid argument to -C option");
-				return;
-			}
-
-			switch (*p) {
-			case 'd':
-				iptr = va_arg(ap, int *);
-				i = strtol(tok, &endptr, 10);
-				if (*endptr != '\0') {
-					tst_brkm(TBROK, NULL,
-						 "Invalid argument to -C option");
-					return;
-				}
-				*iptr = i;
-				break;
-			case 'n':
-				j = va_arg(ap, int);
-				i = strtol(tok, &endptr, 10);
-				if (*endptr != '\0') {
-					tst_brkm(TBROK, NULL,
-						 "Invalid argument to -C option");
-					return;
-				}
-				if (j != i) {
-					va_end(ap);
-					free(args);
-					return;
-				}
-				break;
-			case 's':
-				s = va_arg(ap, char *);
-				if (!strncpy(s, tok, strlen(tok) + 1)) {
-					tst_brkm(TBROK, NULL,
-						 "Could not strncpy for -C option");
-					return;
-				}
-				break;
-			case 'S':
-				sptr = va_arg(ap, char **);
-				*sptr = strdup(tok);
-				if (!*sptr) {
-					tst_brkm(TBROK, NULL,
-						 "Could not strdup for -C option");
-					return;
-				}
-				break;
-			default:
-				tst_brkm(TBROK, NULL,
-					 "Format string option %c not implemented",
-					 *p);
-				return;
-			}
-		}
-
-		va_end(ap);
-		free(args);
-		SAFE_CHDIR(NULL, child_dir);
-
-		(*child) ();
-		tst_resm(TWARN, "Child function returned unexpectedly");
-		/* Exit here? or exit silently? */
-	}
-}
-
-int self_exec(const char *argv0, const char *fmt, ...)
-{
-	va_list ap;
-	char *p;
-	char *tmp_cwd;
-	char *arg;
-	int ival;
-	char *str;
-
-	if ((tmp_cwd = getcwd(NULL, 0)) == NULL) {
-		tst_resm(TBROK, "Could not getcwd()");
-		return -1;
-	}
-
-	arg = strdup(tmp_cwd);
-	if (arg == NULL) {
-		tst_resm(TBROK, "Could not produce self_exec string");
-		return -1;
-	}
-
-	va_start(ap, fmt);
-
-	for (p = fmt; *p; p++) {
-		switch (*p) {
-		case 'd':
-		case 'n':
-			ival = va_arg(ap, int);
-			if (asprintf(&arg, "%s,%d", arg, ival) < 0) {
-				tst_resm(TBROK,
-					 "Could not produce self_exec string");
-				return -1;
-			}
-			break;
-		case 's':
-		case 'S':
-			str = va_arg(ap, char *);
-			if (asprintf(&arg, "%s,%s", arg, str) < 0) {
-				tst_resm(TBROK,
-					 "Could not produce self_exec string");
-				return -1;
-			}
-			break;
-		default:
-			tst_resm(TBROK,
-				 "Format string option %c not implemented", *p);
-			return -1;
-			break;
-		}
-	}
-
-	va_end(ap);
-
-	if (chdir(start_cwd) < 0) {
-		tst_resm(TBROK, "Could not change to %s for self_exec",
-			 start_cwd);
-		return -1;
-	}
-
-	return execlp(argv0, argv0, "-C", arg, (char *)NULL);
-}
-
-#endif /* UCLINUX */
diff --git a/lib/tst_test.c b/lib/tst_test.c
index edb42f7f4..c5d853e22 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -520,7 +520,6 @@ static struct option {
 	{"I:", "-I x     Execute test for n seconds"},
 	{"D",  "-D       Prints debug information"},
 	{"V",  "-V       Prints LTP version"},
-	{"C:", "-C ARG   Run child process with ARG arguments (used internally)"},
 };
 
 static void print_help(void)
@@ -660,11 +659,6 @@ static void parse_topt(unsigned int topts_len, int opt, char *optarg)
 	*(toptions[i].arg) = optarg ? optarg : "";
 }
 
-/* see self_exec.c */
-#ifdef UCLINUX
-extern char *child_args;
-#endif
-
 static void parse_opts(int argc, char *argv[])
 {
 	unsigned int i, topts_len = count_options();
@@ -704,15 +698,6 @@ static void parse_opts(int argc, char *argv[])
 			else
 				duration = SAFE_STRTOF(optarg, 0.1, HUGE_VALF);
 		break;
-		case 'V':
-			fprintf(stderr, "LTP version: " LTP_VERSION "\n");
-			exit(0);
-		break;
-		case 'C':
-#ifdef UCLINUX
-			child_args = optarg;
-#endif
-		break;
 		default:
 			parse_topt(topts_len, opt, optarg);
 		}
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 30/31] Remove doc/old/nommu-notes.txt
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (28 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 29/31] lib: Remove -C option and self_exec.c Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-04-11 14:30 ` [LTP] [PATCH 31/31] doc: UCLINUX has been removed Petr Vorel
  2024-05-03 15:39 ` [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Cyril Hrubis
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

UCLINUX is dead and it's support has been removed from LTP.

Although Documentation/admin-guide/mm/nommu-mmap.rst still exists in
kernel tree, there is nobody really using it.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 doc/old/nommu-notes.txt | 171 ----------------------------------------
 1 file changed, 171 deletions(-)
 delete mode 100644 doc/old/nommu-notes.txt

diff --git a/doc/old/nommu-notes.txt b/doc/old/nommu-notes.txt
deleted file mode 100644
index 4baeff3b2..000000000
--- a/doc/old/nommu-notes.txt
+++ /dev/null
@@ -1,171 +0,0 @@
--------------
---- Intro ---
--------------
-
-Linux running on processors without a memory management unit place certain
-restrictions on the userspace programs.  Here we will provide some guidelines
-for people who are not familiar with such systems.
-
-If you are not familiar with virtual memory, you might want to review some
-background such as:
-	http://en.wikipedia.org/wiki/Virtual_Memory
-	/usr/src/linux/Documentation/nommu-mmap.txt
-
-----------------------------
---- No memory protection ---
-----------------------------
-
-By virtue of every process getting its own virtual memory space, applications
-are protected from each other.  So a bad memory access in one will not affect
-the memory of another.  When processors forgo virtual memory, they typically
-do not add memory protection back in to the hardware.  There are one or two
-exceptions to this rule, but for now, we'll assume no one supports it.
-
-In practical terms, this means you cannot dereference bad pointers directly
-and expect the kernel to catch and kill your application.  However, you can
-expect the kernel to catch some bad pointers when given to system calls.
-
-For example, this will "work" in the sense that no signal will be sent:
-	char *foo = NULL;
-	foo[0] = 'a';
-	foo[1] = 'b';
-
-However, the kernel should return errors when using "standard" bad pointers
-with system calls.  Such as:
-	char *foo = NULL;
-	write(1, foo, 10);
-	-> kernel will return EFAULT or similar
-The other bad pointer you can rely on in your tests is -1:
-	char *foo = (void *)-1;
-	read(0, foo, 10);
-	-> kernel will return EFAULT or similar
-
-Otherwise, no bad pointer may reliably be tested, either directly or
-indirectly via the kernel.  This tends to be a large part of the UCLINUX
-ifdef code that shows up in LTP.
-
-----------------
---- No forks ---
-----------------
-
-The ubiquitous fork() function relies completely on the Copy On Write (COW)
-functionality provided by virtual memory to share pages between processes.
-Since this isn't feasible without virtual memory, there is no fork() function.
-You will either get a linker error (undefined reference to fork) or you will
-get a runtime failure of ENOSYS.
-
-Typically, fork() is used for very few programming paradigms:
-	- daemonization
-	- run a program
-	- parallelism
-
-For the daemonization functionality, simply use the daemon() function.  This
-works under both MMU and NOMMU systems.
-
-To run a program, simply use vfork() followed by an exec-style function.
-And change the error handler in the child from exit() to _exit().  This too
-works under both MMU and NOMMU systems.  But be aware of vfork() semantics --
-since the parent and child share the same memory process, the child has to be
-careful in what it does.  This is why the recommended construct is simply:
-	pid_t child = vfork();
-	if (vfork == 0)
-		_exit(execl(....));
-
-For parallelism where processes use IPC to work together, you have to options,
-neither of which are easy.  You can rewrite to use threads, or you can re-exec
-yourself with special flags to pass along updated runtime state.  This is what
-the self_exec() helper function in LTP is designed for.
-
--------------------------
---- No overcommitting ---
--------------------------
-
-Virtual memory allows people to do malloc(128MiB) and get back a buffer that
-big.  But that buffer is only of virtual memory, not physical.  On a NOMMU
-system, the memory comes immediately from physical memory and takes it away
-from anyone else.
-
-Avoid large mallocs.
-
----------------------
---- Fragmentation ---
----------------------
-
-On a MMU system, when physical memory gets fragmented, things slow down.  But
-they keep working.  This is because every new process gets a clean virtual
-memory address space.  While processes can fragment their own virtual address
-space, this usually takes quite a long time and a lot of effort, so generally
-it is not a problem people hit.
-
-On a NOMMU system, when physical memory gets fragmented, access to large
-contiguous blocks becomes unavailable which means requests fail.  Even if your
-system has 40MiB _total_ free, the largest contiguous block might only be 1MiB
-which means that allocations larger than that will always fail.
-
-Break up your large memory allocations when possible.  Generally speaking,
-single allocations under 2MiB aren't a problem.
-
------------------
---- No paging ---
------------------
-
-No virtual memory means you can't mmap() a file and only have the pages read in
-(paged) on the fly.  So if you use mmap() on a file, the kernel must allocate
-memory for it and read in all the contents immediately.
-
----------------------
---- No swap space ---
----------------------
-
-See the "No paging" section above.  For the same reason, there is no support
-for swap partitions.  Plus, nommu typically means embedded which means flash
-based storage which means limited storage space and limited number of times
-you can write it.
-
--------------------------
---- No dynamic stacks ---
--------------------------
-
-No virtual memory means that applications can't all have their stacks at the
-top of memory and allowed to grown "indefinitely" downwards.  Stack space is
-fixed at process creation time (when it is first executed) and cannot grow.
-While the fixed size may be increased, it's best to avoid stack pressure in
-the first place.
-
-Avoid the alloca() function and use malloc()/free() instead.
-
-Avoid declaring large buffers on the stack.  Some people like to do things
-such as:
-	char buf[PATH_MAX];
-This will most likely smash the stack on nommu systems !  Use global variables
-(the bss), or use malloc()/free() type functions.
-
--------------------------------
---- No dynamic data segment ---
--------------------------------
-
-No virtual memory means that mappings cannot arbitrarily be extended.  Another
-process might have its own mapping right after yours!  This is where the brk()
-and sbrk() functions come into play.  These are most often used to dynamically
-increase the heap space via the C library, but a few people use these manually.
-
-Best if you simply avoid them, and if you're writing tests to exercise these
-functions specifically, make them nops/XFAIL for nommu systems.
-
--------------------------------
---- Limited shared mappings ---
--------------------------------
-
-No virtual memory means files cannot be mmapped in and have writes to it
-written back out to disk on the fly.  So you cannot use MAP_SHARED when
-mmapping a file.
-
--------------------------
---- No fixed mappings ---
--------------------------
-
-The MAP_FIXED option to mmap() is not supported.  It doesn't even really work
-all that well under MMU systems.
-
-Best if you simply avoid it, and if you're writing tests to exercise this
-option specifically, make them nops/XFAIL for nommu systems.
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [LTP] [PATCH 31/31] doc: UCLINUX has been removed
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (29 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 30/31] Remove doc/old/nommu-notes.txt Petr Vorel
@ 2024-04-11 14:30 ` Petr Vorel
  2024-05-03 15:39 ` [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Cyril Hrubis
  31 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 14:30 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 doc/maintainers/patch_review.rst                   | 4 ----
 doc/old/Maintainer-Patch-Review-Checklist.asciidoc | 3 ---
 2 files changed, 7 deletions(-)

diff --git a/doc/maintainers/patch_review.rst b/doc/maintainers/patch_review.rst
index 3ff8122a8..0561ffd9d 100644
--- a/doc/maintainers/patch_review.rst
+++ b/doc/maintainers/patch_review.rst
@@ -152,10 +152,6 @@ C tests
 * Docparse documentation
 * If a test is a regression test it should include ``.tags`` in the
   ``struct tst_test`` definition
-* When rewriting old tests, `uClinux <https://en.wikipedia.org/wiki/%CE%9CClinux>`_
-  support should be removed (project has been discontinued).
-  E.g. remove ``#ifdef UCLINUX``, replace ``FORK_OR_VFORK()`` with simple
-  ``fork()`` or ``SAFE_FORK()``.
 
 Shell tests
 ~~~~~~~~~~~
diff --git a/doc/old/Maintainer-Patch-Review-Checklist.asciidoc b/doc/old/Maintainer-Patch-Review-Checklist.asciidoc
index 9cd8606f9..8977b7585 100644
--- a/doc/old/Maintainer-Patch-Review-Checklist.asciidoc
+++ b/doc/old/Maintainer-Patch-Review-Checklist.asciidoc
@@ -127,9 +127,6 @@ New test should
 * Docparse documentation
 * If a test is a regression test it should include tags
   (more in https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines#2238-test-tags[Test tags])
-* When rewriting old tests, https://en.wikipedia.org/wiki/%CE%9CClinux[uClinux]
-  support should be removed (project has been discontinued).
-  E.g. remove `#ifdef UCLINUX`, replace `tst_fork()` with simple `fork()` or `SAFE_FORK()`.
 
 ### Shell tests
 * Use new https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines#23-writing-a-testcase-in-shell[shell API]
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* Re: [LTP] [PATCH 07/31] tlibio.c: Remove UCLINUX
  2024-04-11 14:30 ` [LTP] [PATCH 07/31] tlibio.c: " Petr Vorel
@ 2024-04-11 14:59   ` Cyril Hrubis
  2024-04-11 20:46     ` Petr Vorel
  0 siblings, 1 reply; 43+ messages in thread
From: Cyril Hrubis @ 2024-04-11 14:59 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

Hi!
> +#ifndef __UCLIBC__

The UCLIBC should be removed as well, since that was libc for uCLinux.

>  #include <aio.h>
>  #endif
>  #endif
> -- 
> 2.43.0
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [LTP] [PATCH 14/31] madvise02: Remove UCLINUX
  2024-04-11 14:30 ` [LTP] [PATCH 14/31] madvise02: " Petr Vorel
@ 2024-04-11 15:37   ` Cyril Hrubis
  2024-04-11 20:51     ` Petr Vorel
  0 siblings, 1 reply; 43+ messages in thread
From: Cyril Hrubis @ 2024-04-11 15:37 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

Hi!
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  testcases/kernel/syscalls/madvise/madvise02.c | 25 ++++++++-----------
>  1 file changed, 11 insertions(+), 14 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/madvise/madvise02.c b/testcases/kernel/syscalls/madvise/madvise02.c
> index 90c0431c5..793bda98d 100644
> --- a/testcases/kernel/syscalls/madvise/madvise02.c
> +++ b/testcases/kernel/syscalls/madvise/madvise02.c
> @@ -65,17 +65,17 @@ static struct tcase {
>  	int exp_errno;
>  	int skip;
>  } tcases[] = {
> -	{MADV_NORMAL,      "MADV_NORMAL",      &nonalign, EINVAL, 0},
> -	{1212,             "MADV_NORMAL",      &file1,    EINVAL, 0},
> -	{MADV_REMOVE,      "MADV_REMOVE",      &file1,    EINVAL, 0},
> -	{MADV_DONTNEED,    "MADV_DONTNEED",    &file1,    EINVAL, 1},
> -	{MADV_MERGEABLE,   "MADV_MERGEABLE",   &file1,    EINVAL, 0},
> -	{MADV_UNMERGEABLE, "MADV_UNMERGEABLE", &file1,    EINVAL, 0},
> -	{MADV_NORMAL,      "MADV_NORMAL",      &file2,    ENOMEM, 0},
> -	{MADV_WILLNEED,    "MADV_WILLNEED",    &file2,    ENOMEM, 0},
> -	{MADV_WILLNEED,    "MADV_WILLNEED",    &tmp_addr,  EBADF, 0},
> -	{MADV_FREE,        "MADV_FREE",        &file1,    EINVAL, 0},
> -	{MADV_WIPEONFORK,  "MADV_WIPEONFORK",  &file1,    EINVAL, 0},
> +	{MADV_NORMAL,      "MADV_NORMAL",      &nonalign, EINVAL},
> +	{1212,             "MADV_NORMAL",      &file1,    EINVAL},
> +	{MADV_REMOVE,      "MADV_REMOVE",      &file1,    EINVAL},
> +	{MADV_DONTNEED,    "MADV_DONTNEED",    &file1,    EINVAL},
> +	{MADV_MERGEABLE,   "MADV_MERGEABLE",   &file1,    EINVAL},
> +	{MADV_UNMERGEABLE, "MADV_UNMERGEABLE", &file1,    EINVAL},
> +	{MADV_NORMAL,      "MADV_NORMAL",      &file2,    ENOMEM},
> +	{MADV_WILLNEED,    "MADV_WILLNEED",    &file2,    ENOMEM},
> +	{MADV_WILLNEED,    "MADV_WILLNEED",    &tmp_addr,  EBADF},
> +	{MADV_FREE,        "MADV_FREE",        &file1,    EINVAL},
> +	{MADV_WIPEONFORK,  "MADV_WIPEONFORK",  &file1,    EINVAL},
>  	{MADV_WIPEONFORK,  "MADV_WIPEONFORK shared_anon", &shared_anon, EINVAL, 0},
>  	{MADV_WIPEONFORK,  "MADV_WIPEONFORK private file backed", &file3, EINVAL, 0},

You should have removed these two zeroes as well, it's a bit confusing
that they stayed in there.

>  };
> @@ -89,11 +89,8 @@ static void tcases_filter(void)
>  
>  		switch (tc->advice) {
>  		case MADV_DONTNEED:
> -#if !defined(UCLINUX)
>  			if (mlock(file1, st.st_size) < 0)
>  				tst_brk(TBROK | TERRNO, "mlock failed");
> -			tc->skip = 0;
> -#endif /* if !defined(UCLINUX) */
>  		break;
>  		case MADV_MERGEABLE:
>  		case MADV_UNMERGEABLE:
> -- 
> 2.43.0
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [LTP] [PATCH 29/31] lib: Remove -C option and self_exec.c
  2024-04-11 14:30 ` [LTP] [PATCH 29/31] lib: Remove -C option and self_exec.c Petr Vorel
@ 2024-04-11 16:02   ` Cyril Hrubis
  2024-04-11 20:56     ` Petr Vorel
  0 siblings, 1 reply; 43+ messages in thread
From: Cyril Hrubis @ 2024-04-11 16:02 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

Hi!
>  static void parse_opts(int argc, char *argv[])
>  {
>  	unsigned int i, topts_len = count_options();
> @@ -704,15 +698,6 @@ static void parse_opts(int argc, char *argv[])
>  			else
>  				duration = SAFE_STRTOF(optarg, 0.1, HUGE_VALF);
>  		break;
> -		case 'V':
> -			fprintf(stderr, "LTP version: " LTP_VERSION "\n");
> -			exit(0);
> -		break;

This should stay.

> -		case 'C':
> -#ifdef UCLINUX
> -			child_args = optarg;
> -#endif
> -		break;
>  		default:
>  			parse_topt(topts_len, opt, optarg);
>  		}
> -- 
> 2.43.0
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [LTP] [PATCH 07/31] tlibio.c: Remove UCLINUX
  2024-04-11 14:59   ` Cyril Hrubis
@ 2024-04-11 20:46     ` Petr Vorel
  2024-04-12  7:36       ` Cyril Hrubis
  0 siblings, 1 reply; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 20:46 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

Hi Cyril,

> Hi!
> > +#ifndef __UCLIBC__

> The UCLIBC should be removed as well, since that was libc for uCLinux.

IMHO you are wrong here. IMHO uCLinux-ng [1], still used libc (used in Buildroot
and openembedded). And log in e5e938f4b7 (2009) suggests that it's about libc.
But the question is whether it's still needed. I could try to remove these and
test, but as a separate effort.

We have few of them:

$ git grep -l  __UCLIBC__
include/old/tlibio.h
lib/tlibio.c
testcases/kernel/syscalls/fmtmsg/fmtmsg01.c
utils/benchmark/ebizzy-0.3/ebizzy.h

Kind regards,
Petr

[1] https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/tree/include/features.h#n185

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [LTP] [PATCH 14/31] madvise02: Remove UCLINUX
  2024-04-11 15:37   ` Cyril Hrubis
@ 2024-04-11 20:51     ` Petr Vorel
  0 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 20:51 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

Hi Cyril,


> Hi!
> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> >  testcases/kernel/syscalls/madvise/madvise02.c | 25 ++++++++-----------
> >  1 file changed, 11 insertions(+), 14 deletions(-)

> > diff --git a/testcases/kernel/syscalls/madvise/madvise02.c b/testcases/kernel/syscalls/madvise/madvise02.c
> > index 90c0431c5..793bda98d 100644
> > --- a/testcases/kernel/syscalls/madvise/madvise02.c
> > +++ b/testcases/kernel/syscalls/madvise/madvise02.c
> > @@ -65,17 +65,17 @@ static struct tcase {
> >  	int exp_errno;
> >  	int skip;
> >  } tcases[] = {
> > -	{MADV_NORMAL,      "MADV_NORMAL",      &nonalign, EINVAL, 0},
> > -	{1212,             "MADV_NORMAL",      &file1,    EINVAL, 0},
> > -	{MADV_REMOVE,      "MADV_REMOVE",      &file1,    EINVAL, 0},
> > -	{MADV_DONTNEED,    "MADV_DONTNEED",    &file1,    EINVAL, 1},
> > -	{MADV_MERGEABLE,   "MADV_MERGEABLE",   &file1,    EINVAL, 0},
> > -	{MADV_UNMERGEABLE, "MADV_UNMERGEABLE", &file1,    EINVAL, 0},
> > -	{MADV_NORMAL,      "MADV_NORMAL",      &file2,    ENOMEM, 0},
> > -	{MADV_WILLNEED,    "MADV_WILLNEED",    &file2,    ENOMEM, 0},
> > -	{MADV_WILLNEED,    "MADV_WILLNEED",    &tmp_addr,  EBADF, 0},
> > -	{MADV_FREE,        "MADV_FREE",        &file1,    EINVAL, 0},
> > -	{MADV_WIPEONFORK,  "MADV_WIPEONFORK",  &file1,    EINVAL, 0},
> > +	{MADV_NORMAL,      "MADV_NORMAL",      &nonalign, EINVAL},
> > +	{1212,             "MADV_NORMAL",      &file1,    EINVAL},
> > +	{MADV_REMOVE,      "MADV_REMOVE",      &file1,    EINVAL},
> > +	{MADV_DONTNEED,    "MADV_DONTNEED",    &file1,    EINVAL},
> > +	{MADV_MERGEABLE,   "MADV_MERGEABLE",   &file1,    EINVAL},
> > +	{MADV_UNMERGEABLE, "MADV_UNMERGEABLE", &file1,    EINVAL},
> > +	{MADV_NORMAL,      "MADV_NORMAL",      &file2,    ENOMEM},
> > +	{MADV_WILLNEED,    "MADV_WILLNEED",    &file2,    ENOMEM},
> > +	{MADV_WILLNEED,    "MADV_WILLNEED",    &tmp_addr,  EBADF},
> > +	{MADV_FREE,        "MADV_FREE",        &file1,    EINVAL},
> > +	{MADV_WIPEONFORK,  "MADV_WIPEONFORK",  &file1,    EINVAL},
> >  	{MADV_WIPEONFORK,  "MADV_WIPEONFORK shared_anon", &shared_anon, EINVAL, 0},
> >  	{MADV_WIPEONFORK,  "MADV_WIPEONFORK private file backed", &file3, EINVAL, 0},

> You should have removed these two zeroes as well, it's a bit confusing
> that they stayed in there.

I wonder why I left these two. I'll amend the patch with the diff bellow.

Kind regards,
Petr

+++ testcases/kernel/syscalls/madvise/madvise02.c
@@ -76,8 +76,8 @@ static struct tcase {
 	{MADV_WILLNEED,    "MADV_WILLNEED",    &tmp_addr,  EBADF},
 	{MADV_FREE,        "MADV_FREE",        &file1,    EINVAL},
 	{MADV_WIPEONFORK,  "MADV_WIPEONFORK",  &file1,    EINVAL},
-	{MADV_WIPEONFORK,  "MADV_WIPEONFORK shared_anon", &shared_anon, EINVAL, 0},
-	{MADV_WIPEONFORK,  "MADV_WIPEONFORK private file backed", &file3, EINVAL, 0},
+	{MADV_WIPEONFORK,  "MADV_WIPEONFORK shared_anon", &shared_anon, EINVAL},
+	{MADV_WIPEONFORK,  "MADV_WIPEONFORK private file backed", &file3, EINVAL},
 };
 
 static void tcases_filter(void)

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [LTP] [PATCH 29/31] lib: Remove -C option and self_exec.c
  2024-04-11 16:02   ` Cyril Hrubis
@ 2024-04-11 20:56     ` Petr Vorel
  0 siblings, 0 replies; 43+ messages in thread
From: Petr Vorel @ 2024-04-11 20:56 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

Hi Cyril,

> Hi!
> >  static void parse_opts(int argc, char *argv[])
> >  {
> >  	unsigned int i, topts_len = count_options();
> > @@ -704,15 +698,6 @@ static void parse_opts(int argc, char *argv[])
> >  			else
> >  				duration = SAFE_STRTOF(optarg, 0.1, HUGE_VALF);
> >  		break;
> > -		case 'V':
> > -			fprintf(stderr, "LTP version: " LTP_VERSION "\n");
> > -			exit(0);
> > -		break;

> This should stay.

Thanks for catching -V. I wonder myself why I removed it.

So far 2 changes, fixes are in remove-UCLINUX.rebased.fixes in my LTP fork:

https://github.com/pevik/ltp/commits/remove-UCLINUX.rebased.fixes/

Kind regards,
Petr

> > -		case 'C':
> > -#ifdef UCLINUX
> > -			child_args = optarg;
> > -#endif
> > -		break;
> >  		default:
> >  			parse_topt(topts_len, opt, optarg);
> >  		}

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [LTP] [PATCH 07/31] tlibio.c: Remove UCLINUX
  2024-04-11 20:46     ` Petr Vorel
@ 2024-04-12  7:36       ` Cyril Hrubis
  2024-04-12  8:32         ` Andrea Cervesato via ltp
  0 siblings, 1 reply; 43+ messages in thread
From: Cyril Hrubis @ 2024-04-12  7:36 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

Hi!
> IMHO you are wrong here. IMHO uCLinux-ng [1], still used libc (used in Buildroot
> and openembedded). And log in e5e938f4b7 (2009) suggests that it's about libc.
> But the question is whether it's still needed. I could try to remove these and
> test, but as a separate effort.

You are right, these should be converted into configure checks later on.

And the tlibio should probably be rewritten completely. So let's keep
the patch as it is.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [LTP] [PATCH 07/31] tlibio.c: Remove UCLINUX
  2024-04-12  7:36       ` Cyril Hrubis
@ 2024-04-12  8:32         ` Andrea Cervesato via ltp
  2024-04-12  8:57           ` Cyril Hrubis
  0 siblings, 1 reply; 43+ messages in thread
From: Andrea Cervesato via ltp @ 2024-04-12  8:32 UTC (permalink / raw)
  To: ltp

Hi!

On 4/12/24 09:36, Cyril Hrubis wrote:
> Hi!
>> IMHO you are wrong here. IMHO uCLinux-ng [1], still used libc (used in Buildroot
>> and openembedded). And log in e5e938f4b7 (2009) suggests that it's about libc.
>> But the question is whether it's still needed. I could try to remove these and
>> test, but as a separate effort.
> You are right, these should be converted into configure checks later on.
>
> And the tlibio should probably be rewritten completely. So let's keep
> the patch as it is.
>
I started to rewrite part of that library when I was working on 
growfiles test rewrite, but the complexity of it, the amount of nested 
statements and macro directives made me crazy.
Waiting for a better moment to restart rewriting it, but work is on-going.

Andrea


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [LTP] [PATCH 07/31] tlibio.c: Remove UCLINUX
  2024-04-12  8:32         ` Andrea Cervesato via ltp
@ 2024-04-12  8:57           ` Cyril Hrubis
  2024-04-12  9:08             ` Andrea Cervesato via ltp
  0 siblings, 1 reply; 43+ messages in thread
From: Cyril Hrubis @ 2024-04-12  8:57 UTC (permalink / raw)
  To: Andrea Cervesato; +Cc: ltp

Hi!
> >> IMHO you are wrong here. IMHO uCLinux-ng [1], still used libc (used in Buildroot
> >> and openembedded). And log in e5e938f4b7 (2009) suggests that it's about libc.
> >> But the question is whether it's still needed. I could try to remove these and
> >> test, but as a separate effort.
> > You are right, these should be converted into configure checks later on.
> >
> > And the tlibio should probably be rewritten completely. So let's keep
> > the patch as it is.
> >
> I started to rewrite part of that library when I was working on 
> growfiles test rewrite, but the complexity of it, the amount of nested 
> statements and macro directives made me crazy.
> Waiting for a better moment to restart rewriting it, but work is on-going.

Maybe it would be better to do this in a steps, first remove everything
that is inside the ifdefs for hpux, sgi etc. and only then start working
with the actual code...

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [LTP] [PATCH 07/31] tlibio.c: Remove UCLINUX
  2024-04-12  8:57           ` Cyril Hrubis
@ 2024-04-12  9:08             ` Andrea Cervesato via ltp
  0 siblings, 0 replies; 43+ messages in thread
From: Andrea Cervesato via ltp @ 2024-04-12  9:08 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

Hi!

On 4/12/24 10:57, Cyril Hrubis wrote:
> Hi!
>>>> IMHO you are wrong here. IMHO uCLinux-ng [1], still used libc (used in Buildroot
>>>> and openembedded). And log in e5e938f4b7 (2009) suggests that it's about libc.
>>>> But the question is whether it's still needed. I could try to remove these and
>>>> test, but as a separate effort.
>>> You are right, these should be converted into configure checks later on.
>>>
>>> And the tlibio should probably be rewritten completely. So let's keep
>>> the patch as it is.
>>>
>> I started to rewrite part of that library when I was working on
>> growfiles test rewrite, but the complexity of it, the amount of nested
>> statements and macro directives made me crazy.
>> Waiting for a better moment to restart rewriting it, but work is on-going.
> Maybe it would be better to do this in a steps, first remove everything
> that is inside the ifdefs for hpux, sgi etc. and only then start working
> with the actual code...
>
Well that's the easiest part. growfiles has a really huge amount of bad 
code, it's the biggest in the whole LTP suite and (unfortunately) it's a 
really important one.
It will take a bit...probably it will be incremental.

Andrea


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API
  2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
                   ` (30 preceding siblings ...)
  2024-04-11 14:30 ` [LTP] [PATCH 31/31] doc: UCLINUX has been removed Petr Vorel
@ 2024-05-03 15:39 ` Cyril Hrubis
  31 siblings, 0 replies; 43+ messages in thread
From: Cyril Hrubis @ 2024-05-03 15:39 UTC (permalink / raw)
  To: Petr Vorel
  Cc: Giovanni Lostumbo, linux-kernel, linux-m68k, Geert Uytterhoeven,
	Rob Landley, John Paul Adrian Glaubitz, ltp

Hi!
Pushed with a one patch on the top that removed the configure check for
UCLINUX:

Author: Cyril Hrubis <chrubis@suse.cz>
Date:   Fri May 3 17:23:44 2024 +0200

    m4: Remove now unused ltp-nommu-linux.m4

    Signed-off-by: Cyril Hrubis <chrubis@suse.cz>

diff --git a/configure.ac b/configure.ac
index 15a5847fa..638a64bc9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -385,7 +385,6 @@ LTP_CHECK_KERNEL_DEVEL
 LTP_CHECK_KEYUTILS_SUPPORT
 LTP_CHECK_LIBMNL
 LTP_CHECK_LINUXRANDOM
-LTP_CHECK_NOMMU_LINUX
 LTP_CHECK_SELINUX
 LTP_CHECK_SYNC_ADD_AND_FETCH
 LTP_CHECK_SYSCALL_EVENTFD
diff --git a/m4/ltp-nommu-linux.m4 b/m4/ltp-nommu-linux.m4
deleted file mode 100644
index 7471ddd06..000000000
--- a/m4/ltp-nommu-linux.m4
+++ /dev/null
@@ -1,14 +0,0 @@
-dnl SPDX-License-Identifier: GPL-2.0-or-later
-dnl Copyright (c) Linux Test Project, 2010
-dnl Author: Mike Frysinger <vapier@gentoo.org>
-
-AC_DEFUN([LTP_CHECK_NOMMU_LINUX],
-[
-       AC_CHECK_FUNCS([fork daemon vfork])
-       UCLINUX=0
-       if test "x$ac_cv_func_fork" = "xno" ; then
-               UCLINUX=1
-               AC_DEFINE([UCLINUX], 1, [Target is running Linux w/out an MMU])
-       fi
-       AC_SUBST(UCLINUX)
-])


-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2024-05-03 15:40 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-11 14:29 [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Petr Vorel
2024-04-11 14:29 ` [LTP] [PATCH 01/31] m4: Remove UCLINUX (nommu detection) Petr Vorel
2024-04-11 14:29 ` [LTP] [PATCH 02/31] make: Remove WITH_POWER_MANAGEMENT_TESTSUITE Petr Vorel
2024-04-11 14:29 ` [LTP] [PATCH 03/31] make: Remove UCLINUX (nommu detection) Petr Vorel
2024-04-11 14:29 ` [LTP] [PATCH 04/31] test.h: Remove MAP_PRIVATE_EXCEPT_UCLINUX Petr Vorel
2024-04-11 14:29 ` [LTP] [PATCH 05/31] tree: Remove FORK_OR_VFORK and tst_vfork() Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 06/31] lib/parse_opts.c: Remove UCLINUX Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 07/31] tlibio.c: " Petr Vorel
2024-04-11 14:59   ` Cyril Hrubis
2024-04-11 20:46     ` Petr Vorel
2024-04-12  7:36       ` Cyril Hrubis
2024-04-12  8:32         ` Andrea Cervesato via ltp
2024-04-12  8:57           ` Cyril Hrubis
2024-04-12  9:08             ` Andrea Cervesato via ltp
2024-04-11 14:30 ` [LTP] [PATCH 08/31] clone02: " Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 09/31] connect01: " Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 10/31] creat06: " Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 11/31] fcntl: " Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 12/31] semctl06: " Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 13/31] kill: " Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 14/31] madvise02: " Petr Vorel
2024-04-11 15:37   ` Cyril Hrubis
2024-04-11 20:51     ` Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 15/31] mlockall: " Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 16/31] munmap: " Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 17/31] writev05: " Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 18/31] pipe: " Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 19/31] pause: " Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 20/31] recv*: " Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 21/31] send*: " Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 22/31] sock*: " Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 23/31] read02: " Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 24/31] setgroups04: " Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 25/31] setsid01: " Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 26/31] sigrelse01: " Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 27/31] sysinfo02: " Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 28/31] ustat02: " Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 29/31] lib: Remove -C option and self_exec.c Petr Vorel
2024-04-11 16:02   ` Cyril Hrubis
2024-04-11 20:56     ` Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 30/31] Remove doc/old/nommu-notes.txt Petr Vorel
2024-04-11 14:30 ` [LTP] [PATCH 31/31] doc: UCLINUX has been removed Petr Vorel
2024-05-03 15:39 ` [LTP] [PATCH 00/31] Remove UCLINUX (nommu support) from LTP legacy C API Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).