delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/10/17/17:35:02

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Mon, 17 Oct 2005 23:34:52 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: struct msghdr in socket.h is wrong
Message-ID: <20051017213452.GB19398@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <ur7aqwno0 DOT fsf AT gnu DOT org> <20051012204234 DOT GA9218 AT calimero DOT vinschen DOT de> <u64rydwtj DOT fsf AT gnu DOT org> <20051017084416 DOT GA11091 AT calimero DOT vinschen DOT de>
Mime-Version: 1.0
In-Reply-To: <20051017084416.GA11091@calimero.vinschen.de>
User-Agent: Mutt/1.4.2i

On Oct 17 10:44, Corinna Vinschen wrote:
> On Oct 15 22:23, Sam Steingold wrote:
> > > * Corinna Vinschen [2005-10-12 22:42:34 +0200]:
> > > On Oct 12 15:17, Sam Steingold wrote:
> > >> cyswin/socket.h:
> > >> 
> > >> struct msghdr
> > >> {
> > >> 	void	*	msg_name;	/* Socket name			*/
> > >> 	int		msg_namelen;	/* Length of name		*/
> > >> 	struct iovec *	msg_iov;	/* Data blocks			*/
> > >> 	int		msg_iovlen;	/* Number of blocks		*/
> > >> 	void	*	msg_accrights;	/* Per protocol magic (eg BSD file descriptor passing) */
> > >> 	int		msg_accrightslen;	/* Length of rights list */
> > >> };
> > >
> > > This is the so called "older" implementation of struct msghdr as
> > > defined up to 4.2BSD.  Since it's quite useless so far and since
> > 
> > I am not sure I quite understand what you mean by useless.
> > is cygwin implementation somehow deficient?
> > 
> sendmsg and recvmsg don't utilize the msg_accrights/msg_accrightslen member.
> 
> > > applications using this structure should accomodate the old
> > > implementation anyway, I don't see a good reason to change this right
> > > now.
> > 
> > the only reason applications have to accommodate the old implementation
> > is that some unixes still stick with it.
> 
> So, from a portability perspective...
> 
> > if you switch to the posix msghdr, I, for one, would not have to
> > accomodate the old implementation.
> 
> I won't change it now.  I'll change it at one point when there's some
> functionality.

Never mind, I've changed it in CVS.  Note that msg_control, msg_controllen
and msg_flags members are still without function.  However, msg_controllen
and msg_flags are both set to 0 on return from recvmsg.  The CMSG_FIRSTHDR
macro is meant to handle this gracefully, so please try the next Cygwin
snapshot and report back.  Keep in mind that for testing this correctly,
you have to install at least /usr/include/cygwin/socket.h and
/usr/lib/libcygwin.a additionally to the DLL.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019