pipes.inc 822 B

1234567891011121314151617181920212223242526272829303132
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 1999-2000 by Michael Van Canneyt
  4. Linux specific part of pipe stream.
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. Uses
  12. BaseUnix, Unix, TermIO;
  13. Function CreatePipeHandles (Var Inhandle,OutHandle : Longint) : Boolean;
  14. begin
  15. Result := (AssignPipe (Inhandle,OutHandle)<>-1);
  16. end;
  17. Function TInputPipeStream.GetNumBytesAvailable: DWord;
  18. begin
  19. if fpioctl(Handle, FIONREAD, @Result)<0 then
  20. Result := 0;
  21. end;