file descriptor passing via streams ioctl (AIX 4.3)

file descriptor passing via streams ioctl (AIX 4.3)

Post by Bill Wei » Sat, 19 Aug 2000 04:00:00



I have an application that uses I_SENDFD/I_RECVFD ioctl's to pass file
descriptors between processes via a streams pipe.  The same pipe is also
used for data messages.  Before sending an fd, the sending process sends a
message to tell the receiver to expect the fd.  In most cases this works
fine, but in some circumstances on AIX (4.3) the receiving process gets the
fd before the corresponding message instead of after it - ie the fd
sometimes jumps the queue.

Can anyone suggest a way I can reliably ensure that messages and fds are
delivered in the same sequence as they are sent?  I've tried calling I_FLUSH
in the sending process before called I_SENDFD, but that doesn't appear to
help.  The only way I have been able to get round this is by making the
sending process sleep for a short time before the I_SENDFD - but that isn't
really satisfactory.

The application runs on other versions of UNIX (Solaris, UnixWare, Linux)
without exhibiting this problem.

--

Senior Software Engineer

 
 
 

file descriptor passing via streams ioctl (AIX 4.3)

Post by Doug Hocki » Tue, 22 Aug 2000 04:00:00


I have no experience with STREAMS on AIX but rather on UnixWare
which you say you already have working.  The only way I can
imagine this happening is related to priority effects. Ioctls
travel thru the queues as a different type of messages than
regular data and perhaps (in AIX's implementation?) they are
given priorty over data messages and if timing and load
are just right can overtake data messages.

You should probably try posting this to an AIX newsgroup, maybe
someone there can give a better answer.

-- Doug

 
 
 

file descriptor passing via streams ioctl (AIX 4.3)

Post by Scott G. Hal » Tue, 22 Aug 2000 04:00:00



> I have no experience with STREAMS on AIX but rather on UnixWare
> which you say you already have working.  The only way I can
> imagine this happening is related to priority effects. Ioctls
> travel thru the queues as a different type of messages than
> regular data and perhaps (in AIX's implementation?) they are
> given priorty over data messages and if timing and load
> are just right can overtake data messages.

> You should probably try posting this to an AIX newsgroup, maybe
> someone there can give a better answer.

I agree -- and also include cross-posting to comp.unix.sys5.r3, since AIX
is SVR3.2 based, and what you are finding is what I remember SCO UNIX and
Interactive UNIX (both SVR3.2) behaving like.

--
Scott G. Hall                   General Dynamics Communication Systems
ph: 919-549-1189                North Carolina Systems Center

 
 
 

file descriptor passing via streams ioctl (AIX 4.3)

Post by Bill Wei » Wed, 23 Aug 2000 04:00:00


Thanks, guys.  I had guessed it was some sort of priority effect, but
streams documentation being what it is, I haven't been able to work out what
to do about it.  I already cross-posted to comp.unix.aix, without any reply
so far.  I'll try comp.unix.sys5.r3 too.

Regards,

--




> > I have no experience with STREAMS on AIX but rather on UnixWare
> > which you say you already have working.  The only way I can
> > imagine this happening is related to priority effects. Ioctls
> > travel thru the queues as a different type of messages than
> > regular data and perhaps (in AIX's implementation?) they are
> > given priorty over data messages and if timing and load
> > are just right can overtake data messages.

> > You should probably try posting this to an AIX newsgroup, maybe
> > someone there can give a better answer.

> I agree -- and also include cross-posting to comp.unix.sys5.r3, since AIX
> is SVR3.2 based, and what you are finding is what I remember SCO UNIX and
> Interactive UNIX (both SVR3.2) behaving like.

> --
> Scott G. Hall General Dynamics Communication Systems
> ph: 919-549-1189 North Carolina Systems Center


 
 
 

1. file descriptor passing via streams ioctl (AIX 4.3)

I have an application that uses I_SENDFD/I_RECVFD ioctl's to pass file
descriptors between processes via a streams pipe.  The same pipe is also
used for data messages.  Before sending an fd, the sending process sends a
message to tell the receiver to expect the fd.  In most cases this works
fine, but in some circumstances on AIX (4.3) the receiving process gets the
fd before the corresponding message instead of after it - ie the fd
sometimes jumps the queue.

Can anyone suggest a way I can reliably ensure that messages and fds are
delivered in the same sequence as they are sent?  I've tried calling I_FLUSH
in the sending process before called I_SENDFD, but that doesn't appear to
help.  The only way I have been able to get round this is by making the
sending process sleep for a short time before the I_SENDFD - but that isn't
really satisfactory.

The application runs on other versions of UNIX (Solaris, UnixWare, Linux)
without exhibiting this problem.

--

Senior Software Engineer

2. "Undefined symbol" when compiling for purify

3. 80gb ide disk drive in Ultra 5??? !

4. Socket descriptor passing in AIX 4.3

5. help setting up Kyocera F-2200s Printer under Linux

6. passing file descriptors through stream pipes?

7. Printing from Konqueror under KDE 3.0

8. autoinstall patches and passing file descriptors via sockets

9. Passing file descriptors via sendmsg

10. passing file descriptors in AIX

11. Passing File Descriptors in AIX 4.3.3