Support O_CREATE with SYS_openat
authorBarret Rhoden <brho@cs.berkeley.edu>
Wed, 12 Jun 2019 16:27:56 +0000 (12:27 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Wed, 12 Jun 2019 16:27:56 +0000 (12:27 -0400)
commitf0ccbba37397d2bd465be42207289c7e5c9b5ada
tree5b9c45cc54b544dc7dfc9dae6e48262234f801ee
parent6627be2d494a454696960a32885e102efe084aa8
Support O_CREATE with SYS_openat

Previously, we would attempt a sysopenat(), then when it failed, do
syscreate().  However, the syscreate() can't handle an 'at' FD.  The
file would be created in the current directory, as if it was a normal
open.

The simplest thing was to push the O_CREATE fallback business into
openat itself.  That cleaned up the syscall.c code, and eventually will
lead to the removal of syscreate().  Currently, it is still used by
mkdir, which also cannot handle 'at' FDs.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/include/ns.h
kern/src/ns/sysfile.c
kern/src/process.c
kern/src/syscall.c