(* Программа read_demo - вызов fdread для терминала *)
uses linux;
const
  SMALLSZ=10;

var
  nread:longint;
  smallbuf:array [0..SMALLSZ] of char;
begin
  nread := fdread (0, smallbuf, SMALLSZ);
  while nread > 0 do
  begin
    smallbuf[nread] := #0;
    writeln('nread: ',nread,' ', smallbuf);
    nread := fdread (0, smallbuf, SMALLSZ);
  end;
end.

