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.


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