Operating System - OpenVMS
1753758 Members
4743 Online
108799 Solutions
New Discussion юеВ

mknod equivalent to OVMS to create FIFO special FIle

 
Sharitha
New Member

mknod equivalent to OVMS to create FIFO special FIle

Hi,
Can you please let me know what is the equivalent mknod function from unix to the OVMS.I am converting an application developed in c++ on unix to Open VMS .So this system call mknod(creates a FIFO special file) says undefined during compilation.So is there any other function that i can use or method
Kindly help.
- sharitha
3 REPLIES 3
Hein van den Heuvel
Honored Contributor

Re: mknod equivalent to OVMS to create FIFO special FIle



mknod (and mkfifo) never made it into the crtl.
No significant customer pressure, and too many other things to do.

Check out popen and pclose.

I would suggest you look up the VMS native function SYS$CREMBX. It is close but not close enough to readily make a general purpose mknod from:

- $crembx for a permanent mailbox requires PRMMBX privileges.
- Mknod would be expected to leave a directory entry, but crembx creates a devices and/or logical name
- fstat should say it is a pipe, but it will be a mailbox.

hth,
Hein.
Willem Grooters
Honored Contributor

Re: mknod equivalent to OVMS to create FIFO special FIle

Good way, using mailboxes. These are FIFO by nature.

Another approach:
Create an indexed file with Primary key: Integer value, ascending, nodup

Keep track of newest, that is: last key value written
Keep track of oldest, that is: last key value read

IN:
Incement LastKey
PrimaryKey = LastKey
WRITE record

OUT:
Either:

Increment OldestKey
PrimaryKey = OldestKey
READ on Primary key

or:

PrimaryKey = 0
READ on Primary key. This will result in an error (KEY NOT FOUND or something like that) but the record will contain what you need.
DELETE record (a requireement here)

Willem Grooters
OpenVMS Developer & System Manager
Willem Grooters
Honored Contributor

Re: mknod equivalent to OVMS to create FIFO special FIle

BTW, You could do the same with relative files when you read "Record number" for "Primary key". Implies less overhead...

If you can do al writing in one go, and process all data afterwards, a plain sequential file might be a possibility.
Willem Grooters
OpenVMS Developer & System Manager