On 12/08/15 20:03, Robert Millan wrote:
Thanks for the detailed explanation. My goal is to return correct errnos
for a limited set of
syscalls with very standard semantics (open, read, write...).
So in this case errno translation is the only missing bit. Fortunately
this can be implemented
in a very generic/portable way (i.e. current errtrans facility). I
looked at the interface you
described, and it seems like using it would sacrifice portability as it
intends to be more
complete and hence inherently less portable (seems to me like you can't
have both!).
In summary, how would I go about writing portable host code which uses
rump_sys_open() and
its friends, while fixing the returned errno?
Without syscall emulation active, rump_sys_* return RUMP_E* errnos. The
fact that they match on NetBSD is a "coincidence". So, check against
those. If you want to pass the errno around to some code which does not
understand rump kernels, it's up to your application to translate the
values before passing them on.