freebsd-nq/sys/compat/cloudabi
Ed Schouten 0f85ff377b Add file_open(): the underlying system call of openat().
CloudABI purely operates on file descriptor rights (CAP_*). File
descriptor access modes (O_ACCMODE) are emulated on top of rights.

Instead of accepting the traditional flags argument, file_open() copies
in an fdstat_t object that contains the initial rights the descriptor
should have, but also file descriptor flags that should persist after
opening (APPEND, NONBLOCK, *SYNC). Only flags that don't persist (EXCL,
TRUNC, CREAT, DIRECTORY) are passed in as an argument.

file_open() first converts the rights, the persistent flags and the
non-persistent flags to fflags. It then calls into vn_open(). If
successful, it installs the file descriptor with the requested
rights, trimming off rights that don't apply to the type of
the file that has been opened.

Unlike kern_openat(), this function does not support /dev/fd/*. I can't
think of a reason why we need to support this for CloudABI.

Obtained from:	https://github.com/NuxiNL/freebsd
Differential Revision:	https://reviews.freebsd.org/D3235
2015-08-06 06:47:28 +00:00
..
cloudabi_clock.c Add a futex implementation for CloudABI. 2015-07-27 10:07:29 +00:00
cloudabi_errno.c Add a sysentvec for CloudABI on x86-64. 2015-07-16 18:24:06 +00:00
cloudabi_fd.c Add file_open(): the underlying system call of openat(). 2015-08-06 06:47:28 +00:00
cloudabi_file.c Add file_open(): the underlying system call of openat(). 2015-08-06 06:47:28 +00:00
cloudabi_futex.c Let the CloudABI futex code use umtx_keys. 2015-08-04 06:02:03 +00:00
cloudabi_mem.c Implement CloudABI memory management system calls. 2015-07-17 09:00:38 +00:00
cloudabi_proc.c Correct the previous commit: remove the DECLARE_MODULE(). 2015-08-05 16:53:49 +00:00
cloudabi_proto.h
cloudabi_random.c Implement the CloudABI random_get() system call. 2015-07-14 18:45:15 +00:00
cloudabi_sock.c Add the remaining pointer size independent CloudABI socket system calls. 2015-08-05 08:18:05 +00:00
cloudabi_syscalldefs.h Implement the basic system calls that operate on pathnames. 2015-07-24 07:46:02 +00:00
cloudabi_thread.c Add a futex implementation for CloudABI. 2015-07-27 10:07:29 +00:00
cloudabi_util.h Add file_open(): the underlying system call of openat(). 2015-08-06 06:47:28 +00:00