From: gaulthier gain Date: Fri, 9 Oct 2020 16:00:23 +0000 (+0000) Subject: Add patches that fixes stdout X-Git-Tag: RELEASE-0.6~3 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=6d5140460cb932a0bbf7901bc7dec8532d363bd0;p=unikraft%2Flibs%2Fmusl.git Add patches that fixes stdout Signed-off-by: gaulthier gain Tested-by: Unikraft CI GitHub-Pull-Request: #3 --- diff --git a/patches/0009-Stub-istty-by-ignoring-ioctl.patch b/patches/0009-Stub-istty-by-ignoring-ioctl.patch new file mode 100644 index 0000000..978ad21 --- /dev/null +++ b/patches/0009-Stub-istty-by-ignoring-ioctl.patch @@ -0,0 +1,24 @@ +From ab6c1cf39135f9b11524267a0d3b517b88f4ff27 Mon Sep 17 00:00:00 2001 +From: gaulthier gain +Date: Fri, 9 Oct 2020 15:18:24 +0000 +Subject: [PATCH] Stub istty by ignoring ioctl + +Signed-off-by: gaulthier gain +--- + 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 index bda423f..0000000 --- a/patches/0009-update__stdout_write_for_flushing.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 235b3d8240fbc99782f2fb8449786f519fcb3bde Mon Sep 17 00:00:00 2001 -From: gaulthier gain -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 ---- - 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 index 0000000..7e428d9 --- /dev/null +++ b/patches/0010-Fix-stdio_write-output.patch @@ -0,0 +1,26 @@ +From 120d042546de02e005e668306ff4022bdaf784b4 Mon Sep 17 00:00:00 2001 +From: gaulthier gain +Date: Fri, 9 Oct 2020 15:32:04 +0000 +Subject: [PATCH] Fix stdio_write output + +Signed-off-by: gaulthier gain +--- + 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 index 6da0679..0000000 --- a/patches/0010-add-SC_LEVEL1_DCACHE_LINESIZE-unistd_h.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 1ea6a69be49facc99b969831a4e27e954ae05da5 Mon Sep 17 00:00:00 2001 -From: gaulthier gain -Date: Tue, 6 Oct 2020 07:55:19 +0000 -Subject: [UNIKRAFT/MUSL] Add _SC_LEVEL1_DCACHE_LINESIZE to unistd - -Signed-off-by: gaulthier gain ---- - 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 - -- -+#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 index 0000000..2455814 --- /dev/null +++ b/patches/0011-Update-stdoutwrite-by-removing-ioctl.patch @@ -0,0 +1,26 @@ +From 8ecbb57a730c20505e6117e8c5f012ed3348e1ec Mon Sep 17 00:00:00 2001 +From: gaulthier gain +Date: Fri, 9 Oct 2020 15:57:11 +0000 +Subject: [PATCH] Update stdoutwrite by removing ioctl + +Signed-off-by: gaulthier gain +--- + 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 index 0000000..906ac91 --- /dev/null +++ b/patches/0012-add-SC_LEVEL1_DCACHE_LINESIZE-unistd_h.patch @@ -0,0 +1,26 @@ +From 1ea6a69be49facc99b969831a4e27e954ae05da5 Mon Sep 17 00:00:00 2001 +From: gaulthier gain +Date: Tue, 6 Oct 2020 07:55:19 +0000 +Subject: [PATCH] Add _SC_LEVEL1_DCACHE_LINESIZE to unistd + +Signed-off-by: gaulthier gain +--- + 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 + +- ++#define _SC_LEVEL1_DCACHE_LINESIZE 130 + + #define _PC_LINK_MAX 0 + #define _PC_MAX_CANON 1 +-- +2.17.1 +