Handling EOF on stdin

Sid Hussmann sid.hussmann at gapfruit.com
Wed Dec 11 00:14:41 CET 2019


Hi Norman,

> there are two questions. First, how to communicate the EOF condition
> from the terminal server to the terminal client? Second, how to handle
> the EOF at the terminal client side (respectively the libc)?
> 
> My suggestion referred only to the first one (because your original
> question was about how to transport the EOF). You are right that the
> second part is still open. In contrast to Noux, the
> Vfs::Terminal_file_system [1] does not yet handle EOF.

You are right. These are two questions. I expected the client part to be 
more challenging... 

> 
> Don't be afraid. It's not that bad. ;-) All that is missing is the
> handling of the special case of mode (0,0) in the VFS terminal fs linked
> above. At the VFS an EOF is signaled to the VFS client (e.g., the libc)
> by a successful return of read with 0 characters. I recently implemented
> the EOF handling for the VFS pipe plugin and think that the VFS terminal
> fs can follow the same pattern.
> 
> [2]
> https://github.com/genodelabs/genode/blob/master/repos/gems/src/lib/vfs/pipe/plugin.cc
> 
> EOF is not a signal at the libc level. It is just a successful read of 0
> characters.

I assumed there had to be a handling of EOF implemented in the new pipe feature. 
Thanks for pointing me to it!
This looks like a sound solution to my problem.
You can expect my patch by the end of the week :)

Cheers
Sid


-- 
Sid Hussmann
CTO & Founder
gapfruit AG
Baarerstrasse 135
6300 Zug - Switzerland
sid.hussmann at gapfruit.com





More information about the users mailing list