]> xenbits.xensource.com Git - unikraft/libs/musl.git/commitdiff
Add patches that fixes stdout
authorgaulthier gain <gaulthier.gain@uliege.be>
Fri, 9 Oct 2020 16:00:23 +0000 (16:00 +0000)
committerUnikraft <monkey@unikraft.io>
Wed, 13 Oct 2021 11:31:40 +0000 (11:31 +0000)
Signed-off-by: gaulthier gain <gaulthier.gain@uliege.be>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #3

patches/0009-Stub-istty-by-ignoring-ioctl.patch [new file with mode: 0644]
patches/0009-update__stdout_write_for_flushing.patch [deleted file]
patches/0010-Fix-stdio_write-output.patch [new file with mode: 0644]
patches/0010-add-SC_LEVEL1_DCACHE_LINESIZE-unistd_h.patch [deleted file]
patches/0011-Update-stdoutwrite-by-removing-ioctl.patch [new file with mode: 0644]
patches/0012-add-SC_LEVEL1_DCACHE_LINESIZE-unistd_h.patch [new file with mode: 0644]

diff --git a/patches/0009-Stub-istty-by-ignoring-ioctl.patch b/patches/0009-Stub-istty-by-ignoring-ioctl.patch
new file mode 100644 (file)
index 0000000..978ad21
--- /dev/null
@@ -0,0 +1,24 @@
+From ab6c1cf39135f9b11524267a0d3b517b88f4ff27 Mon Sep 17 00:00:00 2001
+From: gaulthier gain <gaulthier.gain@uliege.be>
+Date: Fri, 9 Oct 2020 15:18:24 +0000
+Subject: [PATCH] Stub istty by ignoring ioctl
+
+Signed-off-by: gaulthier gain <gaulthier.gain@uliege.be>
+---
+ 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
+
diff --git a/patches/0009-update__stdout_write_for_flushing.patch b/patches/0009-update__stdout_write_for_flushing.patch
deleted file mode 100644 (file)
index bda423f..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-From 235b3d8240fbc99782f2fb8449786f519fcb3bde Mon Sep 17 00:00:00 2001
-From: gaulthier gain <gaulthier.gain@uliege.be>
-Date: Fri, 28 Feb 2020 17:05:28 +0000
-Subject: [UNIKRAFT/MUSL] Update __stdout_write to allow flushing on stdout
-
-Signed-off-by: gaulthier gain <gaulthier.gain@uliege.be>
----
- 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..f9c9489 100644
---- a/src/stdio/__stdout_write.c
-+++ b/src/stdio/__stdout_write.c
-@@ -6,6 +6,6 @@ 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))
--              f->lbf = -1;
-+              f->lbf = '\n';
-       return __stdio_write(f, buf, len);
- }
---
-2.17.1
-
diff --git a/patches/0010-Fix-stdio_write-output.patch b/patches/0010-Fix-stdio_write-output.patch
new file mode 100644 (file)
index 0000000..7e428d9
--- /dev/null
@@ -0,0 +1,26 @@
+From 120d042546de02e005e668306ff4022bdaf784b4 Mon Sep 17 00:00:00 2001
+From: gaulthier gain <gaulthier.gain@uliege.be>
+Date: Fri, 9 Oct 2020 15:32:04 +0000
+Subject: [PATCH] Fix stdio_write output
+
+Signed-off-by: gaulthier gain <gaulthier.gain@uliege.be>
+---
+ 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
+
diff --git a/patches/0010-add-SC_LEVEL1_DCACHE_LINESIZE-unistd_h.patch b/patches/0010-add-SC_LEVEL1_DCACHE_LINESIZE-unistd_h.patch
deleted file mode 100644 (file)
index 6da0679..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-From 1ea6a69be49facc99b969831a4e27e954ae05da5 Mon Sep 17 00:00:00 2001
-From: gaulthier gain <gaulthier.gain@uliege.be>
-Date: Tue, 6 Oct 2020 07:55:19 +0000
-Subject: [UNIKRAFT/MUSL] Add _SC_LEVEL1_DCACHE_LINESIZE to unistd
-
-Signed-off-by: gaulthier gain <gaulthier.gain@uliege.be>
----
- include/unistd.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/include/unistd.h b/include/unistd.h
-index 6ee0f1f..452f004 100644
---- a/include/unistd.h
-+++ b/include/unistd.h
-@@ -250,7 +250,7 @@ int eaccess(const char *, int);
- #include <bits/posix.h>
--
-+#define _SC_LEVEL1_DCACHE_LINESIZE 130
- #define _PC_LINK_MAX  0
- #define _PC_MAX_CANON 1
--- 
-2.17.1
-
diff --git a/patches/0011-Update-stdoutwrite-by-removing-ioctl.patch b/patches/0011-Update-stdoutwrite-by-removing-ioctl.patch
new file mode 100644 (file)
index 0000000..2455814
--- /dev/null
@@ -0,0 +1,26 @@
+From 8ecbb57a730c20505e6117e8c5f012ed3348e1ec Mon Sep 17 00:00:00 2001
+From: gaulthier gain <gaulthier.gain@uliege.be>
+Date: Fri, 9 Oct 2020 15:57:11 +0000
+Subject: [PATCH] Update stdoutwrite by removing ioctl
+
+Signed-off-by: gaulthier gain <gaulthier.gain@uliege.be>
+---
+ 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
+
diff --git a/patches/0012-add-SC_LEVEL1_DCACHE_LINESIZE-unistd_h.patch b/patches/0012-add-SC_LEVEL1_DCACHE_LINESIZE-unistd_h.patch
new file mode 100644 (file)
index 0000000..906ac91
--- /dev/null
@@ -0,0 +1,26 @@
+From 1ea6a69be49facc99b969831a4e27e954ae05da5 Mon Sep 17 00:00:00 2001
+From: gaulthier gain <gaulthier.gain@uliege.be>
+Date: Tue, 6 Oct 2020 07:55:19 +0000
+Subject: [PATCH] Add _SC_LEVEL1_DCACHE_LINESIZE to unistd
+
+Signed-off-by: gaulthier gain <gaulthier.gain@uliege.be>
+---
+ include/unistd.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/unistd.h b/include/unistd.h
+index 6ee0f1f..452f004 100644
+--- a/include/unistd.h
++++ b/include/unistd.h
+@@ -250,7 +250,7 @@ int eaccess(const char *, int);
+ #include <bits/posix.h>
+-
++#define _SC_LEVEL1_DCACHE_LINESIZE 130
+ #define _PC_LINK_MAX  0
+ #define _PC_MAX_CANON 1
+-- 
+2.17.1
+