[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT/NEWLIB PATCH 2/3] patch: set default _READ_WRITE_RETURN_TYPE to _ssize_t



Reviewed-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>

On 15.06.2018 13:51, Yuri Volchkov wrote:
The vfscore provides the same definitions of functions read/write as
in 'man 2 write'. Newlib used int as a return type of these functions,
which is wrong.

Signed-off-by: Yuri Volchkov <yuri.volchkov@xxxxxxxxx>
---
  ...-_READ_WRITE_RETURN_TYPE-to-_ssize_t.patch | 29 +++++++++++++++++++
  1 file changed, 29 insertions(+)
  create mode 100644 
patches/0001-set-default-_READ_WRITE_RETURN_TYPE-to-_ssize_t.patch

diff --git a/patches/0001-set-default-_READ_WRITE_RETURN_TYPE-to-_ssize_t.patch 
b/patches/0001-set-default-_READ_WRITE_RETURN_TYPE-to-_ssize_t.patch
new file mode 100644
index 0000000..bc50501
--- /dev/null
+++ b/patches/0001-set-default-_READ_WRITE_RETURN_TYPE-to-_ssize_t.patch
@@ -0,0 +1,29 @@
+From 1397a510f17b71e0184ce7fad64c937684baa872 Mon Sep 17 00:00:00 2001
+From: Yuri Volchkov <yuri.volchkov@xxxxxxxxx>
+Date: Sun, 10 Jun 2018 20:21:52 +0200
+Subject: [PATCH] set default _READ_WRITE_RETURN_TYPE to _ssize_t
+
+Why it was ever int, on the first place? This modification fixes
+conflict with correct definitions of write() and read()
+
+Signed-off-by: Yuri Volchkov <yuri.volchkov@xxxxxxxxx>
+---
+ newlib/libc/include/sys/config.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/newlib/libc/include/sys/config.h 
b/newlib/libc/include/sys/config.h
+index 2082dfd..89326b9 100644
+--- a/newlib/libc/include/sys/config.h
++++ b/newlib/libc/include/sys/config.h
+@@ -254,7 +254,7 @@
+    for read()/write() is "ssize_t" but legacy newlib code has been using
+    "int" for some time.  If not specified, "int" is defaulted.  */
+ #ifndef _READ_WRITE_RETURN_TYPE
+-#define _READ_WRITE_RETURN_TYPE int
++#define _READ_WRITE_RETURN_TYPE _ssize_t
+ #endif
+ /* Define `count' parameter of read/write routines.  In POSIX, the `count'
+    parameter is "size_t" but legacy newlib code has been using "int" for some
+--
+2.17.0
+


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.