Repository navigation
Expose underlying file's SyscallConn method. - #17
Conversation
|
ping @tonistiigi |
|
What if the underlying file is not opened yet. Should we return a mock one that unblocks when the opened channel closes? |
|
Ah just realized there is the non-blocking open. |
f010780 to
f29a888
Compare
This allows raw access to the underlying FD, enabling things like in-kernel copy methods such as `splice` and `tee`. This interface was added to `*os.File` as part of go1.12beta2. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
f29a888 to
094bd06
Compare
|
Updated, added new tests, updated CI to test on tip so that new tests will actually run. |
0f317bf to
26c9412
Compare
| default: | ||
| } | ||
|
|
||
| if !f.block { |
There was a problem hiding this comment.
if block was true then either closed or opened has to be closed at this point. Otherwise, it wouldn't be possible to get a handle on the *fifo
|
|
||
| ready := make(chan struct{}) | ||
| close(ready) | ||
| return &rawConn{f: f, raw: raw, ready: ready}, nil |
There was a problem hiding this comment.
Are you saying we should just return f.file.SyscallConn in this case?
At the moment rawConn is doing some of the same things on read/write that *fifo does.
There was a problem hiding this comment.
yes, if the file is already open it shouldn't matter and we can just use the file directly.
26c9412 to
8997a18
Compare
Makes sure that tests for raw conns are actually run in CI. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
8997a18 to
e4b84c0
Compare
- containerd/fifo#17 Expose underlying file's `SyscallConn` method Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- containerd/fifo#17 Expose underlying file's `SyscallConn` method Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: 9234218c50dbe68e705fe0d48df718994ba97583 Component: engine
- containerd/fifo#17 Expose underlying file's `SyscallConn` method Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- containerd/fifo#17 Expose underlying file's `SyscallConn` method Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: ac234326a69116c7a311911276cc4df58b2c5e0a Component: cli
- containerd/fifo#17 Expose underlying file's `SyscallConn` method Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

This allows raw access to the underlying FD, enabling things like
in-kernel copy methods such as
spliceandtee.This interface was added to
*os.Fileas part of go1.12beta2.