Skip to content

Commit

Permalink
Add patches that fixes stdout
Browse files Browse the repository at this point in the history
Signed-off-by: gaulthier gain <[email protected]>
Tested-by: Unikraft CI <[email protected]>
GitHub-Pull-Request: unikraft#3
  • Loading branch information
gaulthiergain authored and unikraft-bot committed Oct 13, 2021
1 parent eeb1c41 commit 6d51404
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 26 deletions.
24 changes: 24 additions & 0 deletions patches/0009-Stub-istty-by-ignoring-ioctl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From ab6c1cf39135f9b11524267a0d3b517b88f4ff27 Mon Sep 17 00:00:00 2001
From: gaulthier gain <[email protected]>
Date: Fri, 9 Oct 2020 15:18:24 +0000
Subject: [PATCH] Stub istty by ignoring ioctl

Signed-off-by: gaulthier gain <[email protected]>
---
src/unistd/isatty.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/unistd/isatty.c b/src/unistd/isatty.c
index c8badaf..a0f34d5 100644
--- a/src/unistd/isatty.c
+++ b/src/unistd/isatty.c
@@ -5,5 +5,5 @@
int isatty(int fd)
{
struct winsize wsz;
- return !__syscall(SYS_ioctl, fd, TIOCGWINSZ, &wsz);
+ return 1; //!__syscall(SYS_ioctl, fd, TIOCGWINSZ, &wsz);
}
--
2.17.1

25 changes: 0 additions & 25 deletions patches/0009-update__stdout_write_for_flushing.patch

This file was deleted.

26 changes: 26 additions & 0 deletions patches/0010-Fix-stdio_write-output.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From 120d042546de02e005e668306ff4022bdaf784b4 Mon Sep 17 00:00:00 2001
From: gaulthier gain <[email protected]>
Date: Fri, 9 Oct 2020 15:32:04 +0000
Subject: [PATCH] Fix stdio_write output

Signed-off-by: gaulthier gain <[email protected]>
---
src/stdio/__stdio_write.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/stdio/__stdio_write.c b/src/stdio/__stdio_write.c
index d2d8947..cae0ea9 100644
--- a/src/stdio/__stdio_write.c
+++ b/src/stdio/__stdio_write.c
@@ -24,7 +24,7 @@ size_t __stdio_write(FILE *f, const unsigned char *buf, size_t len)
return iovcnt == 2 ? 0 : len-iov[0].iov_len;
}
rem -= cnt;
- if (cnt > iov[0].iov_len) {
+ if (cnt >= iov[0].iov_len) {
cnt -= iov[0].iov_len;
iov++; iovcnt--;
}
--
2.17.1

26 changes: 26 additions & 0 deletions patches/0011-Update-stdoutwrite-by-removing-ioctl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From 8ecbb57a730c20505e6117e8c5f012ed3348e1ec Mon Sep 17 00:00:00 2001
From: gaulthier gain <[email protected]>
Date: Fri, 9 Oct 2020 15:57:11 +0000
Subject: [PATCH] Update stdoutwrite by removing ioctl

Signed-off-by: gaulthier gain <[email protected]>
---
src/stdio/__stdout_write.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/stdio/__stdout_write.c b/src/stdio/__stdout_write.c
index dd1ec60..70dc450 100644
--- a/src/stdio/__stdout_write.c
+++ b/src/stdio/__stdout_write.c
@@ -5,7 +5,7 @@ size_t __stdout_write(FILE *f, const unsigned char *buf, size_t len)
{
struct winsize wsz;
f->write = __stdio_write;
- if (!(f->flags & F_SVB) && __syscall(SYS_ioctl, f->fd, TIOCGWINSZ, &wsz))
+ if (!(f->flags & F_SVB))
f->lbf = -1;
return __stdio_write(f, buf, len);
}
--
2.17.1

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 1ea6a69be49facc99b969831a4e27e954ae05da5 Mon Sep 17 00:00:00 2001
From: gaulthier gain <[email protected]>
Date: Tue, 6 Oct 2020 07:55:19 +0000
Subject: [UNIKRAFT/MUSL] Add _SC_LEVEL1_DCACHE_LINESIZE to unistd
Subject: [PATCH] Add _SC_LEVEL1_DCACHE_LINESIZE to unistd

Signed-off-by: gaulthier gain <[email protected]>
---
Expand Down

0 comments on commit 6d51404

Please sign in to comment.