Re: sendmsg/recvmsg question

Snow Cat (snowcat@netgate.net)
Fri, 14 Feb 1997 09:50:33 -0800 (PST)


Mike Kilburn once wrote:
>
>
>
> On Wed, 12 Feb 1997, Bill Perkins wrote:
>
> > I am trying to set up a simple program using sendmsg(), to eventually share open
> > file descriptors between processes. I've looked through the Stevens books, and even
> > peered at the kernel a trifle, and so far have come up with nothing.
> > sendmsg() returns 0 bytes sent, recvmsg() (of course) comes back with 0 bytes read.
> > Is sendmsg() broken in the kernel (2.0.28) or in libc (5.4.17, the latest I could find)?
>
> Why not use read/write? I have often wondered why sendmsg/recvmsg are even
> around.
>

One can not pass open file descriptors around with read/write. I wrote a program
that uses sendmsg/recvmsg for non-Linux platform. At the time these functions
didn't support passing fd's under Linux, so I had to open /proc/NNNN/fd/x.

-- 
 _.    	        _       .  
(_ ,_  _ ,  .  / ` _ _L	 | Email: Oleg Kibirev <snowcat@netgate.net>
._)| U(_)\/\/  \_,(_L/L  | Visit http://math.math.CSUFresno.EDU/~oleg/math.html
------------------------'  to get my programs + PGP public key