Descriptor Passing problems...

Descriptor Passing problems...

Post by Mark Kilfoi » Wed, 27 May 1998 04:00:00



I'm having problems with descriptor passing under Redhat 5.0 Linux
(2.0.32).  I'm quite sure the code is correct (I've even taken
Stevens' examples and found them not to work), so the only conclusion
is that there is somethine deeper.

The sendmsg() call fails, errno==EINVAL (invalid parameter).  
Parameters look fine and dandy to me..  

Compiling with Gcc 2.7.2.something, -D_BSD_SOURCE -D_POSIX_SOURCE
blah, blah, blah..

Anyone got a suggestion?

Mark K.
--
                    .  . .  .-    `. Don't worry about the world
 the Encaffeinated ( ) |\|  |-    .'  ending today...  It's already
                    `  ` `  `-    `.  tomorrow in Australia.

 
 
 

Descriptor Passing problems...

Post by Greg Herlei » Thu, 28 May 1998 04:00:00



> I'm having problems with descriptor passing under Redhat 5.0 Linux
> (2.0.32).  I'm quite sure the code is correct (I've even taken
> Stevens' examples and found them not to work), so the only conclusion
> is that there is somethine deeper.
> The sendmsg() call fails, errno==EINVAL (invalid parameter).  
> Parameters look fine and dandy to me..  

Someone pointed out to me recently that there was a buggy library in the
RH5.0 distribution - there was a file descriptor constant that should have
started at 0 but instead started at 1.  Applying the errata
libc-devel-xxx.rpm fixed it.  

Have you applied ALL the errata rpms off the RH web page?

<follow-ups redirected to ONLY comp.os.linux.system>

--
/*****************************************************
Greg Herlein                     415-519-3650 Voice    
Herlein Engineering              415-440-9015 Fax      

www.herlein.com                  

Software Development - Data Acquisition - Networking  
Wireless - Unix - Linux - Solaris - Embedded Systems
*****************************************************/

 
 
 

1. Problem passing descriptor with UNIX sockets

I'm building client and server applications which communicate via a UNIX
domain stream socket.  The first think I want the client to send the server
after connecting is an open descriptor, using sendmsg().  Obviously, the
first thing the server does after accept() returns is a recvmsg() call.
The problem is that recvmsg is returning 0, rather than blocking until
the client sends something.  I've verified this under dbx; before the
client even gets to sendmsg(), the server has gotten 0 from sendmsg().
I've scrupulously followed Stevens' examples in "UNIX Network
Programming", and the socket works great for normal data  (I tested by
write()'ing a test string to the server, which read() it fine, before
doing the sendmsg/recvmsg).  Any ideas what I'm doing wrong?  BTW, this
is done on an SGI 4D/35, running IRIX 4.0.5.
--
Jim Tomlinson    BoGART Project    Boeing Computer Services    Bellevue, WA

2. How to convert PNG to GIF?

3. Problem with SendMsg( For passing file-descriptor )

4. Alpha Board Speeds.

5. Problems passing file descriptors between processes.

6. Send Bulk -E-Mail

7. Problems using sendmsg() and recvmsg() to pass a descriptor

8. Status of posix-ACL's

9. have a problem passing descriptor to thread in HP-UX 11.0

10. PROBLEM: 2.0 kernels: bogus cmsg_type returned when passing descriptor

11. Passing file descriptors using recvmsg and sendmsg questions

12. 4.2 inetd passes its last open descriptor to child processes

13. Passing file descriptors across processes