freebsd-dev/sys/compat/cloudabi
Ed Schouten 8328babdd0 Make pipes in CloudABI work.
Summary:
Pipes in CloudABI are unidirectional. The reason for this is that
CloudABI attempts to provide a uniform runtime environment across
different flavours of UNIX.

Instead of implementing a custom pipe that is unidirectional, we can
simply reuse Capsicum permission bits to support this. This is nice,
because CloudABI already attempts to restrict permission bits to
correspond with the operations that apply to a certain file descriptor.

Replace kern_pipe() and kern_pipe2() by a single kern_pipe() that takes
a pair of filecaps. These filecaps are passed to the newly introduced
falloc_caps() function that creates the descriptors with rights in
place.

Test Plan:
CloudABI pipes seem to be created with proper rights in place:

https://github.com/NuxiNL/cloudlibc/blob/master/src/libc/unistd/pipe_test.c#L44

Reviewers: jilles, mjg

Reviewed By: mjg

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D3236
2015-07-29 17:18:27 +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 pipes in CloudABI work. 2015-07-29 17:18:27 +00:00
cloudabi_file.c Implement CloudABI's readdir(). 2015-07-29 06:31:44 +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