HH\Lib\OS\read

Facebook Engineer?

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

Read from the specified FileDescriptor

namespace HH\Lib\OS;

function read(
  FileDescriptor $fd,
  int $max_bytes,
): string;

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

Parameters

  • FileDescriptor $fd
  • int $max_bytes

Returns

  • string