Set errno when only errstr was called
authorBarret Rhoden <brho@cs.berkeley.edu>
Fri, 13 Sep 2013 01:51:18 +0000 (18:51 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 16 Jan 2014 01:55:42 +0000 (17:55 -0800)
commit16ebadd0c8b7b15c7b189d3e7f4437cd3d867728
tree7e34a1a4ab098ef6505314b0f9d05368e5b732d8
parentd935a16fed69bb09e4f11ad083d99c9a8faca1ae
Set errno when only errstr was called

Some error paths set errstr, but not errno.  Glibc will ignore errstr if there
isn't an errno too, so we need something.

Ultimately, we should be setting both errno and errstr (given a glibc-world
with errno).  Til then, we'll set a generic errno.

This won't harm the current glibc, which 0's sysc.errstr before calling, but
that isn't actually part of the ABI.  So with this hack, it is possible to set
errno when there wasn't actually an error.  Luckily, userspace shouldn't look
at errno unless it was told too (via a bad retval), in which case, we probably
wanted errno set anyway.  Still, be careful.
kern/src/syscall.c