home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / unixlib / !UnixLib / src / unix / c / ispipe < prev    next >
Encoding:
Text File  |  1994-09-30  |  378 b   |  26 lines

  1. static char sccs_id[] = "@(#) ispipe.c 1.2 " __DATE__ " HJR";
  2.  
  3. /* ispipe.c (c) Copyright 1990 H.Rogers */
  4.  
  5. #include <errno.h>
  6.  
  7. #include "sys/types.h"
  8. #include "sys/dev.h"
  9. #include "sys/unix.h"
  10.  
  11. int
  12. ispipe (int fd)
  13. {
  14.   register struct file *f;
  15.  
  16.   if (BADF (fd))
  17.     {
  18.       errno = EBADF;
  19.       return (-1);
  20.     }
  21.  
  22.   f = __u->file + fd;
  23.  
  24.   return (major (f->dev) == DEV_PIPE);
  25. }
  26.