Portable mknod ?? does it exist?

Dave Decot decot at hpisod2.HP.COM
Tue Aug 1 03:34:17 AEST 1989


> Sun (SunOS Release 4.0): 
>      mknod works fine
>      read blocks
> Silicon Graphics (Iris 4D1-3.1D IP6):
>      mknod works fine
>      read does not block
> DEC (Ultrix-32 V3.0):
>      mknod works fine
>      open fails with error "No such device or address" (ERRNO: 6)
> HP (HP-UX):
>      mknod fails with error "Invalid argument" (ERRNO: 22)
> 
> Does anyone have any suggestions on how to make this portable ?
> Or an alternative to named pipes which is portable?

The posted code works fine on all HP-UX systems I've tried:

HP 9000 Series 300 (HP-UX 6.2)
   mknod works fine
   read blocks
HP 9000 Series 300 (HP-UX 6.5)
   mknod works fine
   read blocks
HP 9000 Series 800 (HP-UX 3.1)
   mknod works fine
   read blocks

What release were you using?

Note, though, that the use of the constant 0010000 is not guaranteed to
be portable; you should really be using the macro S_IFIFO from
<sys/stat.h> instead.

HP-UX 7.0 (for all HP-UX systems) will support the mkfifo() function.

Dave Decot
Hewlett-Packard



More information about the Comp.unix.questions mailing list