freebsd-dev/sys/compat/cloudabi
Ed Schouten cec575201a Make fstat() and friends work.
Summary:
CloudABI provides access to two different stat structures:

- fdstat, containing file descriptor level status: oflags, file
  descriptor type and Capsicum rights, used by cap_rights_get(),
  fcntl(F_GETFL), getsockopt(SO_TYPE).
- filestat, containing your regular file status: timestamps, inode
  number, used by fstat().

Unlike FreeBSD's stat::st_mode, CloudABI file descriptor types don't
have overloaded meanings (e.g., returning S_ISCHR() for kqueues). Add a
utility function to extract the type of a file descriptor accurately.

CloudABI does not work with O_ACCMODEs. File descriptors have two sets
of Capsicum-style rights: rights that apply to the file descriptor
itself ('base') and rights that apply to any new file descriptors
yielded through openat() ('inheriting'). Though not perfect, we can
pretty safely decompose Capsicum rights to such a pair. This is done in
convert_capabilities().

Test Plan: Tests for these system calls are fairly extensive in cloudlibc.

Reviewers: jonathan, mjg, #manpages

Reviewed By: mjg

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D3171
2015-07-28 06:36:49 +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 Make fstat() and friends work. 2015-07-28 06:36:49 +00:00
cloudabi_file.c Make fstat() and friends work. 2015-07-28 06:36:49 +00:00
cloudabi_futex.c Add a futex implementation for CloudABI. 2015-07-27 10:07:29 +00:00
cloudabi_mem.c Implement CloudABI memory management system calls. 2015-07-17 09:00:38 +00:00
cloudabi_proc.c Make forking of CloudABI processes work. 2015-07-20 13:46:22 +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 Implement the basic system calls that operate on pathnames. 2015-07-24 07:46:02 +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 Make fstat() and friends work. 2015-07-28 06:36:49 +00:00