Xref: utzoo comp.unix.questions:15261 comp.unix.wizards:17398 Path: utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!ukma!uflorida!haven!h.cs.wvu.wvnet.edu!cerc.wvu.wvnet.edu!drs From: drs@cerc.wvu.wvnet.edu (Darrell Schiebel) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Portable mknod ?? does it exist? Keywords: mknod Message-ID: <178@cerc.wvu.wvnet.edu.edu> Date: 28 Jul 89 18:39:22 GMT Sender: news@cerc.wvu.wvnet.edu Lines: 60 I have been attempting to write software utilizing named pipes on several hardware platforms. The same code seems to behave differently on each different platform. 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? Here is the code snippet: #include #ifdef ULTRIX #include #else #include #endif #define FIFONAME "myfifo" #define PERMS 0000666 #define FIFO 0010000 /* = S_IFIFO */ main(){ char buffer[200]; int pipe; if (mknod(FIFONAME, FIFO | PERMS, 0) == -1) { printf("ERRNO: %d\n",errno); perror("writer: mknod failed"); exit(1);} else printf("myfifo created\n"); if ((pipe = open(FIFONAME,O_RDWR)) == -1){ printf("ERRNO: %d\n",errno); perror("Open Failed"); exit(1);} if (read(pipe, buffer, 20)< 0){ printf("ERRNO: %d\n",errno); perror("Read Failed");}} Any Responses Would be Appreciated. Darrell Schiebel -------------------------------------- Concurrent Engineering Research Center West Virginia University drs@cerc.wvu.wvnet.edu drs@g.cs.wvu.wvnet.edu drs@baks.com