Skip to contentSkip to conversation

tools/nolibc: add pipe(), pipe2() and their testcase

PATCH Superseded Yuan Tan 2 participants 16 messages Jul 31, 2023 – Aug 1, 2023

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Yuan Tan

author
#0 lore raw

v2 cover tools/nolibc: add pipe(), pipe2() and their testcase

Hi, Willy, Thomas,

Thanks to your advice and I really learned a lot from it.

V2 now uses pipe2() to wrap pipe(), and fixes the strcmp issue in test case.

Best regards,
Yuan Tan

Yuan Tan (2):
tools/nolibc: add pipe() and pipe2() support
selftests/nolibc: add testcase for pipe

 tools/include/nolibc/sys.h                   | 24 ++++++++++++++
 tools/testing/selftests/nolibc/nolibc-test.c | 35 ++++++++++++++++++++
 2 files changed, 59 insertions(+)
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v2 1/2 tools/nolibc: add pipe() and pipe2() support

According to manual page [1], posix spec [2] and source code like arch/mips/kernel/syscall.c, for historic reasons, the sys_pipe() syscall on some architectures has an unusual calling convention. It returns results in two registers which means there is no need for it to do verify the validity of a userspace pointer argument. Historically that used to be expensive in Linux. These days the performance advantage is negligible.

Nolibc doesn't support the unusual calling convention above, luckily Linux provides a generic sys_pipe2() with an additional flags argument from 2.6.27. If flags is 0, then pipe2() is the same as pipe(). So here we use sys_pipe2() to implement the pipe().

pipe2() is also provided to allow users to use flags argument on demand.

[1]: https://man7.org/linux/man-pages/man2/pipe.2.html
[2]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/pipe.html

---
 tools/include/nolibc/sys.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
tools/include/nolibc/sys.h +24 -0
index 8bfe7db20b80..9fec09c22dbe 100644
@@ -752,6 +752,30 @@ int open(const char *path, int flags, ...)
 }
 
 
+/*
+ * int pipe2(int pipefd[2], int flags);
+ * int pipe(int pipefd[2]);
+ */
+
+static __attribute__((unused))
+int sys_pipe2(int pipefd[2], int flags)
+{
+	return my_syscall2(__NR_pipe, pipefd, flags);
+}
+
+static __attribute__((unused))
+int pipe2(int pipefd[2], int flags)
+{
+	return __sysret(sys_pipe2(pipefd, flags));
+}
+
+static __attribute__((unused))
+int pipe(int pipefd[2])
+{
+	pipe2(pipefd, 0);
+}
+
+
 /*
  * int prctl(int option, unsigned long arg2, unsigned long arg3,
  *                       unsigned long arg4, unsigned long arg5);
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH v2 1/2] tools/nolibc: add pipe() and pipe2() support

Quoted 33 lines · Yuan Tan

According to manual page [1], posix spec [2] and source code like arch/mips/kernel/syscall.c, for historic reasons, the sys_pipe() syscall on some architectures has an unusual calling convention. It returns results in two registers which means there is no need for it to do verify the validity of a userspace pointer argument. Historically that used to be expensive in Linux. These days the performance advantage is negligible.

Nolibc doesn't support the unusual calling convention above, luckily Linux provides a generic sys_pipe2() with an additional flags argument from 2.6.27. If flags is 0, then pipe2() is the same as pipe(). So here we use sys_pipe2() to implement the pipe().

pipe2() is also provided to allow users to use flags argument on demand.

[1]: https://man7.org/linux/man-pages/man2/pipe.2.html
[2]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/pipe.html

---
 tools/include/nolibc/sys.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
tools/include/nolibc/sys.h +0 -0
index 8bfe7db20b80..9fec09c22dbe 100644
@@ -752,6 +752,30 @@ int open(const char *path, int flags, ...)
 }
 
 

tools/include/nolibc/sys.h int open(const char *path, int flags, ...) · line 764

Quoted 10 lines
tools/include/nolibc/sys.h +10 -0
+/*
+ * int pipe2(int pipefd[2], int flags);
+ * int pipe(int pipefd[2]);
+ */
+
+static __attribute__((unused))
+int sys_pipe2(int pipefd[2], int flags)
+{
+	return my_syscall2(__NR_pipe, pipefd, flags);
+}

Should be __NR_pipe2.

