[comp.lang.c] Is there any reader on my FIFO ?

kimcm@ambush.UUCP (Kim Chr. Madsen) (05/02/88)

Can anybody out there help?

I've got this problem of having two processes exchanging messages
through FIFO files (yes I'm running SYSV). The two processes run on
separate machines (connected with RFS) and I'm interrested in
acquiring information abouth whether the remote process is alive and
reading from the FIFO file. Is there a way to determine whether a FIFO
has a reader associated and can fcntl(2) be used for this purpose?

Misc. Information: 3B2/600 computer(s) running UNIX System V Rel. 3.1.1

Thanks in Advance,

Kim Chr. Madsen, AmbraSoft A/S, Rojelskaer 15, DK-2840 Holte (Denmark)
UUCP: kimcm@ambush.dk, PHONE: +45 2424 111, FAX: +45 2423 090

Though I am not naturally honest, I am so sometimes by chance.
					-- William Shakespeare
					

les@chinet.UUCP (Leslie Mikesell) (05/08/88)

In article <745@ambush.UUCP> kimcm@ambush.UUCP (Kim Chr. Madsen) writes:
>... Is there a way to determine whether a FIFO
>has a reader associated and can fcntl(2) be used for this purpose?

If the O_NDELAY flag is set, open() will return an error when opening
a FIFO for writing-only when no process currently has the file open for
reading.  Errno should be ENXIO in this case.

  Les Mikesell