HH\Lib\OS\pipe

Facebook Engineer?

This function is available as OS\pipe() in Facebook's www repository.

Create a pair of connected file descriptors

namespace HH\Lib\OS;

function pipe(): (FileDescriptor, FileDescriptor);

See man 2 pipe for details. On error, an ErrnoException will be thrown.

O_CLOEXEC is implicitly set for consistent behavior between standalone CLI mode and server modes. Use OS\fcntl() to remove if needed.

Returns

  • Two - FileDescriptors; the first is read-only, and the second is write-only. Data written to the second can be read from the first.