[comp.sys.apollo] fifo files on Apollo-systems.

larss@nada.kth.se (Lars Schylberg) (06/08/89)

A problem for unix programmers.

I have a problem how to create fifo files on the Apollo
system.  We are currently running BSD4.2 and 9.7.1.

We are trying to port a public domain software called GRASS
(Geographic Resoures Analysis Support System) to Apollo, which prior
have been running on SUN and MASSCOMP.  The interprocess communication
in this package between the program and the Xwindow graphic driver is
handled with fifo files.  We have a monitorcap file that defines how
the fifo files should connect. eg:

APOLLO:driver/APOLLO:Apollo X graphics display:/dev/fifo.a /dev/fifo.b::any terminal

To get this to work we are supposed to create two devices with the
command:

mknod -p /dev/fifo.a
mknod -p /dev/fifo.b

This command is however not availble in 9.7.  I looked in the standard
library and found the mknod(2).  I wrote this program:

main()
{
   int mode;
   mode = 0010000;
   mknod("/dev/fifo.a",mode);
   mknod("/dev/fifo.b",mode);
}

and after that chmod 7777 fifo.a and fifo.b to be able to open those
from our program.  That didn't work however.  What have I done wrong.
I not too experienced in interporcess programming so I don't want to
rewrite this with sockets which I tried once before.  I would be very
glad for advice and hints how to get around this.

When we chance to OS 10.1, (we just have it on 1 out 8 nodes now)
I've seen there is a command mknod(8) with the syntax:

/etc/mknod name [b] / [c] major minor

I suppose that I want to create a character device with c
but what do I set major and minor to.  The system source file
conf.c is something I can't find.  Nither can the Stockholm
Apollo office support group.  HELP !!!!.

Lars Schylberg                       Email: larss@fmi.kth.se
Department of Photogrammetry         (Internet)
Royal Institute of Technolgy
S-100 44  STOCKHOLM                  Tel. +46 8 790 86 33 (office)
SWEDEN                               Fax. +46 8 10 91 99
/*----------------------------------------------------------------*/

GBOPOLY1@NUSVM.BITNET (fclim) (06/12/89)

Hi,
     In article <1176@draken.nada.kth.se> larss%draken%kth%mcvax.uucp@uunet.uu.
net (Lars Schylberg) writes

>I have a problem how to create fifo files on the Apollo
>system.  We are currently running BSD4.2 and 9.7.1.
>
>To get this to work we are supposed to create two devices with the
>command:
>
>mknod -p /dev/fifo.a
>mknod -p /dev/fifo.b
>
>This command is however not availble in 9.7.  I looked in the standard

FIFOs are System V goodies and not BSD-ism.   Mknod(8) is available under
SR9.7 -- look for it in /sys5/etc where /sys5 is the root for all SysV
stuff.  The command is
      mknod /dev/fifo.a p
-- the file (/dev/fifo.a) created will be a FIFO because of the p option.

>This command is however not availble in 9.7.  I looked in the standard
>library and found the mknod(2).  I wrote this program:
>
>main()
>{
>   int mode;
>   mode = 0010000;
>   mknod("/dev/fifo.a",mode);
>   mknod("/dev/fifo.b",mode);
>}
>
>and after that chmod 7777 fifo.a and fifo.b to be able to open those
>from our program.  That didn't work however.  What have I done wrong.

I do not have my man pages with me; so I can't really tell you.  In
       chmod 7777 /dev/fifo.a
the most significant 7 is the sticky bit (setuid, etc) and does not make
/dev/fifo.a a FIFO.
The one in mode = 0010000 may be the password to make /dev/fifo.a a FIFO;
you have to check the man pages (chmod(2) or is it stat(2)) on this -- look
up the System V version rather than the BSD4.2 version.

>I've seen there is a command mknod(8) with the syntax:
>
>/etc/mknod name [b] / [c] major minor
>
>I suppose that I want to create a character device with c
>but what do I set major and minor to.  The system source file

See "The Design of the Unix operating system" (Prentice Hall ISBN-0-87692-516-6
) by Maurice
Bach (chapter on I/O) for an explaination of major/minor -- he explained it
better than I ever could.

Hope this has been of help.

fclim          --- gbopoly1 % nusvm.bitnet @ cunyvm.cuny.edu
computer centre
singapore polytechnic
dover road
singapore 0513.

weber_w@apollo.COM (Walt Weber) (06/14/89)

In article <1176@draken.nada.kth.se> larss@nada.kth.se (Lars Schylberg) writes:
>A problem for unix programmers.
>
>I have a problem how to create fifo files on the Apollo
>system.  We are currently running BSD4.2 and 9.7.1.

I believe that you will find that FIFO's were not supported under bsd4.2,
and were added to bsd4.3.

You would be able to create the fifo's using the Sys5 mknod which came with
your Domain/IX (since you are running under sr9), or by compiling your program
which calls mknod(2) under the sys5 systype.

>When we chance to OS 10.1, (we just have it on 1 out 8 nodes now)
>I've seen there is a command mknod(8) with the syntax:
>/etc/mknod name [b] / [c] major minor
>
>I suppose that I want to create a character device with c
>but what do I set major and minor to.
>Lars Schylberg                       Email: larss@fmi.kth.se

No, it is not a character special device.  The released software does not
appear to have a way to create the FIFO using bsd4.3 mknod(8).  You should
be able to write a short program (under bsd4.3) which would make the call to
mknod(2) with the mode bit for S_IFIFO set (see sys/stat.h), or use the
Sys5.3 version of mknod(8) (found listed as mknod(1m)).

I have submitted apr #dd1ff in your name against this problem, and you will
be receiving an official answer from us in writing.  Sorry for the problem.

...walt...

PS - Note that you can submit apr's via email (if you have internet access);
     type 'man mkapr' on an sr10 system.

-- 
Walt Weber                    Apollo Computer
(508) 256-6600 x8315          People's Republic of Massachusetts
-The views expressed herein are personal, and not binding on ANYONE-