• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.gitignoreH A D13-Dec-201913 21

.travis.ymlH A D13-Dec-2019584 2721

LICENSEH A D13-Dec-201911.1 KiB202169

MakefileH A D13-Dec-2019775 289

errors.goH A D13-Dec-2019974 3112

fifo.goH A D13-Dec-20195 KiB237188

fifo_linux_test.goH A D13-Dec-20192.4 KiB10668

fifo_nolinux_test.goH A D13-Dec-20192.3 KiB9862

fifo_test.goH A D13-Dec-20199.3 KiB394289

go.modH A D13-Dec-2019175 107

go.sumH A D13-Dec-20191.3 KiB1615

handle_linux.goH A D13-Dec-20192.1 KiB9865

handle_nolinux.goH A D13-Dec-20191.5 KiB6638

mkfifo_nosolaris.goH A D13-Dec-2019737 265

mkfifo_solaris.goH A D13-Dec-2019752 287

raw.goH A D13-Dec-20192.2 KiB11574

raw_test.goH A D13-Dec-20196.8 KiB251187

readme.mdH A D13-Dec-20191.8 KiB4531

readme.md

1### fifo
2
3[![Build Status](https://travis-ci.org/containerd/fifo.svg?branch=master)](https://travis-ci.org/containerd/fifo)
4[![codecov](https://codecov.io/gh/containerd/fifo/branch/master/graph/badge.svg)](https://codecov.io/gh/containerd/fifo)
5
6Go package for handling fifos in a sane way.
7
8```
9// OpenFifo opens a fifo. Returns io.ReadWriteCloser.
10// Context can be used to cancel this function until open(2) has not returned.
11// Accepted flags:
12// - syscall.O_CREAT - create new fifo if one doesn't exist
13// - syscall.O_RDONLY - open fifo only from reader side
14// - syscall.O_WRONLY - open fifo only from writer side
15// - syscall.O_RDWR - open fifo from both sides, never block on syscall level
16// - syscall.O_NONBLOCK - return io.ReadWriteCloser even if other side of the
17//     fifo isn't open. read/write will be connected after the actual fifo is
18//     open or after fifo is closed.
19func OpenFifo(ctx context.Context, fn string, flag int, perm os.FileMode) (io.ReadWriteCloser, error)
20
21
22// Read from a fifo to a byte array.
23func (f *fifo) Read(b []byte) (int, error)
24
25
26// Write from byte array to a fifo.
27func (f *fifo) Write(b []byte) (int, error)
28
29
30// Close the fifo. Next reads/writes will error. This method can also be used
31// before open(2) has returned and fifo was never opened.
32func (f *fifo) Close() error
33```
34
35## Project details
36
37The fifo is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE).
38As a containerd sub-project, you will find the:
39
40 * [Project governance](https://github.com/containerd/project/blob/master/GOVERNANCE.md),
41 * [Maintainers](https://github.com/containerd/project/blob/master/MAINTAINERS),
42 * and [Contributing guidelines](https://github.com/containerd/project/blob/master/CONTRIBUTING.md)
43
44information in our [`containerd/project`](https://github.com/containerd/project) repository.
45