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

Re: [Minios-devel] [UNIKRAFT PATCH 4/5] lib/vfscore: mark stdio as a character device



This looks also fine.

Reviewed-by: Florian Schmidt <florian.schmidt@xxxxxxxxx>

On 3/4/19 6:46 PM, Yuri Volchkov wrote:
Newlib implements printf via writing to stdout. I does a couple of
checks before writing into the file. Make sure these checks are
passed.

Signed-off-by: Yuri Volchkov <yuri.volchkov@xxxxxxxxx>
---
  lib/vfscore/stdio.c | 7 +++++++
  1 file changed, 7 insertions(+)

diff --git a/lib/vfscore/stdio.c b/lib/vfscore/stdio.c
index ee8a5b1d..b73b132c 100644
--- a/lib/vfscore/stdio.c
+++ b/lib/vfscore/stdio.c
@@ -85,10 +85,16 @@ static ssize_t stdio_read(struct vnode *vp __unused,
        return bytes_total;
  }
+static int
+stdio_getattr(struct vnode *vnode __unused, struct vattr *attr __unused)
+{
+       return 0;
+}
static struct vnops stdio_vnops = {
        .vop_write = stdio_write,
        .vop_read = stdio_read,
+       .vop_getattr = stdio_getattr,
  };
static struct vnode stdio_vnode = {
@@ -96,6 +102,7 @@ static struct vnode stdio_vnode = {
        .v_op = &stdio_vnops,
        .v_lock = UK_MUTEX_INITIALIZER(stdio_vnode.v_lock),
        .v_refcnt = 1,
+       .v_type = VCHR,
  };
static struct dentry stdio_dentry = {


--
Dr. Florian Schmidt
フローリアン・シュミット
Research Scientist,
Systems and Machine Learning Group
NEC Laboratories Europe
Kurfürsten-Anlage 36, D-69115 Heidelberg
Tel.     +49 (0)6221 4342-265
Fax:     +49 (0)6221 4342-155
e-mail:  florian.schmidt@xxxxxxxxx
============================================================
Registered at Amtsgericht Mannheim, Germany, HRB728558

_______________________________________________
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®.