Quoted 19 lines
tools/include/nolibc/sys.h +13 -0
+static __attribute__((unused))
+int pipe2(int pipefd[2], int flags)
+{
+	return __sysret(sys_pipe2(pipefd, flags));
+}
+
+static __attribute__((unused))
+int pipe(int pipefd[2])
+{
+	pipe2(pipefd, 0);
+}
+
+
 /*
  * int prctl(int option, unsigned long arg2, unsigned long arg3,
  *                       unsigned long arg4, unsigned long arg5);
Signature · 1 line
2.34.1
#3 lore raw

Re: [PATCH v2 1/2] tools/nolibc: add pipe() and pipe2() support

In reply to Yuan Tan

tools/include/nolibc/sys.h int open(const char *path, int flags, ...) · line 775

Quoted 6 lines · Yuan Tan

[..]

tools/include/nolibc/sys.h +4 -0
+static __attribute__((unused))
+int pipe(int pipefd[2])
+{
+	pipe2(pipefd, 0);

This is missing a "return".

Quoted 9 lines
tools/include/nolibc/sys.h +3 -0
+}
+
+
 /*
  * int prctl(int option, unsigned long arg2, unsigned long arg3,
  *                       unsigned long arg4, unsigned long arg5);
Signature · 1 line
2.34.1
author
#4 lore raw

PATCH v2 2/2 selftests/nolibc: add testcase for pipe

In reply to Yuan Tan

Add a testcase of pipe that child process sends message to parent process.

Here we use memcmp() to avoid the output buffer issue.

---
 tools/testing/selftests/nolibc/nolibc-test.c | 35 ++++++++++++++++++++
 1 file changed, 35 insertions(+)
tools/testing/selftests/nolibc/nolibc-test.c +35 -0
index 03b1d30f5507..2653ab8d5124 100644
@@ -767,6 +767,41 @@ int test_mmap_munmap(void)
 	return ret;
 }
 
+int test_pipe(void)
+{
+	const char *const msg = "hello, nolibc";
+	int pipefd[2];
+	char buf[32];
+	pid_t pid;
+	ssize_t len;
+
+	if (pipe(pipefd) == -1)
+		return 1;
+
+	pid = fork();
+
+	switch (pid) {
+	case -1:
+		return 1;
+
+	case 0:
+		close(pipefd[0]);
+		write(pipefd[1], msg, strlen(msg));
+		close(pipefd[1]);
+		exit(EXIT_SUCCESS);
+
+	default:
+		close(pipefd[1]);
+		len = read(pipefd[0], buf, sizeof(buf));
+		close(pipefd[0]);
+		waitpid(pid, NULL, 0);
+
+		if (len != strlen(msg))
+			return 1;
+		return !!memcmp(buf, msg, len);
+	}
+}
+
 
 /* Run syscall tests between IDs <min> and <max>.
  * Return 0 on success, non-zero on failure.
Signature · 1 line
2.34.1
#5 lore raw

Re: [PATCH v2 2/2] selftests/nolibc: add testcase for pipe

Quoted 2 lines · Yuan Tan

Add a testcase of pipe that child process sends message to parent process.

Thinking about it some more:

What's the advantage of going via a child process? The pipe should work the same within the same process.

Quoted 1 line

Here we use memcmp() to avoid the output buffer issue.

This sentence is meaningless without the background from v1. You can drop it.

Quoted 13 lines
---
 tools/testing/selftests/nolibc/nolibc-test.c | 35 ++++++++++++++++++++
 1 file changed, 35 insertions(+)
tools/testing/selftests/nolibc/nolibc-test.c +0 -0
index 03b1d30f5507..2653ab8d5124 100644

tools/testing/selftests/nolibc/nolibc-test.c int test_mmap_munmap(void) · line 770

Quoted 4 lines
tools/testing/selftests/nolibc/nolibc-test.c +1 -0
@@ -767,6 +767,41 @@ int test_mmap_munmap(void)
 	return ret;
 }
 
+int test_pipe(void)

Should be static and actually get called :-)

Quoted 40 lines
tools/testing/selftests/nolibc/nolibc-test.c +34 -0
+{
+	const char *const msg = "hello, nolibc";
+	int pipefd[2];
+	char buf[32];
+	pid_t pid;
+	ssize_t len;
+
+	if (pipe(pipefd) == -1)
+		return 1;
+
+	pid = fork();
+
+	switch (pid) {
+	case -1:
+		return 1;
+
+	case 0:
+		close(pipefd[0]);
+		write(pipefd[1], msg, strlen(msg));
+		close(pipefd[1]);
+		exit(EXIT_SUCCESS);
+
+	default:
+		close(pipefd[1]);
+		len = read(pipefd[0], buf, sizeof(buf));
+		close(pipefd[0]);
+		waitpid(pid, NULL, 0);
+
+		if (len != strlen(msg))
+			return 1;
+		return !!memcmp(buf, msg, len);
+	}
+}
+
 
 /* Run syscall tests between IDs <min> and <max>.
  * Return 0 on success, non-zero on failure.
Signature · 1 line
2.34.1
author
#6 lore raw

Re: [PATCH v2 2/2] selftests/nolibc: add testcase for pipe

Hi Thomas,

Quoted 9 lines · Thomas Weißschuh
Quoted 2 lines · Yuan Tan

Add a testcase of pipe that child process sends message to parent process.

Thinking about it some more:

What's the advantage of going via a child process? The pipe should work the same within the same process.

The pipe is commonly used for process communication, and I think as a test case it is supposed to cover the most common scenarios.

Quoted 5 lines
Quoted 1 line

Here we use memcmp() to avoid the output buffer issue.

This sentence is meaningless without the background from v1. You can drop it.

Got it.

Quoted 61 lines
Quoted 15 lines

---
 tools/testing/selftests/nolibc/nolibc-test.c | 35 ++++++++++++++++++++

 1 file changed, 35 insertions(+)
tools/testing/selftests/nolibc/nolibc-test.c +0 -0
index 03b1d30f5507..2653ab8d5124 100644
@@ -767,6 +767,41 @@ int test_mmap_munmap(void)
         return ret;
  }
Quoted 2 lines


+int test_pipe(void)

Should be static and actually get called :-)

Quoted 40 lines
tools/testing/selftests/nolibc/nolibc-test.c +34 -0
+{
+       const char *const msg = "hello, nolibc";
+       int pipefd[2];
+       char buf[32];
+       pid_t pid;
+       ssize_t len;
+
+       if (pipe(pipefd) == -1)
+               return 1;
+
+       pid = fork();
+
+       switch (pid) {
+       case -1:
+               return 1;
+
+       case 0:
+               close(pipefd[0]);
+               write(pipefd[1], msg, strlen(msg));
+               close(pipefd[1]);
+               exit(EXIT_SUCCESS);
+
+       default:
+               close(pipefd[1]);
+               len = read(pipefd[0], buf, sizeof(buf));
+               close(pipefd[0]);
+               waitpid(pid, NULL, 0);
+
+               if (len != strlen(msg))
+                       return 1;
+               return !!memcmp(buf, msg, len);
+       }
+}
+


 /* Run syscall tests between IDs <min> and <max>.
  * Return 0 on success, non-zero on failure.

Signature · 1 line
2.34.1
#7 lore raw

Re: [PATCH v2 2/2] selftests/nolibc: add testcase for pipe

Quoted 5 lines · Yuan Tan
Quoted 4 lines · Thomas Weißschuh
Quoted 2 lines · Yuan Tan

Add a testcase of pipe that child process sends message to parent process.

Quoted 8 lines
Quoted 5 lines

Thinking about it some more:

What's the advantage of going via a child process? The pipe should work the same within the same process.

The pipe is commonly used for process communication, and I think as a test case it is supposed to cover the most common scenarios.

The testcase is supposed to cover the code of nolibc.
It should be the *minimal* amount of code to be reasonable sure that the code in nolibc does the correct thing.
If pipe() returns a value that behaves like a pipe I see no reason to doubt it will also survive fork().

Validating that would mean testing the kernel and not nolibc. For the kernel there are different testsuites.

Less code means less work for everyone involved, now and in the future.

author
#8 lore raw

Re: [PATCH v2 2/2] selftests/nolibc: add testcase for pipe

Hi Thomas,

Quoted 24 lines · Thomas Weißschuh
Quoted 8 lines · Yuan Tan
Quoted 7 lines · Thomas Weißschuh
Quoted 3 lines · Yuan Tan

Add a testcase of pipe that child process sends message to parent
process.

Thinking about it some more:

Quoted 7 lines
Quoted 3 lines

What's the advantage of going via a child process? The pipe should work the same within the same process.

The pipe is commonly used for process communication, and I think as a
test case it is supposed to cover the most common scenarios.

The testcase is supposed to cover the code of nolibc.
It should be the *minimal* amount of code to be reasonable sure that the
code in nolibc does the correct thing.
If pipe() returns a value that behaves like a pipe I see no reason to doubt it will also survive fork().

Quoted 6 lines

Validating that would mean testing the kernel and not nolibc. For the kernel there are different testsuites.

Less code means less work for everyone involved, now and in the future.

It's a good point and I never thought about this aspect.

I wonder whether the code below is enough?

static int test_pipe(void)

{
	int pipefd[2];

	if (pipe(pipefd) == -1)
		return 1;

	close(pipefd[0]);
	close(pipefd[1]);

	return 0;
}

And I forgot to add this line:

	CASE_TEST(pipe); EXPECT_SYSZR(1, test_pipe()); break;

I will add it in next patch.

#9 lore raw

Re: [PATCH v2 2/2] selftests/nolibc: add testcase for pipe

Quoted 38 lines · Yuan Tan

Hi Thomas,

Quoted 24 lines · Thomas Weißschuh
Quoted 8 lines · Yuan Tan
Quoted 7 lines · Thomas Weißschuh
Quoted 3 lines · Yuan Tan

Add a testcase of pipe that child process sends message to parent
process.

Thinking about it some more:

Quoted 7 lines
Quoted 3 lines

What's the advantage of going via a child process? The pipe should work the same within the same process.

The pipe is commonly used for process communication, and I think as a
test case it is supposed to cover the most common scenarios.

The testcase is supposed to cover the code of nolibc.
It should be the *minimal* amount of code to be reasonable sure that the
code in nolibc does the correct thing.
If pipe() returns a value that behaves like a pipe I see no reason to doubt it will also survive fork().

Quoted 6 lines

Validating that would mean testing the kernel and not nolibc. For the kernel there are different testsuites.

Less code means less work for everyone involved, now and in the future.

It's a good point and I never thought about this aspect.

I wonder whether the code below is enough?

static int test_pipe(void)

Quoted 11 lines
{
	int pipefd[2];

	if (pipe(pipefd) == -1)
		return 1;

	close(pipefd[0]);
	close(pipefd[1]);

	return 0;
}

That is very barebones.

If accidentally a wrong syscall number was used and the used syscall would not take any arguments this test would still succeed.

Keeping the write-read-cycle from the previous revision would test that nicely. Essentially the same code as before but without the fork().

Quoted 7 lines

And I forgot to add this line:

	CASE_TEST(pipe); EXPECT_SYSZR(1, test_pipe()); break;

I will add it in next patch.

author
#10 lore raw

Re: [PATCH v2 2/2] selftests/nolibc: add testcase for pipe

Hi Thomas,

Quoted 54 lines · Thomas Weißschuh
Quoted 44 lines · Yuan Tan

Hi Thomas,

Quoted 27 lines · Thomas Weißschuh
Quoted 8 lines · Yuan Tan
Quoted 7 lines · Thomas Weißschuh
Quoted 3 lines · Yuan Tan

Add a testcase of pipe that child process sends message to parent
process.

Thinking about it some more:

Quoted 8 lines
Quoted 3 lines

What's the advantage of going via a child process? The pipe should work the same within the same process.

The pipe is commonly used for process communication, and I think as
a
test case it is supposed to cover the most common scenarios.

The testcase is supposed to cover the code of nolibc. It should be the *minimal* amount of code to be reasonable sure that
the
code in nolibc does the correct thing.
If pipe() returns a value that behaves like a pipe I see no reason to
doubt it will also survive fork().

Quoted 6 lines

Validating that would mean testing the kernel and not nolibc. For the kernel there are different testsuites.

Less code means less work for everyone involved, now and in the future.

It's a good point and I never thought about this aspect.

I wonder whether the code below is enough?

static int test_pipe(void)
{
        int pipefd[2];

Quoted 8 lines

        if (pipe(pipefd) == -1)
                return 1;

        close(pipefd[0]);
        close(pipefd[1]);

        return 0;
}

Quoted 17 lines

That is very barebones.

If accidentally a wrong syscall number was used and the used syscall would not take any arguments this test would still succeed.

Keeping the write-read-cycle from the previous revision would test that
nicely. Essentially the same code as before but without the fork().

Quoted 7 lines

And I forgot to add this line:

        CASE_TEST(pipe); EXPECT_SYSZR(1, test_pipe()); break;

I will add it in next patch.

In the situation you described, that is indeed the case.

Would this be fine?

static int test_pipe(void)

{
	const char *const msg = "hello, nolibc";
	int pipefd[2];
	char buf[32];
	ssize_t len;

	if (pipe(pipefd) == -1)
		return 1;

	write(pipefd[1], msg, strlen(msg));
	close(pipefd[1]);
	len = read(pipefd[0], buf, sizeof(buf));
	close(pipefd[0]);

	if (len != strlen(msg))
		return 1;

	return !!memcmp(buf, msg, len);
}
#11 lore raw

Re: [PATCH v2 2/2] selftests/nolibc: add testcase for pipe

Quoted 91 lines · Yuan Tan

Hi Thomas,

Quoted 54 lines · Thomas Weißschuh
Quoted 44 lines · Yuan Tan

Hi Thomas,

Quoted 27 lines · Thomas Weißschuh
Quoted 8 lines · Yuan Tan
Quoted 7 lines · Thomas Weißschuh
Quoted 3 lines · Yuan Tan

Add a testcase of pipe that child process sends message to parent
process.

Thinking about it some more:

Quoted 8 lines
Quoted 3 lines

What's the advantage of going via a child process? The pipe should work the same within the same process.

The pipe is commonly used for process communication, and I think as
a
test case it is supposed to cover the most common scenarios.

The testcase is supposed to cover the code of nolibc. It should be the *minimal* amount of code to be reasonable sure that
the
code in nolibc does the correct thing.
If pipe() returns a value that behaves like a pipe I see no reason to
doubt it will also survive fork().

Quoted 6 lines

Validating that would mean testing the kernel and not nolibc. For the kernel there are different testsuites.

Less code means less work for everyone involved, now and in the future.

It's a good point and I never thought about this aspect.

I wonder whether the code below is enough?

static int test_pipe(void)
{
        int pipefd[2];

Quoted 8 lines

        if (pipe(pipefd) == -1)
                return 1;

        close(pipefd[0]);
        close(pipefd[1]);

        return 0;
}

Quoted 17 lines

That is very barebones.

If accidentally a wrong syscall number was used and the used syscall would not take any arguments this test would still succeed.

Keeping the write-read-cycle from the previous revision would test that
nicely. Essentially the same code as before but without the fork().

Quoted 7 lines

And I forgot to add this line:

        CASE_TEST(pipe); EXPECT_SYSZR(1, test_pipe()); break;

I will add it in next patch.

In the situation you described, that is indeed the case.

Would this be fine?

static int test_pipe(void)

{
	const char *const msg = "hello, nolibc";
	int pipefd[2];
	char buf[32];
	ssize_t len;

	if (pipe(pipefd) == -1)
		return 1;

	write(pipefd[1], msg, strlen(msg));
	close(pipefd[1]);
Quoted 8 lines
	len = read(pipefd[0], buf, sizeof(buf));
	close(pipefd[0]);

	if (len != strlen(msg))
		return 1;

	return !!memcmp(buf, msg, len);
}

Looks good!

The return value of write() could also be validated but given we validate the return value from read() it shouldn't make a difference.

(Also the manual manipulation of "buf" is gone that necessitated the check in v1 of the series)

author
#12 lore raw

Re: [PATCH v2 2/2] selftests/nolibc: add testcase for pipe

Hi Thomas,

Quoted 108 lines · Thomas Weißschuh
Quoted 101 lines · Yuan Tan

Hi Thomas,

Quoted 64 lines · Thomas Weißschuh
Quoted 48 lines · Yuan Tan

Hi Thomas,

Quoted 30 lines · Thomas Weißschuh
Quoted 13 lines · Yuan Tan
Quoted 11 lines · Thomas Weißschuh
Quoted 4 lines · Yuan Tan

Add a testcase of pipe that child process sends message to
parent
process.

Thinking about it some more:

What's the advantage of going via a child process? The pipe should work the same within the same process.

Quoted 5 lines

The pipe is commonly used for process communication, and I think as
a
test case it is supposed to cover the most common scenarios.

The testcase is supposed to cover the code of nolibc. It should be the *minimal* amount of code to be reasonable sure
that
the
code in nolibc does the correct thing.
If pipe() returns a value that behaves like a pipe I see no reason to
doubt it will also survive fork().

Quoted 7 lines

Validating that would mean testing the kernel and not nolibc. For the kernel there are different testsuites.

Less code means less work for everyone involved, now and in the
future.

It's a good point and I never thought about this aspect.

I wonder whether the code below is enough?

static int test_pipe(void)
{
        int pipefd[2];

Quoted 8 lines

        if (pipe(pipefd) == -1)
                return 1;

        close(pipefd[0]);
        close(pipefd[1]);

        return 0;
}

That is very barebones.

If accidentally a wrong syscall number was used and the used syscall
would not take any arguments this test would still succeed.

Quoted 14 lines

Keeping the write-read-cycle from the previous revision would test
that
nicely. Essentially the same code as before but without the fork().

Quoted 7 lines

And I forgot to add this line:

        CASE_TEST(pipe); EXPECT_SYSZR(1, test_pipe()); break;

I will add it in next patch.

In the situation you described, that is indeed the case.

Would this be fine?

static int test_pipe(void)
{
        const char *const msg = "hello, nolibc";
        int pipefd[2];
        char buf[32];
        ssize_t len;

        if (pipe(pipefd) == -1)
                return 1;

        write(pipefd[1], msg, strlen(msg));
        close(pipefd[1]);
        len = read(pipefd[0], buf, sizeof(buf));
        close(pipefd[0]);

Quoted 5 lines

        if (len != strlen(msg))
                return 1;

        return !!memcmp(buf, msg, len);
}

Quoted 8 lines

Looks good!

The return value of write() could also be validated but given we validate the return value from read() it shouldn't make a difference.

(Also the manual manipulation of "buf" is gone that necessitated the check in v1 of the series)

I am sorry that I didn't catch your last sentence.

Did you mean this piece of code does not need any further modifications right?

#13 lore raw

Re: [PATCH v2 2/2] selftests/nolibc: add testcase for pipe

Aug 1, 2023 14:23:22 Yuan Tan <[email protected]>:

Quoted 28 lines
Quoted 28 lines
Quoted 17 lines

Would this be fine?

static int test_pipe(void)
{
        const char *const msg = "hello, nolibc";
        int pipefd[2];
        char buf[32];
        ssize_t len;

        if (pipe(pipefd) == -1)
                return 1;

        write(pipefd[1], msg, strlen(msg));
        close(pipefd[1]);
        len = read(pipefd[0], buf, sizeof(buf));
        close(pipefd[0]);

Quoted 5 lines

        if (len != strlen(msg))
                return 1;

        return !!memcmp(buf, msg, len);
}

Looks good!

The return value of write() could also be validated but given we validate the return value from read() it shouldn't make a difference.

Quoted 8 lines
Quoted 3 lines

(Also the manual manipulation of "buf" is gone that necessitated the check in v1 of the series)

I am sorry that I didn't catch your last sentence.

Did you mean this piece of code does not need any further modifications right?

Yes, for me this is great!
Sorry for being unclear.

#14 lore raw
In reply to Yuan Tan

Hi Yuan!

Quoted 4 lines · Yuan Tan

Thanks to your advice and I really learned a lot from it.

V2 now uses pipe2() to wrap pipe(), and fixes the strcmp issue in test case.

Thanks!

I have some more comments for the patches.

For new revisions you should also link to the old revision.

Quoted 14 lines

Best regards,
Yuan Tan

Yuan Tan (2):
tools/nolibc: add pipe() and pipe2() support
selftests/nolibc: add testcase for pipe

 tools/include/nolibc/sys.h                   | 24 ++++++++++++++
 tools/testing/selftests/nolibc/nolibc-test.c | 35 ++++++++++++++++++++
 2 files changed, 59 insertions(+)
Signature · 1 line
2.34.1
author
#15 lore raw

Hi Thomas,

Quoted 9 lines · Thomas Weißschuh

Hi Yuan!

Quoted 5 lines · Yuan Tan

Thanks to your advice and I really learned a lot from it.

V2 now uses pipe2() to wrap pipe(), and fixes the strcmp issue in test
case.

Quoted 6 lines

Thanks!

I have some more comments for the patches.

For new revisions you should also link to the old revision.

I sincerely appreciate your valuable advice. As a newcomer, I will certainly take note of it next time. :)

Quoted 16 lines
Quoted 15 lines

Best regards,
Yuan Tan

Yuan Tan (2):
  tools/nolibc: add pipe() and pipe2() support
  selftests/nolibc: add testcase for pipe

 tools/include/nolibc/sys.h                   | 24 ++++++++++++++ tools/testing/selftests/nolibc/nolibc-test.c | 35
++++++++++++++++++++

 2 files changed, 59 insertions(+)
Signature · 1 line
2.34.1