summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Ports/AvailablePorts.md2
-rwxr-xr-xPorts/stress-ng/package.sh4
-rw-r--r--Ports/stress-ng/patches/0001-build-sytem-patch.patch130
-rw-r--r--Ports/stress-ng/patches/0001-disable-linux-scheduler-integration.patch44
-rw-r--r--Ports/stress-ng/patches/0002-disable-itimer.patch117
-rw-r--r--Ports/stress-ng/patches/0002-missing-types-and-functionality.patch70
-rw-r--r--Ports/stress-ng/patches/0003-fix-always_inline.patch29
-rw-r--r--Ports/stress-ng/patches/0003-missing-networking-functionality.patch81
-rw-r--r--Ports/stress-ng/patches/0004-ifdef-out-key_t-type-usage.patch32
-rw-r--r--Ports/stress-ng/patches/0004-memory-related.patch43
-rw-r--r--Ports/stress-ng/patches/0005-mark-hsearch-stressor-as-not-implemented.patch36
-rw-r--r--Ports/stress-ng/patches/0005-misc-fixups.patch629
-rw-r--r--Ports/stress-ng/patches/0006-disable-lchown-calls-from-sysbadaddr.patch41
-rw-r--r--Ports/stress-ng/patches/0007-disable-signal-code-validation.patch32
-rw-r--r--Ports/stress-ng/patches/0008-disable-lchown.patch35
-rw-r--r--Ports/stress-ng/patches/0009-add-empty-o_ndelay.patch32
-rw-r--r--Ports/stress-ng/patches/0010-disable-rand48-cpu-stressor.patch44
-rw-r--r--Ports/stress-ng/patches/0011-make-lsearch-stressor-a-nop.patch36
-rw-r--r--Ports/stress-ng/patches/0012-fake-o_sync.patch31
-rw-r--r--Ports/stress-ng/patches/0013-disable-lrand48-zlib-stress.patch53
-rw-r--r--Ports/stress-ng/patches/0014-fix-stress_get_prime64-variable-type.patch27
-rw-r--r--Ports/stress-ng/patches/0015-install-prefix.patch (renamed from Ports/stress-ng/patches/install-prefix.patch)0
22 files changed, 592 insertions, 956 deletions
diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md
index 3ea1ba0ea9..ef83cc4f6b 100644
--- a/Ports/AvailablePorts.md
+++ b/Ports/AvailablePorts.md
@@ -168,7 +168,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^
| [`soltys`](soltys/) | Soltys | 1.0 | https://www.scummvm.org/games/#games-soltys |
| [`sqlite`](sqlite/) | SQLite | 3350500 | https://www.sqlite.org/ |
| [`stpuzzles`](stpuzzles/) | Simon Tatham's Portable Puzzle Collection | | https://www.chiark.greenend.org.uk/~sgtatham/puzzles/ |
-| [`stress-ng`](stress-ng/) | stress-ng | 0.11.23 | https://github.com/ColinIanKing/stress-ng |
+| [`stress-ng`](stress-ng/) | stress-ng | 0.13.09 | https://github.com/ColinIanKing/stress-ng |
| [`Super-Mario`](Super-Mario/) | Super-Mario Clone | | https://github.com/Bennyhwanggggg/Super-Mario-Clone-Cpp |
| [`tuxracer`](tuxracer/) | Tux Racer | 0.61 | http://tuxracer.sourceforge.net/ |
| [`tcl`](tcl/) | Tcl | 8.6.11 | https://www.tcl-lang.org/ |
diff --git a/Ports/stress-ng/package.sh b/Ports/stress-ng/package.sh
index 2724f24bfb..4d69c02ae6 100755
--- a/Ports/stress-ng/package.sh
+++ b/Ports/stress-ng/package.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env -S bash ../.port_include.sh
port=stress-ng
-version=0.11.23
-files="https://github.com/ColinIanKing/stress-ng/archive/V${version}.tar.gz stress-ng-${version}.tar.gz ffa1c516e3098a1d7ae6a4fd48c6fb41b8dfaabda22aaeebb569d24875870216"
+version=0.13.09
+files="https://github.com/ColinIanKing/stress-ng/archive/V${version}.tar.gz stress-ng-${version}.tar.gz 1b57f2864f562358cb75807c2dca7c13ddee3c94803282b22f75009311967c6c"
auth_type=sha256
depends=("zlib")
diff --git a/Ports/stress-ng/patches/0001-build-sytem-patch.patch b/Ports/stress-ng/patches/0001-build-sytem-patch.patch
deleted file mode 100644
index 5c30d3e674..0000000000
--- a/Ports/stress-ng/patches/0001-build-sytem-patch.patch
+++ /dev/null
@@ -1,130 +0,0 @@
-diff -ur stress-ng-master/Makefile stress-ng-master-2/Makefile
---- stress-ng-master/Makefile 2020-11-07 10:52:22.000000000 -0800
-+++ stress-ng-master-2/Makefile 2020-11-08 23:36:28.587668500 -0800
-@@ -21,7 +21,7 @@
- # Codename "synthetic system strainer"
- #
-
--CFLAGS += -Wall -Wextra -DVERSION='"$(VERSION)"' -O2 -std=gnu99
-+CFLAGS += -Wall -Wextra -DVERSION='"$(VERSION)"' -O2 -std=gnu99 -Wno-old-style-declaration
-
- #
- # Pedantic flags
-@@ -89,7 +89,6 @@
- stress-close.c \
- stress-context.c \
- stress-copy-file.c \
-- stress-cpu.c \
- stress-cpu-online.c \
- stress-crypt.c \
- stress-cyclic.c \
-@@ -99,7 +98,6 @@
- stress-dev.c \
- stress-dev-shm.c \
- stress-dir.c \
-- stress-dirdeep.c \
- stress-dnotify.c \
- stress-dup.c \
- stress-dynlib.c \
-@@ -132,19 +130,16 @@
- stress-hdd.c \
- stress-heapsort.c \
- stress-hrtimers.c \
-- stress-hsearch.c \
- stress-icache.c \
- stress-icmp-flood.c \
- stress-idle-page.c \
- stress-inode-flags.c \
- stress-inotify.c \
-- stress-iomix.c \
- stress-ioport.c \
- stress-ioprio.c \
- stress-iosync.c \
- stress-io-uring.c \
- stress-ipsec-mb.c \
-- stress-itimer.c \
- stress-judy.c \
- stress-kcmp.c \
- stress-key.c \
-@@ -158,7 +153,6 @@
- stress-lockofd.c \
- stress-longjmp.c \
- stress-loop.c \
-- stress-lsearch.c \
- stress-madvise.c \
- stress-malloc.c \
- stress-matrix.c \
-@@ -222,22 +216,16 @@
- stress-rename.c \
- stress-resources.c \
- stress-revio.c \
-- stress-rlimit.c \
-- stress-rmap.c \
- stress-rtc.c \
- stress-sctp.c \
-- stress-schedpolicy.c \
- stress-seal.c \
- stress-seccomp.c \
- stress-seek.c \
- stress-sem.c \
-- stress-sem-sysv.c \
- stress-sendfile.c \
- stress-session.c \
-- stress-set.c \
- stress-shellsort.c \
- stress-shm.c \
-- stress-shm-sysv.c \
- stress-sigabrt.c \
- stress-sigchld.c \
- stress-sigfd.c \
-@@ -257,7 +245,6 @@
- stress-sockabuse.c \
- stress-sockdiag.c \
- stress-sockfd.c \
-- stress-sockpair.c \
- stress-sockmany.c \
- stress-softlockup.c \
- stress-spawn.c \
-@@ -269,7 +256,6 @@
- stress-swap.c \
- stress-switch.c \
- stress-sync-file.c \
-- stress-sysbadaddr.c \
- stress-sysinfo.c \
- stress-sysinval.c \
- stress-sysfs.c \
-@@ -280,7 +266,6 @@
- stress-tmpfs.c \
- stress-tree.c \
- stress-tsc.c \
-- stress-tsearch.c \
- stress-tun.c \
- stress-udp.c \
- stress-udp-flood.c \
-@@ -288,11 +273,9 @@
- stress-uprobe.c \
- stress-urandom.c \
- stress-userfaultfd.c \
-- stress-utime.c \
- stress-vdso.c \
- stress-vecmath.c \
- stress-verity.c \
-- stress-vforkmany.c \
- stress-vm.c \
- stress-vm-addr.c \
- stress-vm-rw.c \
-@@ -474,12 +457,6 @@
- ./stress-ng --seq 0 -t 15 --pathological --verbose --times --tz --metrics
-
- .PHONY: install
--install: stress-ng stress-ng.1.gz
-+install: stress-ng
- mkdir -p ${DESTDIR}${BINDIR}
- cp stress-ng ${DESTDIR}${BINDIR}
-- mkdir -p ${DESTDIR}${MANDIR}
-- cp stress-ng.1.gz ${DESTDIR}${MANDIR}
-- mkdir -p ${DESTDIR}${JOBDIR}
-- cp -rp example-jobs/*.job ${DESTDIR}${JOBDIR}
-- mkdir -p ${DESTDIR}${BASHDIR}
-- cp bash-completion/stress-ng ${DESTDIR}${BASHDIR}
-
diff --git a/Ports/stress-ng/patches/0001-disable-linux-scheduler-integration.patch b/Ports/stress-ng/patches/0001-disable-linux-scheduler-integration.patch
new file mode 100644
index 0000000000..9dd243e42a
--- /dev/null
+++ b/Ports/stress-ng/patches/0001-disable-linux-scheduler-integration.patch
@@ -0,0 +1,44 @@
+From 5ce9746b2885d2a3da7f5dbe6c15de858b093188 Mon Sep 17 00:00:00 2001
+From: Brian Gianforcaro <b.gianfo@gmail.com>
+Date: Mon, 27 Dec 2021 20:53:47 -0800
+Subject: [PATCH 01/14] serenity: Disable linux scheduler integration on
+ Serenity
+
+Follow the path of other platforms, and make this code nop
+when compiling for serenity.
+---
+ core-sched.c | 3 ++-
+ stress-schedpolicy.c | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/core-sched.c b/core-sched.c
+index a27d15a..65ebe8c 100644
+--- a/core-sched.c
++++ b/core-sched.c
+@@ -68,7 +68,8 @@ const char *stress_get_sched_name(const int sched)
+ #if (defined(_POSIX_PRIORITY_SCHEDULING) || defined(__linux__)) && \
+ !defined(__OpenBSD__) && \
+ !defined(__minix__) && \
+- !defined(__APPLE__)
++ !defined(__APPLE__) && \
++ !defined(__serenity__)
+
+ static const char prefix[] = "sched";
+
+diff --git a/stress-schedpolicy.c b/stress-schedpolicy.c
+index ceaf535..3fdb74d 100644
+--- a/stress-schedpolicy.c
++++ b/stress-schedpolicy.c
+@@ -33,7 +33,8 @@ static const stress_help_t help[] = {
+ #if (defined(_POSIX_PRIORITY_SCHEDULING) || defined(__linux__)) && \
+ !defined(__OpenBSD__) && \
+ !defined(__minix__) && \
+- !defined(__APPLE__)
++ !defined(__APPLE__) && \
++ !defined(__serenity__)
+
+ static const int policies[] = {
+ #if defined(SCHED_IDLE)
+--
+2.32.0
+
diff --git a/Ports/stress-ng/patches/0002-disable-itimer.patch b/Ports/stress-ng/patches/0002-disable-itimer.patch
new file mode 100644
index 0000000000..1f750ec1a0
--- /dev/null
+++ b/Ports/stress-ng/patches/0002-disable-itimer.patch
@@ -0,0 +1,117 @@
+From d378b4416270a99b321689f759e29fb5c9126c1a Mon Sep 17 00:00:00 2001
+From: Brian Gianforcaro <b.gianfo@gmail.com>
+Date: Mon, 27 Dec 2021 20:57:05 -0800
+Subject: [PATCH 02/14] serenity: Disable itimer testing when compiling for
+ Serenity
+
+The itimer APIs are not implemented in serenity, so just disable
+these tests.
+---
+ stress-itimer.c | 7 +++++++
+ stress-sysbadaddr.c | 14 ++++++++++++++
+ 2 files changed, 21 insertions(+)
+
+diff --git a/stress-itimer.c b/stress-itimer.c
+index 7fa8cea..f4aee66 100644
+--- a/stress-itimer.c
++++ b/stress-itimer.c
+@@ -24,6 +24,7 @@
+ */
+ #include "stress-ng.h"
+
++#ifndef __serenity__
+ static volatile uint64_t itimer_counter = 0;
+ static uint64_t max_ops;
+ static double rate_us;
+@@ -218,3 +219,9 @@ stressor_info_t stress_itimer_info = {
+ .opt_set_funcs = opt_set_funcs,
+ .help = help
+ };
++#else
++stressor_info_t stress_itimer_info = {
++ .stressor = stress_not_implemented,
++ .class = CLASS_INTERRUPT | CLASS_OS,
++};
++#endif
+diff --git a/stress-sysbadaddr.c b/stress-sysbadaddr.c
+index b7abae5..8d0481b 100644
+--- a/stress-sysbadaddr.c
++++ b/stress-sysbadaddr.c
+@@ -344,10 +344,12 @@ static int bad_gethostname(void *addr)
+ }
+ #endif
+
++#ifndef __serenity__
+ static int bad_getitimer(void *addr)
+ {
+ return getitimer(ITIMER_PROF, (struct itimerval *)addr);
+ }
++#endif
+
+ static int bad_getpeername(void *addr)
+ {
+@@ -639,11 +641,13 @@ static int bad_select(void *addr)
+ return ret;
+ }
+
++#ifndef __serenity__
+ static int bad_setitimer(void *addr)
+ {
+ return setitimer(ITIMER_PROF, (struct itimerval *)addr,
+ (struct itimerval *)inc_addr(addr, 1));
+ }
++#endif
+
+ static int bad_setrlimit(void *addr)
+ {
+@@ -825,7 +829,10 @@ static stress_bad_syscall_t bad_syscalls[] = {
+ #if defined(HAVE_GETHOSTNAME)
+ bad_gethostname,
+ #endif
++
++#ifndef __serenity__
+ bad_getitimer,
++#endif
+ bad_getpeername,
+ bad_getrandom,
+ bad_getrlimit,
+@@ -899,7 +906,10 @@ static stress_bad_syscall_t bad_syscalls[] = {
+ bad_sched_getaffinity,
+ #endif
+ bad_select,
++
++#ifndef __serenity__
+ bad_setitimer,
++#endif
+ bad_setrlimit,
+ bad_stat,
+ #if defined(HAVE_STATFS)
+@@ -955,7 +965,9 @@ static inline int stress_do_syscall(
+ if (pid < 0) {
+ _exit(EXIT_NO_RESOURCE);
+ } else if (pid == 0) {
++#ifndef __serenity__
+ struct itimerval it;
++#endif
+ size_t i;
+ int ret;
+
+@@ -978,6 +990,7 @@ static inline int stress_do_syscall(
+ stress_parent_died_alarm();
+ (void)sched_settings_apply(true);
+
++#ifndef __serenity__
+ /*
+ * Force abort if we take too long
+ */
+@@ -990,6 +1003,7 @@ static inline int stress_do_syscall(
+ args->name, errno, strerror(errno));
+ _exit(EXIT_NO_RESOURCE);
+ }
++#endif
+
+ ret = bad_syscall(addr);
+ if (ret < 0)
+--
+2.32.0
+
diff --git a/Ports/stress-ng/patches/0002-missing-types-and-functionality.patch b/Ports/stress-ng/patches/0002-missing-types-and-functionality.patch
deleted file mode 100644
index b3f55a4a80..0000000000
--- a/Ports/stress-ng/patches/0002-missing-types-and-functionality.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-diff -ur stress-ng-master/core-helper.c stress-ng-master-2/core-helper.c
---- stress-ng-master/core-helper.c 2020-11-07 10:52:22.000000000 -0800
-+++ stress-ng-master-2/core-helper.c 2020-11-08 23:17:03.777668500 -0800
-@@ -1102,7 +1102,7 @@
- */
- uint64_t stress_get_prime64(const uint64_t n)
- {
-- static uint p = 1009;
-+ static uint64_t p = 1009;
-
- if (n != p)
- return p;
-@@ -1149,6 +1149,9 @@
- */
- size_t stress_get_file_limit(void)
- {
-+ /* Just return a constant for serenity */
-+ return 65536;
-+#if 0
- struct rlimit rlim;
- size_t i, opened = 0, max = 65536; /* initial guess */
-
-@@ -1161,6 +1164,7 @@
- opened++;
- }
- return max - opened;
-+#endif
- }
-
- /*
-diff -ur stress-ng-master/core-sched.c stress-ng-master-2/core-sched.c
---- stress-ng-master/core-sched.c 2020-11-07 10:52:22.000000000 -0800
-+++ stress-ng-master-2/core-sched.c 2020-11-08 23:21:44.497668500 -0800
-@@ -263,6 +263,7 @@
- pr_dbg("%s: setting scheduler class '%s'\n", prefix, sched_name);
- break;
- }
-+#if 0
- rc = sched_setscheduler(pid, sched, &param);
- if (rc < 0) {
- rc = -errno;
-@@ -273,6 +274,7 @@
- errno, strerror(errno));
- return rc;
- }
-+#endif
- return 0;
- }
- #endif
-diff -ur stress-ng-master/stress-chown.c stress-ng-master-2/stress-chown.c
---- stress-ng-master/stress-chown.c 2020-11-07 10:52:22.000000000 -0800
-+++ stress-ng-master-2/stress-chown.c 2020-11-08 22:35:41.107668500 -0800
-@@ -219,6 +219,9 @@
- pr_fail("%s: chown %s failed, errno=%d (%s)\n",
- args->name, filename, errno, strerror(errno));
- }
-+
-+/* No lchown support in serenity */
-+#if 0
- ret = do_chown(lchown, filename, cap_chown, uid, gid);
- if (ret < 0) {
- if (ret == -ENOENT || ret == -ENOTDIR) {
-@@ -233,6 +236,7 @@
- pr_fail("%s: chown %s failed, errno=%d (%s)\n",
- args->name, filename, errno, strerror(errno));
- }
-+#endif
- inc_counter(args);
- } while (keep_stressing());
-
diff --git a/Ports/stress-ng/patches/0003-fix-always_inline.patch b/Ports/stress-ng/patches/0003-fix-always_inline.patch
new file mode 100644
index 0000000000..1d7a7ed58f
--- /dev/null
+++ b/Ports/stress-ng/patches/0003-fix-always_inline.patch
@@ -0,0 +1,29 @@
+From d28829e86cc1c8dff2c46fbeb3d4d1217fa4fd5c Mon Sep 17 00:00:00 2001
+From: Brian Gianforcaro <b.gianfo@gmail.com>
+Date: Mon, 27 Dec 2021 20:58:41 -0800
+Subject: [PATCH 03/14] serenity: Fix duplicate definition of ALWAYS_INLINE on
+ serenity
+
+---
+ stress-ng.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/stress-ng.h b/stress-ng.h
+index 73f549b..44f8bfa 100644
+--- a/stress-ng.h
++++ b/stress-ng.h
+@@ -1230,6 +1230,11 @@ typedef struct {
+ #define WEAK
+ #endif
+
++/* Serenity already defines this in sys/cdefs.h, just undefine it */
++#ifdef __serenity__
++ #undef ALWAYS_INLINE
++#endif
++
+ /* force inlining hint */
+ #if (defined(__GNUC__) && NEED_GNUC(3, 4, 0) \
+ && ((!defined(__s390__) && !defined(__s390x__)) || NEED_GNUC(6, 0, 1))) || \
+--
+2.32.0
+
diff --git a/Ports/stress-ng/patches/0003-missing-networking-functionality.patch b/Ports/stress-ng/patches/0003-missing-networking-functionality.patch
deleted file mode 100644
index 436d349bf9..0000000000
--- a/Ports/stress-ng/patches/0003-missing-networking-functionality.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-diff -ur a/stress-sock.c b/stress-sock.c
---- a/stress-sock.c 2020-11-07 10:52:22.000000000 -0800
-+++ b/stress-sock.c 2020-11-08 22:51:33.327668500 -0800
-@@ -422,7 +422,7 @@
- &cpu, &optlen);
- }
- #endif
-- if (socket_domain == AF_INET || socket_domain == AF_INET6) {
-+ if (socket_domain == AF_INET) {
- int val, ret;
- socklen_t optlen;
-
-@@ -756,6 +756,8 @@
- (void)close(sfd);
- break;
- }
-+
-+#if defined(SO_SNDBUF)
- len = sizeof(sndbuf);
- if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sndbuf, &len) < 0) {
- pr_fail("%s: getsockopt failed, errno=%d (%s)\n",
-@@ -763,6 +765,8 @@
- (void)close(sfd);
- break;
- }
-+#endif
-+
- #if defined(SOL_TCP) && defined(TCP_QUICKACK)
- {
- int ret, one = 1;
-diff -ur a/stress-sockabuse.c b/stress-sockabuse.c
---- a/stress-sockabuse.c 2020-11-07 10:52:22.000000000 -0800
-+++ b/stress-sockabuse.c 2020-11-08 22:52:27.297668500 -0800
-@@ -278,6 +278,7 @@
- (void)close(sfd);
- break;
- }
-+#if defined(SO_SNDBUF)
- len = sizeof(sndbuf);
- if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sndbuf, &len) < 0) {
- pr_fail("%s: getsockopt failed, errno=%d (%s)\n",
-@@ -285,6 +286,7 @@
- (void)close(sfd);
- break;
- }
-+#endif
- (void)memset(buf, 'A' + (get_counter(args) % 26), sizeof(buf));
-
- n = send(sfd, buf, sizeof(buf), 0);
-diff -ur a/stress-sockmany.c b/stress-sockmany.c
---- a/stress-sockmany.c 2020-11-07 10:52:22.000000000 -0800
-+++ b/stress-sockmany.c 2020-11-08 22:53:06.247668500 -0800
-@@ -221,6 +221,7 @@
- (void)close(sfd);
- break;
- }
-+#if defined(SO_SNDBUF)
- len = sizeof(sndbuf);
- if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sndbuf, &len) < 0) {
- pr_fail("%s: getsockopt failed, errno=%d (%s)\n",
-@@ -228,6 +229,8 @@
- (void)close(sfd);
- break;
- }
-+#endif
-+
- #if defined(SOL_TCP) && defined(TCP_QUICKACK)
- {
- int ret, one = 1;
-diff -ur a/stress-resources.c b/stress-resources.c
---- a/stress-resources.c 2020-11-07 10:52:22.000000000 -0800
-+++ b/stress-resources.c 2020-11-08 23:20:35.227668500 -0800
-@@ -130,7 +130,7 @@
- size_t i, n;
- size_t shmall, freemem, totalmem, freeswap;
- const pid_t pid = getpid();
-- static const int domains[] = { AF_INET, AF_INET6 };
-+ static const int domains[] = { AF_INET };
- static const int types[] = { SOCK_STREAM, SOCK_DGRAM };
- static stress_info_t info[MAX_LOOPS];
- #if defined(O_NOATIME)
diff --git a/Ports/stress-ng/patches/0004-ifdef-out-key_t-type-usage.patch b/Ports/stress-ng/patches/0004-ifdef-out-key_t-type-usage.patch
new file mode 100644
index 0000000000..75e1ef7946
--- /dev/null
+++ b/Ports/stress-ng/patches/0004-ifdef-out-key_t-type-usage.patch
@@ -0,0 +1,32 @@
+From c7856e765e893ff447b2309d06a55d0d06a70d02 Mon Sep 17 00:00:00 2001
+From: Brian Gianforcaro <b.gianfo@gmail.com>
+Date: Mon, 27 Dec 2021 20:59:35 -0800
+Subject: [PATCH 04/14] serenity: ifdef out key_t type usage, which serenity
+ does not have
+
+---
+ stress-ng.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/stress-ng.h b/stress-ng.h
+index 44f8bfa..edaa2ce 100644
+--- a/stress-ng.h
++++ b/stress-ng.h
+@@ -2490,11 +2490,14 @@ typedef struct {
+ uint32_t futex[STRESS_PROCS_MAX]; /* Shared futexes */
+ uint64_t timeout[STRESS_PROCS_MAX]; /* Shared futex timeouts */
+ } futex;
++
++#ifndef __serenity__
+ struct {
+ key_t key_id; /* System V semaphore key id */
+ int sem_id; /* System V semaphore id */
+ bool init; /* System V semaphore initialized */
+ } sem_sysv;
++#endif
+ #if defined(STRESS_PERF_STATS)
+ struct {
+ bool no_perf; /* true = Perf not available */
+--
+2.32.0
+
diff --git a/Ports/stress-ng/patches/0004-memory-related.patch b/Ports/stress-ng/patches/0004-memory-related.patch
deleted file mode 100644
index f9d3780307..0000000000
--- a/Ports/stress-ng/patches/0004-memory-related.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-diff -ur a/stress-str.c b/stress-str.c
---- a/stress-str.c 2020-11-07 10:52:22.000000000 -0800
-+++ b/stress-str.c 2020-11-08 22:55:55.887668500 -0800
-@@ -597,8 +597,6 @@
- { "all", stress_str_all, NULL }, /* Special "all test */
-
- #if defined(HAVE_STRINGS_H)
-- { "index", stress_index, index },
-- { "rindex", stress_rindex, rindex },
- { "strcasecmp", stress_strcasecmp, strcasecmp },
- #endif
- #if defined(HAVE_STRLCAT)
-diff -ur a/stress-sigsegv.c b/stress-sigsegv.c
---- a/stress-sigsegv.c 2020-11-07 10:52:22.000000000 -0800
-+++ b/stress-sigsegv.c 2020-11-08 22:50:22.327668500 -0800
-@@ -143,11 +143,13 @@
- pr_fail("%s: expecting SIGSEGV/SIGILL/SIGBUS, got %s instead\n",
- args->name, strsignal(signo));
- }
-+#if 0
- if (verify && (signo == SIGBUS) && (code != SEGV_ACCERR)) {
- pr_fail("%s: expecting SIGBUS si_code SEGV_ACCERR (%d), got %d instead\n",
- args->name, SEGV_ACCERR, code);
- }
- #endif
-+#endif
- inc_counter(args);
- } else {
- #if defined(SA_SIGINFO)
-diff -ur a/stress-mmapmany.c b/stress-mmapmany.c
---- a/stress-mmapmany.c 2020-11-07 10:52:22.000000000 -0800
-+++ b/stress-mmapmany.c 2020-11-08 22:47:27.567668500 -0800
-@@ -35,7 +35,8 @@
- static int stress_mmapmany_child(const stress_args_t *args, void *context)
- {
- const size_t page_size = args->page_size;
-- ssize_t max = sysconf(_SC_MAPPED_FILES);
-+ /* Just make up a constant for Serenity */
-+ ssize_t max = 6400;
- uint8_t **mappings;
- max = STRESS_MAXIMUM(max, MMAP_MAX);
-
-d
diff --git a/Ports/stress-ng/patches/0005-mark-hsearch-stressor-as-not-implemented.patch b/Ports/stress-ng/patches/0005-mark-hsearch-stressor-as-not-implemented.patch
new file mode 100644
index 0000000000..15c582ce06
--- /dev/null
+++ b/Ports/stress-ng/patches/0005-mark-hsearch-stressor-as-not-implemented.patch
@@ -0,0 +1,36 @@
+From 308c59d16757b935bc6ad7c369b80681fa879f80 Mon Sep 17 00:00:00 2001
+From: Brian Gianforcaro <b.gianfo@gmail.com>
+Date: Mon, 27 Dec 2021 21:01:59 -0800
+Subject: [PATCH 05/14] serenity: Mark hsearch stressor as not implemented on
+ Serenity
+
+---
+ stress-hsearch.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/stress-hsearch.c b/stress-hsearch.c
+index 61c71a6..345a2ca 100644
+--- a/stress-hsearch.c
++++ b/stress-hsearch.c
+@@ -31,6 +31,7 @@ static const stress_help_t help[] = {
+ { NULL, NULL, NULL }
+ };
+
++#ifndef __serenity__
+ /*
+ * stress_set_hsearch_size()
+ * set hsearch size from given option string
+@@ -158,3 +159,10 @@ stressor_info_t stress_hsearch_info = {
+ .opt_set_funcs = opt_set_funcs,
+ .help = help
+ };
++#else
++stressor_info_t stress_hsearch_info = {
++ .stressor = stress_not_implemented,
++ .class = CLASS_CPU_CACHE | CLASS_CPU | CLASS_MEMORY,
++ .help = help
++};
++#endif
+--
+2.32.0
+
diff --git a/Ports/stress-ng/patches/0005-misc-fixups.patch b/Ports/stress-ng/patches/0005-misc-fixups.patch
deleted file mode 100644
index 021cb4f932..0000000000
--- a/Ports/stress-ng/patches/0005-misc-fixups.patch
+++ /dev/null
@@ -1,629 +0,0 @@
-diff -ur a/stress-fork.c b/stress-fork.c
---- a/stress-fork.c 2020-11-07 10:52:22.000000000 -0800
-+++ b/stress-fork.c 2020-11-08 23:05:17.627668500 -0800
-@@ -198,6 +198,7 @@
- }
-
-
-+#if 0
- /*
- * stress_vfork()
- * stress by vforking and exiting
-@@ -218,16 +219,13 @@
- return stress_fork_fn(args, vfork, "vfork", vfork_max);
- }
- STRESS_PRAGMA_POP
-+#endif
-
- static const stress_opt_set_func_t fork_opt_set_funcs[] = {
- { OPT_fork_max, stress_set_fork_max },
- { 0, NULL }
- };
-
--static const stress_opt_set_func_t vfork_opt_set_funcs[] = {
-- { OPT_vfork_max, stress_set_vfork_max },
-- { 0, NULL }
--};
-
- stressor_info_t stress_fork_info = {
- .stressor = stress_fork,
-@@ -236,9 +234,16 @@
- .help = fork_help
- };
-
-+#if 0
-+static const stress_opt_set_func_t vfork_opt_set_funcs[] = {
-+ { OPT_vfork_max, stress_set_vfork_max },
-+ { 0, NULL }
-+};
-+
- stressor_info_t stress_vfork_info = {
- .stressor = stress_vfork,
- .class = CLASS_SCHEDULER | CLASS_OS,
- .opt_set_funcs = vfork_opt_set_funcs,
- .help = vfork_help
- };
-+#endif
-diff -ur a/stress-get.c b/stress-get.c
---- a/stress-get.c 2020-11-07 10:52:22.000000000 -0800
-+++ b/stress-get.c 2020-11-08 22:42:06.027668500 -0800
-@@ -162,7 +162,9 @@
- #endif
- struct timeval tv;
- struct timezone tz;
-+#if 0
- struct rlimit rlim;
-+#endif
- time_t t, t1, t2;
- pid_t pid;
- gid_t gid;
-@@ -324,6 +326,8 @@
- check_do_run();
- }
- #endif
-+
-+#if 0
- /* Invalid getrlimit syscall and ignoring failure */
- (void)getrlimit(INT_MAX, &rlim);
-
-@@ -334,6 +338,7 @@
- args->name, i, errno, strerror(errno));
- check_do_run();
- }
-+#endif 0
-
- #if defined(__NR_ugetrlimit)
- /*
-diff -ur a/stress-hdd.c b/stress-hdd.c
---- a/stress-hdd.c 2020-11-07 10:52:22.000000000 -0800
-+++ b/stress-hdd.c 2020-11-08 23:19:59.907668500 -0800
-@@ -277,11 +277,11 @@
- #endif
- default:
- /* 50% */
-- return readv(fd, iov, HDD_IO_VEC_MAX);
-+ break;
- }
-- } else {
-- return read(fd, buf, count);
-- }
-+ }
-+
-+ return read(fd, buf, count);
- }
-
-
-diff -ur a/stress-ng.c b/stress-ng.c
---- a/stress-ng.c 2020-11-07 10:52:22.000000000 -0800
-+++ b/stress-ng.c 2020-11-08 23:29:08.447668500 -0800
-@@ -321,10 +321,6 @@
- { "dir", 1, 0, OPT_dir },
- { "dir-ops", 1, 0, OPT_dir_ops },
- { "dir-dirs", 1, 0, OPT_dir_dirs },
-- { "dirdeep", 1, 0, OPT_dirdeep },
-- { "dirdeep-ops",1, 0, OPT_dirdeep_ops },
-- { "dirdeep-dirs",1, 0, OPT_dirdeep_dirs },
-- { "dirdeep-inodes",1, 0, OPT_dirdeep_inodes },
- { "dry-run", 0, 0, OPT_dry_run },
- { "dnotify", 1, 0, OPT_dnotify },
- { "dnotify-ops",1, 0, OPT_dnotify_ops },
-@@ -409,9 +405,6 @@
- { "hrtimers", 1, 0, OPT_hrtimers },
- { "hrtimers-ops",1, 0, OPT_hrtimers_ops },
- { "help", 0, 0, OPT_help },
-- { "hsearch", 1, 0, OPT_hsearch },
-- { "hsearch-ops",1, 0, OPT_hsearch_ops },
-- { "hsearch-size",1, 0, OPT_hsearch_size },
- { "icache", 1, 0, OPT_icache },
- { "icache-ops", 1, 0, OPT_icache_ops },
- { "icmp-flood", 1, 0, OPT_icmp_flood },
-@@ -425,9 +418,6 @@
- { "inotify-ops",1, 0, OPT_inotify_ops },
- { "io", 1, 0, OPT_io },
- { "io-ops", 1, 0, OPT_io_ops },
-- { "iomix", 1, 0, OPT_iomix },
-- { "iomix-bytes",1, 0, OPT_iomix_bytes },
-- { "iomix-ops", 1, 0, OPT_iomix_ops },
- { "ionice-class",1, 0, OPT_ionice_class },
- { "ionice-level",1, 0, OPT_ionice_level },
- { "ioport", 1, 0, OPT_ioport },
-@@ -440,10 +430,6 @@
- { "ipsec-mb", 1, 0, OPT_ipsec_mb },
- { "ipsec-mb-ops",1, 0, OPT_ipsec_mb_ops },
- { "ipsec-mb-feature",1, 0, OPT_ipsec_mb_feature },
-- { "itimer", 1, 0, OPT_itimer },
-- { "itimer-ops", 1, 0, OPT_itimer_ops },
-- { "itimer-freq",1, 0, OPT_itimer_freq },
-- { "itimer-rand",0, 0, OPT_itimer_rand },
- { "job", 1, 0, OPT_job },
- { "judy", 1, 0, OPT_judy },
- { "judy-ops", 1, 0, OPT_judy_ops },
-@@ -477,9 +463,6 @@
- { "longjmp-ops",1, 0, OPT_longjmp_ops },
- { "loop", 1, 0, OPT_loop },
- { "loop-ops", 1, 0, OPT_loop_ops },
-- { "lsearch", 1, 0, OPT_lsearch },
-- { "lsearch-ops",1, 0, OPT_lsearch_ops },
-- { "lsearch-size",1, 0, OPT_lsearch_size },
- { "madvise", 1, 0, OPT_madvise },
- { "madvise-ops",1, 0, OPT_madvise_ops },
- { "malloc", 1, 0, OPT_malloc },
-@@ -669,21 +652,14 @@
- { "revio-ops", 1, 0, OPT_revio_ops },
- { "revio-opts", 1, 0, OPT_revio_opts },
- { "revio-bytes",1, 0, OPT_revio_bytes },
-- { "rlimit", 1, 0, OPT_rlimit },
-- { "rlimit-ops", 1, 0, OPT_rlimit_ops },
-- { "rmap", 1, 0, OPT_rmap },
-- { "rmap-ops", 1, 0, OPT_rmap_ops },
- { "rtc", 1, 0, OPT_rtc },
- { "rtc-ops", 1, 0, OPT_rtc_ops },
- { "sched", 1, 0, OPT_sched },
- { "sched-prio", 1, 0, OPT_sched_prio },
-- { "schedpolicy",1, 0, OPT_schedpolicy },
-- { "schedpolicy-ops",1, 0, OPT_schedpolicy_ops },
- { "sched-period",1, 0, OPT_sched_period },
- { "sched-runtime",1, 0, OPT_sched_runtime },
- { "sched-deadline",1, 0, OPT_sched_deadline },
- { "sched-reclaim",0, 0, OPT_sched_reclaim },
-- { "schedpolicy",1, 0, OPT_schedpolicy },
- { "sctp", 1, 0, OPT_sctp },
- { "sctp-ops", 1, 0, OPT_sctp_ops },
- { "sctp-domain",1, 0, OPT_sctp_domain },
-@@ -699,17 +675,12 @@
- { "sem", 1, 0, OPT_sem },
- { "sem-ops", 1, 0, OPT_sem_ops },
- { "sem-procs", 1, 0, OPT_sem_procs },
-- { "sem-sysv", 1, 0, OPT_sem_sysv },
-- { "sem-sysv-ops",1, 0, OPT_sem_sysv_ops },
-- { "sem-sysv-procs",1, 0, OPT_sem_sysv_procs },
- { "sendfile", 1, 0, OPT_sendfile },
- { "sendfile-ops",1, 0, OPT_sendfile_ops },
- { "sendfile-size",1, 0, OPT_sendfile_size },
- { "sequential", 1, 0, OPT_sequential },
- { "session", 1, 0, OPT_session },
- { "session-ops",1, 0, OPT_session_ops },
-- { "set", 1, 0, OPT_set },
-- { "set-ops", 1, 0, OPT_set_ops },
- { "shellsort", 1, 0, OPT_shellsort },
- { "shellsort-ops",1, 0, OPT_shellsort_ops },
- { "shellsort-size",1, 0, OPT_shellsort_integers },
-@@ -717,10 +688,6 @@
- { "shm-ops", 1, 0, OPT_shm_ops },
- { "shm-bytes", 1, 0, OPT_shm_bytes },
- { "shm-objs", 1, 0, OPT_shm_objects },
-- { "shm-sysv", 1, 0, OPT_shm_sysv },
-- { "shm-sysv-ops",1, 0, OPT_shm_sysv_ops },
-- { "shm-sysv-bytes",1, 0, OPT_shm_sysv_bytes },
-- { "shm-sysv-segs",1, 0, OPT_shm_sysv_segments },
- { "sigabrt", 1, 0, OPT_sigabrt },
- { "sigabrt-ops",1, 0, OPT_sigabrt_ops },
- { "sigchld", 1, 0, OPT_sigchld },
-@@ -769,8 +736,6 @@
- { "sockfd-port",1, 0, OPT_sockfd_port },
- { "sockmany", 1, 0, OPT_sockmany },
- { "sockmany-ops",1, 0, OPT_sockmany_ops },
-- { "sockpair", 1, 0, OPT_sockpair },
-- { "sockpair-ops",1, 0, OPT_sockpair_ops },
- { "softlockup", 1, 0, OPT_softlockup },
- { "softlockup-ops",1, 0, OPT_softlockup_ops },
- { "spawn", 1, 0, OPT_spawn },
-@@ -802,8 +767,6 @@
- { "sync-file", 1, 0, OPT_sync_file },
- { "sync-file-ops", 1, 0, OPT_sync_file_ops },
- { "sync-file-bytes", 1, 0, OPT_sync_file_bytes },
-- { "sysbadaddr", 1, 0, OPT_sysbadaddr },
-- { "sysbadaddr-ops",1, 0, OPT_sysbadaddr_ops },
- { "sysfs", 1, 0, OPT_sysfs },
- { "sysfs-ops",1, 0, OPT_sysfs_ops },
- { "sysinfo", 1, 0, OPT_sysinfo },
-@@ -839,9 +802,6 @@
- { "tree-size", 1, 0, OPT_tree_size },
- { "tsc", 1, 0, OPT_tsc },
- { "tsc-ops", 1, 0, OPT_tsc_ops },
-- { "tsearch", 1, 0, OPT_tsearch },
-- { "tsearch-ops",1, 0, OPT_tsearch_ops },
-- { "tsearch-size",1, 0, OPT_tsearch_size },
- { "thrash", 0, 0, OPT_thrash },
- { "times", 0, 0, OPT_times },
- { "timestamp", 0, 0, OPT_timestamp },
-@@ -866,9 +826,6 @@
- { "userfaultfd",1, 0, OPT_userfaultfd },
- { "userfaultfd-ops",1, 0, OPT_userfaultfd_ops },
- { "userfaultfd-bytes",1,0, OPT_userfaultfd_bytes },
-- { "utime", 1, 0, OPT_utime },
-- { "utime-ops", 1, 0, OPT_utime_ops },
-- { "utime-fsync",0, 0, OPT_utime_fsync },
- { "vdso", 1, 0, OPT_vdso },
- { "vdso-ops", 1, 0, OPT_vdso_ops },
- { "vdso-func", 1, 0, OPT_vdso_func },
-@@ -879,11 +836,6 @@
- { "verity", 1, 0, OPT_verity },
- { "verity-ops", 1, 0, OPT_verity_ops },
- { "version", 0, 0, OPT_version },
-- { "vfork", 1, 0, OPT_vfork },
-- { "vfork-ops", 1, 0, OPT_vfork_ops },
-- { "vfork-max", 1, 0, OPT_vfork_max },
-- { "vforkmany", 1, 0, OPT_vforkmany },
-- { "vforkmany-ops", 1, 0, OPT_vforkmany_ops },
- { "vm", 1, 0, OPT_vm },
- { "vm-bytes", 1, 0, OPT_vm_bytes },
- { "vm-hang", 1, 0, OPT_vm_hang },
-@@ -2964,6 +2916,7 @@
- */
- static inline void stress_mlock_executable(void)
- {
-+#if 0
- #if defined(MLOCKED_SECTION)
- extern void *__start_mlocked_text;
- extern void *__stop_mlocked_text;
-@@ -2973,6 +2926,7 @@
- stress_mlock_region(&__start_mlocked_text, &__stop_mlocked_text);
- stress_mlock_region(&__start_mlocked_data, &__stop_mlocked_data);
- #endif
-+#endif
- }
-
- int main(int argc, char **argv, char **envp)
-diff -ur a/stress-ng.h b/stress-ng.h
---- a/stress-ng.h 2020-11-07 10:52:22.000000000 -0800
-+++ b/stress-ng.h 2020-11-08 23:25:40.027668500 -0800
-@@ -56,7 +56,6 @@
- #include <math.h>
- #include <pwd.h>
- #include <sched.h>
--#include <search.h>
- #include <setjmp.h>
- #include <signal.h>
- #include <stdarg.h>
-@@ -1092,6 +1092,7 @@
- #define PACKED
- #endif
-
-+#undef ALWAYS_INLINE
- /* force inlining hint */
- #if defined(__GNUC__) && NEED_GNUC(3,4,0) /* or possibly earlier */ \
- && ((!defined(__s390__) && !defined(__s390x__)) || NEED_GNUC(6,0,1))
-@@ -2230,7 +2221,6 @@
- uint64_t timeout[STRESS_PROCS_MAX]; /* Shared futex timeouts */
- } futex;
- struct {
-- key_t key_id; /* System V semaphore key id */
- int sem_id; /* System V semaphore id */
- bool init; /* System V semaphore initialized */
- } sem_sysv;
-@@ -2288,7 +2278,6 @@
- MACRO(close) \
- MACRO(context) \
- MACRO(copy_file) \
-- MACRO(cpu) \
- MACRO(cpu_online) \
- MACRO(crypt) \
- MACRO(cyclic) \
-@@ -2298,7 +2287,6 @@
- MACRO(dev) \
- MACRO(dev_shm) \
- MACRO(dir) \
-- MACRO(dirdeep) \
- MACRO(dnotify) \
- MACRO(dup) \
- MACRO(dynlib) \
-@@ -2331,19 +2319,16 @@
- MACRO(hdd) \
- MACRO(heapsort) \
- MACRO(hrtimers) \
-- MACRO(hsearch) \
- MACRO(icache) \
- MACRO(icmp_flood) \
- MACRO(idle_page) \
- MACRO(inode_flags) \
- MACRO(inotify) \
- MACRO(io) \
-- MACRO(iomix) \
- MACRO(ioport) \
- MACRO(ioprio) \
- MACRO(io_uring) \
- MACRO(ipsec_mb) \
-- MACRO(itimer) \
- MACRO(judy) \
- MACRO(kcmp) \
- MACRO(key) \
-@@ -2357,7 +2342,6 @@
- MACRO(lockofd) \
- MACRO(longjmp) \
- MACRO(loop) \
-- MACRO(lsearch) \
- MACRO(madvise) \
- MACRO(malloc) \
- MACRO(matrix) \
-@@ -2421,22 +2405,16 @@
- MACRO(rename) \
- MACRO(resources) \
- MACRO(revio) \
-- MACRO(rlimit) \
-- MACRO(rmap) \
- MACRO(rtc) \
-- MACRO(schedpolicy) \
- MACRO(sctp) \
- MACRO(seal) \
- MACRO(seccomp) \
- MACRO(seek) \
- MACRO(sem) \
-- MACRO(sem_sysv) \
- MACRO(sendfile) \
- MACRO(session) \
-- MACRO(set) \
- MACRO(shellsort) \
- MACRO(shm) \
-- MACRO(shm_sysv) \
- MACRO(sigabrt) \
- MACRO(sigchld) \
- MACRO(sigfd) \
-@@ -2456,7 +2434,6 @@
- MACRO(sockabuse) \
- MACRO(sockdiag) \
- MACRO(sockfd) \
-- MACRO(sockpair) \
- MACRO(sockmany) \
- MACRO(softlockup) \
- MACRO(spawn) \
-@@ -2469,7 +2446,6 @@
- MACRO(switch) \
- MACRO(symlink) \
- MACRO(sync_file) \
-- MACRO(sysbadaddr) \
- MACRO(sysinfo) \
- MACRO(sysinval) \
- MACRO(sysfs) \
-@@ -2480,7 +2456,6 @@
- MACRO(tmpfs) \
- MACRO(tree) \
- MACRO(tsc) \
-- MACRO(tsearch) \
- MACRO(tun) \
- MACRO(udp) \
- MACRO(udp_flood) \
-@@ -2488,12 +2463,9 @@
- MACRO(uprobe) \
- MACRO(urandom) \
- MACRO(userfaultfd) \
-- MACRO(utime) \
- MACRO(vdso) \
- MACRO(vecmath) \
- MACRO(verity) \
-- MACRO(vfork) \
-- MACRO(vforkmany) \
- MACRO(vm) \
- MACRO(vm_addr) \
- MACRO(vm_rw) \
-@@ -2709,11 +2681,6 @@
- OPT_dir_ops,
- OPT_dir_dirs,
-
-- OPT_dirdeep,
-- OPT_dirdeep_ops,
-- OPT_dirdeep_dirs,
-- OPT_dirdeep_inodes,
--
- OPT_dnotify,
- OPT_dnotify_ops,
-
-@@ -2825,10 +2792,6 @@
- OPT_hrtimers,
- OPT_hrtimers_ops,
-
-- OPT_hsearch,
-- OPT_hsearch_ops,
-- OPT_hsearch_size,
--
- OPT_icache,
- OPT_icache_ops,
-
-@@ -2846,10 +2809,6 @@
- OPT_inotify,
- OPT_inotify_ops,
-
-- OPT_iomix,
-- OPT_iomix_bytes,
-- OPT_iomix_ops,
--
- OPT_ioport,
- OPT_ioport_ops,
- OPT_ioport_opts,
-@@ -2869,11 +2828,6 @@
- OPT_ipsec_mb_ops,
- OPT_ipsec_mb_feature,
-
-- OPT_itimer,
-- OPT_itimer_ops,
-- OPT_itimer_freq,
-- OPT_itimer_rand,
--
- OPT_judy,
- OPT_judy_ops,
- OPT_judy_size,
-@@ -2919,10 +2873,6 @@
- OPT_loop,
- OPT_loop_ops,
-
-- OPT_lsearch,
-- OPT_lsearch_ops,
-- OPT_lsearch_size,
--
- OPT_madvise,
- OPT_madvise_ops,
-
-@@ -3170,9 +3120,6 @@
- OPT_revio_opts,
- OPT_revio_bytes,
-
-- OPT_rlimit,
-- OPT_rlimit_ops,
--
- OPT_rmap,
- OPT_rmap_ops,
-
-@@ -3182,9 +3129,6 @@
- OPT_sched,
- OPT_sched_prio,
-
-- OPT_schedpolicy,
-- OPT_schedpolicy_ops,
--
- OPT_sched_period,
- OPT_sched_runtime,
- OPT_sched_deadline,
-@@ -3214,16 +3158,9 @@
- OPT_sem_ops,
- OPT_sem_procs,
-
-- OPT_sem_sysv,
-- OPT_sem_sysv_ops,
-- OPT_sem_sysv_procs,
--
- OPT_session,
- OPT_session_ops,
-
-- OPT_set,
-- OPT_set_ops,
--
- OPT_shellsort,
- OPT_shellsort_ops,
- OPT_shellsort_integers,
-@@ -3233,11 +3170,6 @@
- OPT_shm_bytes,
- OPT_shm_objects,
-
-- OPT_shm_sysv,
-- OPT_shm_sysv_ops,
-- OPT_shm_sysv_bytes,
-- OPT_shm_sysv_segments,
--
- OPT_sequential,
-
- OPT_sigabrt,
-@@ -3307,9 +3239,6 @@
- OPT_sockmany,
- OPT_sockmany_ops,
-
-- OPT_sockpair,
-- OPT_sockpair_ops,
--
- OPT_softlockup,
- OPT_softlockup_ops,
-
-@@ -3352,9 +3281,6 @@
- OPT_sync_file_ops,
- OPT_sync_file_bytes,
-
-- OPT_sysbadaddr,
-- OPT_sysbadaddr_ops,
--
- OPT_sysinfo,
- OPT_sysinfo_ops,
-
-@@ -3408,10 +3334,6 @@
- OPT_tsc,
- OPT_tsc_ops,
-
-- OPT_tsearch,
-- OPT_tsearch_ops,
-- OPT_tsearch_size,
--
- OPT_tun,
- OPT_tun_ops,
- OPT_tun_tap,
-@@ -3438,10 +3360,6 @@
- OPT_userfaultfd_ops,
- OPT_userfaultfd_bytes,
-
-- OPT_utime,
-- OPT_utime_ops,
-- OPT_utime_fsync,
--
- OPT_vdso,
- OPT_vdso_ops,
- OPT_vdso_func,
-@@ -3454,13 +3372,6 @@
- OPT_verity,
- OPT_verity_ops,
-
-- OPT_vfork,
-- OPT_vfork_ops,
-- OPT_vfork_max,
--
-- OPT_vforkmany,
-- OPT_vforkmany_ops,
--
- OPT_vm_bytes,
- OPT_vm_hang,
- OPT_vm_keep,
-iff -ur a/stress-schedpolicy.c b/stress-schedpolicy.c
---- a/stress-schedpolicy.c 2020-11-07 10:52:22.000000000 -0800
-+++ b/stress-schedpolicy.c 2020-11-08 23:22:11.257668500 -0800
-@@ -117,7 +117,9 @@
- case SCHED_OTHER:
- #endif
- param.sched_priority = 0;
-+#if 0
- ret = sched_setscheduler(pid, new_policy, &param);
-+#endif
- break;
- #if defined(SCHED_RR)
- case SCHED_RR:
-
-diff -Naur stress-ng-0.11.23/core-net.c stress-ng-0.11.23.serenity/core-net.c
---- stress-ng-0.11.23/core-net.c 2021-04-13 03:20:49.389317525 +0200
-+++ stress-ng-0.11.23.serenity/core-net.c 2021-04-13 03:21:42.786948162 +0200
-@@ -114,6 +114,7 @@
- break;
- }
- #endif
-+#ifndef __serenity__
- #if defined(AF_INET6)
- case AF_INET6: {
- static struct sockaddr_in6 addr;
-@@ -138,6 +139,7 @@
- break;
- }
- #endif
-+#endif
- #if defined(AF_UNIX)
- case AF_UNIX: {
- static struct sockaddr_un addr;
-@@ -176,6 +178,7 @@
- break;
- }
- #endif
-+#ifndef __serenity__
- #if defined(AF_INET6)
- case AF_INET6: {
- struct sockaddr_in6 *addr = (struct sockaddr_in6 *)sockaddr;
-@@ -183,6 +186,7 @@
- break;
- }
- #endif
-+#endif
- #if defined(AF_UNIX)
- case AF_UNIX:
- break;
-diff -Naur stress-ng-0.11.23/stress-zlib.c stress-ng-0.11.23.serenity/stress-zlib.c
---- stress-ng-0.11.23/stress-zlib.c 2021-04-13 03:29:29.112182330 +0200
-+++ stress-ng-0.11.23.serenity/stress-zlib.c 2021-04-13 03:28:52.128162386 +0200
-@@ -698,14 +698,14 @@
- register int i;
-
- if (UNLIKELY(!seeded)) {
-- srand48(stress_mwc32());
-+ srand(stress_mwc32());
- seeded = true;
- }
-
- (void)args;
-
- for (i = 0; i < n; i++, data++)
-- *data = lrand48();
-+ *data = rand();
- }
-
- /*
diff --git a/Ports/stress-ng/patches/0006-disable-lchown-calls-from-sysbadaddr.patch b/Ports/stress-ng/patches/0006-disable-lchown-calls-from-sysbadaddr.patch
new file mode 100644
index 0000000000..d0722321b3
--- /dev/null
+++ b/Ports/stress-ng/patches/0006-disable-lchown-calls-from-sysbadaddr.patch
@@ -0,0 +1,41 @@
+From 1c2a6348c19fa42e45c43a73b34c37db83391d5c Mon Sep 17 00:00:00 2001
+From: Brian Gianforcaro <b.gianfo@gmail.com>
+Date: Mon, 27 Dec 2021 23:28:58 -0800
+Subject: [PATCH 06/14] serenity: Disable lchown() calls from sysbadaddr
+ stressor on Serenity
+
+Serenity doesn't have an lchown implementation yet.
+---
+ stress-sysbadaddr.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/stress-sysbadaddr.c b/stress-sysbadaddr.c
+index 8d0481b..18166f3 100644
+--- a/stress-sysbadaddr.c
++++ b/stress-sysbadaddr.c
+@@ -424,10 +424,12 @@ static int bad_ioctl(void *addr)
+ }
+ #endif
+
++#ifndef __serenity__
+ static int bad_lchown(void *addr)
+ {
+ return lchown((char *)addr, getuid(), getgid());
+ }
++#endif
+
+ static int bad_link(void *addr)
+ {
+@@ -856,7 +858,9 @@ static stress_bad_syscall_t bad_syscalls[] = {
+ #if defined(TCGETS)
+ bad_ioctl,
+ #endif
++#ifndef __serenity__
+ bad_lchown,
++#endif
+ bad_link,
+ bad_lstat,
+ #if defined(HAVE_MADVISE)
+--
+2.32.0
+
diff --git a/Ports/stress-ng/patches/0007-disable-signal-code-validation.patch b/Ports/stress-ng/patches/0007-disable-signal-code-validation.patch
new file mode 100644
index 0000000000..5f79d92681
--- /dev/null
+++ b/Ports/stress-ng/patches/0007-disable-signal-code-validation.patch
@@ -0,0 +1,32 @@
+From 08258d635aa54ad755a05757b14b047ae9754e0f Mon Sep 17 00:00:00 2001
+From: Brian Gianforcaro <b.gianfo@gmail.com>
+Date: Mon, 27 Dec 2021 23:30:03 -0800
+Subject: [PATCH 07/14] serenity: Disable signal code validation for Serenity
+
+We don't currently have a definition for SEGV_ACCERR, so
+this validation is meaningless for SerenityOS.
+---
+ stress-sigsegv.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/stress-sigsegv.c b/stress-sigsegv.c
+index 18b1ca6..e6bdf17 100644
+--- a/stress-sigsegv.c
++++ b/stress-sigsegv.c
+@@ -196,10 +196,13 @@ static int stress_sigsegv(const stress_args_t *args)
+ pr_fail("%s: expecting SIGSEGV/SIGILL/SIGBUS, got %s instead\n",
+ args->name, strsignal(signo));
+ }
++
++#if !defined(__serenity__)
+ if (verify && (signo == SIGBUS) && (code != SEGV_ACCERR)) {
+ pr_fail("%s: expecting SIGBUS si_code SEGV_ACCERR (%d), got %d instead\n",
+ args->name, SEGV_ACCERR, code);
+ }
++#endif
+ #endif
+ inc_counter(args);
+ } else {
+--
+2.32.0
+
diff --git a/Ports/stress-ng/patches/0008-disable-lchown.patch b/Ports/stress-ng/patches/0008-disable-lchown.patch
new file mode 100644
index 0000000000..73c11e7666
--- /dev/null
+++ b/Ports/stress-ng/patches/0008-disable-lchown.patch
@@ -0,0 +1,35 @@
+From 1903b9e5ddae07c13c56f6b7e85a0629450d2b6d Mon Sep 17 00:00:00 2001
+From: Brian Gianforcaro <b.gianfo@gmail.com>
+Date: Mon, 27 Dec 2021 23:37:23 -0800
+Subject: [PATCH 08/14] serenity: Disable lchown() calls in stress-chown
+ stressor for SerenityOS
+
+Serenity doesn't have an lchown implementation, so compile it out.
+---
+ stress-chown.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/stress-chown.c b/stress-chown.c
+index 5d53806..caefd90 100644
+--- a/stress-chown.c
++++ b/stress-chown.c
+@@ -221,6 +221,8 @@ static int stress_chown(const stress_args_t *args)
+ pr_fail("%s: chown %s failed, errno=%d (%s)\n",
+ args->name, filename, errno, strerror(errno));
+ }
++
++#ifndef __serenity__
+ ret = do_chown(lchown, filename, cap_chown, uid, gid);
+ if (ret < 0) {
+ if ((ret == -ENOENT) || (ret == -ENOTDIR)) {
+@@ -235,6 +237,7 @@ static int stress_chown(const stress_args_t *args)
+ pr_fail("%s: chown %s failed, errno=%d (%s)\n",
+ args->name, filename, errno, strerror(errno));
+ }
++#endif
+ inc_counter(args);
+ } while (keep_stressing(args));
+
+--
+2.32.0
+
diff --git a/Ports/stress-ng/patches/0009-add-empty-o_ndelay.patch b/Ports/stress-ng/patches/0009-add-empty-o_ndelay.patch
new file mode 100644
index 0000000000..ef5822e598
--- /dev/null
+++ b/Ports/stress-ng/patches/0009-add-empty-o_ndelay.patch
@@ -0,0 +1,32 @@
+From 950c136f14b983717963d5b5ae647ca3aebddd01 Mon Sep 17 00:00:00 2001
+From: Brian Gianforcaro <b.gianfo@gmail.com>
+Date: Mon, 27 Dec 2021 23:38:11 -0800
+Subject: [PATCH 09/14] serenity: Add a empty O_NDELAY symbol so the dev
+ stressor will compile
+
+Serenity doesn't yet support O_NDELAY, so just make it compile by making
+the definition 0, so the bitmask will be meaningless.
+---
+ stress-dev.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/stress-dev.c b/stress-dev.c
+index 1fab38e..9ab1b31 100644
+--- a/stress-dev.c
++++ b/stress-dev.c
+@@ -24,6 +24,12 @@
+ */
+ #include "stress-ng.h"
+
++#ifdef __serenity__
++ /* Serenity doesn't yet support O_NDELAY, so just make it compile */
++ #define O_NDELAY (0)
++#endif
++
++
+ static const stress_help_t help[] = {
+ { NULL, "dev N", "start N device entry thrashing stressors" },
+ { NULL, "dev-ops N", "stop after N device thrashing bogo ops" },
+--
+2.32.0
+
diff --git a/Ports/stress-ng/patches/0010-disable-rand48-cpu-stressor.patch b/Ports/stress-ng/patches/0010-disable-rand48-cpu-stressor.patch
new file mode 100644
index 0000000000..9c6b836a42
--- /dev/null
+++ b/Ports/stress-ng/patches/0010-disable-rand48-cpu-stressor.patch
@@ -0,0 +1,44 @@
+From 2742eeb0aca33560354de125fb7af3cbe986b414 Mon Sep 17 00:00:00 2001
+From: Brian Gianforcaro <b.gianfo@gmail.com>
+Date: Mon, 27 Dec 2021 23:46:44 -0800
+Subject: [PATCH 10/14] serenity: Disable rand48 cpu stressor, it's not
+ implemented for Serenity
+
+---
+ stress-cpu.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/stress-cpu.c b/stress-cpu.c
+index 81dd882..b3a586d 100644
+--- a/stress-cpu.c
++++ b/stress-cpu.c
+@@ -611,6 +611,7 @@ static void HOT OPTIMIZE3 stress_cpu_rand(const char *name)
+ "pseudo-random values\n", name);
+ }
+
++#if !defined(__serenity__)
+ /*
+ * stress_cpu_rand48()
+ * generate random values using rand48 family of functions
+@@ -631,6 +632,7 @@ static void HOT OPTIMIZE3 stress_cpu_rand48(const char *name)
+ stress_double_put(d);
+ stress_uint64_put((uint64_t)l);
+ }
++#endif
+
+ /*
+ * stress_cpu_lfsr32()
+@@ -3190,7 +3192,10 @@ static const stress_cpu_method_info_t cpu_methods[] = {
+ { "psi", stress_cpu_psi },
+ { "queens", stress_cpu_queens },
+ { "rand", stress_cpu_rand },
++
++#if !defined(__serenity__)
+ { "rand48", stress_cpu_rand48 },
++#endif
+ { "rgb", stress_cpu_rgb },
+ { "sdbm", stress_cpu_sdbm },
+ { "sieve", stress_cpu_sieve },
+--
+2.32.0
+
diff --git a/Ports/stress-ng/patches/0011-make-lsearch-stressor-a-nop.patch b/Ports/stress-ng/patches/0011-make-lsearch-stressor-a-nop.patch
new file mode 100644
index 0000000000..3c5960b5ae
--- /dev/null
+++ b/Ports/stress-ng/patches/0011-make-lsearch-stressor-a-nop.patch
@@ -0,0 +1,36 @@
+From 176c9d8becd0ea0469a9d75df46a78ae913acd33 Mon Sep 17 00:00:00 2001
+From: Brian Gianforcaro <b.gianfo@gmail.com>
+Date: Mon, 27 Dec 2021 23:47:22 -0800
+Subject: [PATCH 11/14] serenity: Make lsearch stressor a nop on Serenity
+
+---
+ stress-lsearch.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/stress-lsearch.c b/stress-lsearch.c
+index 60174a2..74a9ef9 100644
+--- a/stress-lsearch.c
++++ b/stress-lsearch.c
+@@ -31,6 +31,8 @@ static const stress_help_t help[] = {
+ { NULL, NULL, NULL }
+ };
+
++#if !defined(__serenity__)
++
+ /*
+ * stress_set_lsearch_size()
+ * set lsearch size from given option string
+@@ -129,3 +131,10 @@ stressor_info_t stress_lsearch_info = {
+ .opt_set_funcs = opt_set_funcs,
+ .help = help
+ };
++#else
++stressor_info_t stress_lsearch_info = {
++ .stressor = stress_not_implemented,
++ .class = CLASS_CPU_CACHE | CLASS_CPU | CLASS_MEMORY,
++ .help = help
++};
++#endif
+--
+2.32.0
+
diff --git a/Ports/stress-ng/patches/0012-fake-o_sync.patch b/Ports/stress-ng/patches/0012-fake-o_sync.patch
new file mode 100644
index 0000000000..78e04cee4e
--- /dev/null
+++ b/Ports/stress-ng/patches/0012-fake-o_sync.patch
@@ -0,0 +1,31 @@
+From 190c38897e6d8827f9cd6960e2b8e1f4f3d0cb40 Mon Sep 17 00:00:00 2001
+From: Brian Gianforcaro <b.gianfo@gmail.com>
+Date: Mon, 27 Dec 2021 23:47:45 -0800
+Subject: [PATCH 12/14] serenity: Fake O_SYNC for serenity so iomix stressor
+ compiles
+
+Serenity doesn't yet support O_SYNC, so just make it compile.
+---
+ stress-iomix.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/stress-iomix.c b/stress-iomix.c
+index edf90f0..54176f8 100644
+--- a/stress-iomix.c
++++ b/stress-iomix.c
+@@ -25,6 +25,12 @@
+ */
+ #include "stress-ng.h"
+
++#ifdef __serenity__
++ /* Serenity doesn't yet support O_SYNC, so just make it compile */
++ #define O_SYNC (0)
++#endif
++
++
+ typedef void (*stress_iomix_func)(const stress_args_t *args, const int fd, const off_t iomix_bytes);
+
+ static const stress_help_t help[] = {
+--
+2.32.0
+
diff --git a/Ports/stress-ng/patches/0013-disable-lrand48-zlib-stress.patch b/Ports/stress-ng/patches/0013-disable-lrand48-zlib-stress.patch
new file mode 100644
index 0000000000..9e5f0591cc
--- /dev/null
+++ b/Ports/stress-ng/patches/0013-disable-lrand48-zlib-stress.patch
@@ -0,0 +1,53 @@
+From 2db39e274a4dcdc5d4a892371ce5aba45e91c187 Mon Sep 17 00:00:00 2001
+From: Brian Gianforcaro <b.gianfo@gmail.com>
+Date: Mon, 27 Dec 2021 23:48:49 -0800
+Subject: [PATCH 13/14] serenity: Disable lrand48 zlib stress, it is not
+ implemented for Serenity
+
+---
+ stress-zlib.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/stress-zlib.c b/stress-zlib.c
+index dbe5758..95c65f5 100644
+--- a/stress-zlib.c
++++ b/stress-zlib.c
+@@ -696,6 +696,7 @@ static void stress_rand_data_lfsr32(
+ }
+ }
+
++#if !defined(__serenity__)
+ /*
+ * stress_rand_data_lrand48()
+ * fills buffer with random data from lrand48
+@@ -719,6 +720,7 @@ static void stress_rand_data_lrand48(
+ while (ptr < end)
+ *(ptr++) = lrand48();
+ }
++#endif
+
+ /*
+ * stress_rand_data_latin()
+@@ -883,7 +885,9 @@ static const stress_zlib_rand_data_func rand_data_funcs[] = {
+ stress_rand_data_fixed,
+ stress_rand_data_gray,
+ stress_rand_data_latin,
++#if !defined(__serenity__)
+ stress_rand_data_lrand48,
++#endif
+ stress_rand_data_nybble,
+ stress_rand_data_objcode,
+ stress_rand_data_parity,
+@@ -926,7 +930,9 @@ static const stress_zlib_rand_data_info_t zlib_rand_data_methods[] = {
+ { "latin", stress_rand_data_latin },
+ { "logmap", stress_rand_data_logmap },
+ { "lfsr32", stress_rand_data_lfsr32 },
++#if !defined(__serenity__)
+ { "lrand48", stress_rand_data_lrand48 },
++#endif
+ { "morse", stress_rand_data_morse },
+ { "nybble", stress_rand_data_nybble },
+ { "objcode", stress_rand_data_objcode },
+--
+2.32.0
+
diff --git a/Ports/stress-ng/patches/0014-fix-stress_get_prime64-variable-type.patch b/Ports/stress-ng/patches/0014-fix-stress_get_prime64-variable-type.patch
new file mode 100644
index 0000000000..6d29beac1a
--- /dev/null
+++ b/Ports/stress-ng/patches/0014-fix-stress_get_prime64-variable-type.patch
@@ -0,0 +1,27 @@
+From 6583316ac6b13a131dc111ac8a8db2049f2f1cd2 Mon Sep 17 00:00:00 2001
+From: Brian Gianforcaro <b.gianfo@gmail.com>
+Date: Mon, 27 Dec 2021 23:49:39 -0800
+Subject: [PATCH 14/14] serenity: Fix stress_get_prime64 variable type, uint ->
+ uint64_t
+
+Serenity doesn't have a definition for unit.
+---
+ core-helper.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/core-helper.c b/core-helper.c
+index 8215c56..bb2b018 100644
+--- a/core-helper.c
++++ b/core-helper.c
+@@ -1334,7 +1334,7 @@ bool stress_is_prime64(const uint64_t n)
+ */
+ uint64_t stress_get_prime64(const uint64_t n)
+ {
+- static uint p = 1009;
++ static uint64_t p = 1009;
+
+ if (n != p)
+ return p;
+--
+2.32.0
+
diff --git a/Ports/stress-ng/patches/install-prefix.patch b/Ports/stress-ng/patches/0015-install-prefix.patch
index dc1be665e0..dc1be665e0 100644
--- a/Ports/stress-ng/patches/install-prefix.patch
+++ b/Ports/stress-ng/patches/0015-install-prefix.patch