You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

23 lines
416 B

  1. /* Usage, mthdcat < cmds | methods/mthd
  2. All this does is cat a file into the method without closing the FD when
  3. the file ends */
  4. #include <config.h>
  5. #include <unistd.h>
  6. int main()
  7. {
  8. char Buffer[4096];
  9. while (1)
  10. {
  11. int Res = read(STDIN_FILENO,Buffer,sizeof(Buffer));
  12. if (Res <= 0)
  13. while (1) sleep(100);
  14. if (write(STDOUT_FILENO,Buffer,Res) != Res)
  15. break;
  16. }
  17. return 0;
  18. }