[LTP] [PATCH 21/31] send*: Remove UCLINUX

Petr Vorel
2024-04-11T14:37:09Z

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) {