home *** CD-ROM | disk | FTP | other *** search
/ Serving the Web / ServingTheWeb1995.disc1of1.iso / linux / slacksrce / d / libc / libc-4.6 / libc-4 / libc-linux / libio / stdio / pclose.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-10  |  465 b   |  28 lines

  1. #include "libioP.h"
  2. #include "stdio.h"
  3. #include <errno.h>
  4.  
  5. #ifndef __linux__
  6.  
  7. FILE *
  8. popen(command, mode)
  9.      const char *command; const char *mode;
  10. {
  11.   return _IO_popen(command, mode);
  12. }
  13.  
  14. #endif
  15.  
  16. int
  17. pclose(fp)
  18.      FILE *fp;
  19. {
  20. #if 0
  21.   /* Does not actually test that stream was created by popen(). Instead,
  22.      it depends on the filebuf::sys_close() virtual to Do The Right Thing. */
  23.   if (fp is not a proc_file)
  24.     return -1;
  25. #endif
  26.   return _IO_fclose(fp);
  27. }
  28.