From: Anders Roxell <anders.roxell@linaro.org>
To: ltp@lists.linux.it, pvorel@suse.cz
Subject: [LTP] [PATCH v3 1/4] openposix: mqueues: Use one thread by default
Date: Wed, 25 Nov 2026 22:09:30 +0100 [thread overview]
Message-ID: <20261125210933.2913177-2-anders.roxell@linaro.org> (raw)
In-Reply-To: <20261125210933.2913177-1-anders.roxell@linaro.org>
multi_send_rev_1 and multi_send_rev_2 fail without the number of
threads as an argument. Only run-tests.sh passes it, from a .args file
that make install does not install.
Default to one thread like the .args files, and remove the unused
getopt.h include.
Suggested-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
.../stress/mqueues/multi_send_rev_1.c | 8 +++++---
.../stress/mqueues/multi_send_rev_2.c | 8 +++++---
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_1.c b/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_1.c
index 5003681f7bb4..fed92ae755e6 100644
--- a/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_1.c
+++ b/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_1.c
@@ -18,7 +18,6 @@
#include <sys/wait.h>
#include <sys/mman.h>
#include <string.h>
-#include <getopt.h>
#include <pthread.h>
#include <limits.h>
#include <mqueue.h>
@@ -28,6 +27,7 @@
#define MSG_SIZE 128
#define MAX_MSG 3
#define Max_Threads 10
+#define DEFAULT_THREADS 1
#define Name_Size 20
typedef struct {
@@ -96,8 +96,10 @@ int test_main(int argc, char **argv)
printf("_POSIX_MESSAGE_PASSING is not defined \n");
return PTS_UNRESOLVED;
#endif */
- if ((2 != argc) || ((num = atoi(argv[1])) <= 0)) {
- fprintf(stderr, "Usage: %s number_of_threads\n", argv[0]);
+ if (argc < 2) {
+ num = DEFAULT_THREADS;
+ } else if ((num = atoi(argv[1])) <= 0) {
+ fprintf(stderr, "Usage: %s [number_of_threads]\n", argv[0]);
return PTS_FAIL;
}
if (num > Max_Threads) {
diff --git a/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_2.c b/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_2.c
index 9fe44113f704..989273b2da83 100644
--- a/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_2.c
+++ b/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_2.c
@@ -18,7 +18,6 @@
#include <sys/wait.h>
#include <sys/mman.h>
#include <string.h>
-#include <getopt.h>
#include <pthread.h>
#include <limits.h>
#include <mqueue.h>
@@ -29,6 +28,7 @@
#define MSG_SIZE 128
#define MAX_MSG 5
#define Max_Threads 100
+#define DEFAULT_THREADS 1
static const char *s_msg_ptr[] =
{ "send_1 1", "send_1 2", "send_1 3", "send_1 4", "send_1 5" };
@@ -85,8 +85,10 @@ int test_main(int argc, char **argv)
printf("_POSIX_MESSAGE_PASSING is not defined \n");
return PTS_UNRESOLVED;
#endif */
- if ((2 != argc) || ((num = atoi(argv[1])) <= 0)) {
- fprintf(stderr, "Usage: %s number_of_threads\n", argv[0]);
+ if (argc < 2) {
+ num = DEFAULT_THREADS;
+ } else if ((num = atoi(argv[1])) <= 0) {
+ fprintf(stderr, "Usage: %s [number_of_threads]\n", argv[0]);
return PTS_FAIL;
}
if (num > Max_Threads) {
--
2.53.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-11-25 21:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 21:09 [LTP] [PATCH v3 0/4] openposix: Run the Open POSIX tests with kirk Anders Roxell
2026-11-25 21:09 ` Anders Roxell [this message]
2026-11-26 3:11 ` [LTP] openposix: mqueues: Use one thread by default linuxtestproject.agent
2026-11-25 21:09 ` [LTP] [PATCH v3 2/4] openposix: Remove the .args files Anders Roxell
2026-11-25 21:09 ` [LTP] [PATCH v3 3/4] openposix: Rebuild run.sh when the Makefile changes Anders Roxell
2026-11-25 21:09 ` [LTP] [PATCH v3 4/4] openposix: Add runtest files for kirk Anders Roxell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261125210933.2913177-2-anders.roxell@linaro.org \
--to=anders.roxell@linaro.org \
--cc=ltp@lists.linux.it \
--cc=pvorel@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.