Page MenuHomeFreeBSD

Make pipes in CloudABI work.
ClosedPublic

Authored by ed on Jul 29 2015, 3:49 PM.
Tags
None
Referenced Files
F82180461: D3236.id.diff
Fri, Apr 26, 6:03 AM
F82180459: D3236.diff
Fri, Apr 26, 6:03 AM
Unknown Object (File)
Mar 6 2024, 1:49 AM
Unknown Object (File)
Dec 26 2023, 5:11 PM
Unknown Object (File)
Nov 24 2023, 11:05 PM
Unknown Object (File)
Nov 4 2023, 3:39 AM
Unknown Object (File)
Sep 29 2023, 12:32 AM
Unknown Object (File)
Sep 12 2023, 6:41 AM
Subscribers

Details

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

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ed retitled this revision from to Make pipes in CloudABI work..
ed updated this object.
ed edited the test plan for this revision. (Show Details)
ed added reviewers: jilles, mjg.

Don't change falloc(); introduce falloc_caps().

mjg edited edge metadata.

ACK, although I would suggest committing kern_pipe2 -> kern_pipe change separately.

sys/compat/cloudabi/cloudabi_fd.c
123 ↗(On Diff #7471)

Afair there is no need to zero these.

This revision is now accepted and ready to land.Jul 29 2015, 4:51 PM
In D3236#65204, @mjg wrote:

ACK, although I would suggest committing kern_pipe2 -> kern_pipe change separately.

Will do!

sys/compat/cloudabi/cloudabi_fd.c
123 ↗(On Diff #7471)

I also need to initialize fc_ioctls/fc_nioctls. It is all right to zero-initialize those.

ed edited edge metadata.
This revision was automatically updated to reflect the committed changes.