public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* struct msghdr in socket.h is wrong
@ 2005-10-12 19:18 Sam Steingold
  2005-10-12 20:42 ` Corinna Vinschen
  0 siblings, 1 reply; 8+ messages in thread
From: Sam Steingold @ 2005-10-12 19:18 UTC (permalink / raw)
  To: cygwin

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 */
};

http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/socket.h.html:

void          *msg_name        Optional address. 
socklen_t      msg_namelen     Size of address. 
struct iovec  *msg_iov         Scatter/gather array. 
int            msg_iovlen      Members in msg_iov. 
void          *msg_control     Ancillary data; see below. 
socklen_t      msg_controllen  Ancillary data buffer len. 
int            msg_flags       Flags on received message.

problems:

1. msg_flags is missing
2. msg_control is renamed msg_accrights
3. msg_controllen is renamed msg_accrightslen

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.palestinefacts.org/>
<http://www.memri.org/> <http://www.jihadwatch.org/> <http://truepeace.org>
Takeoffs are optional.  Landings are mandatory.

--
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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: struct msghdr in socket.h is wrong
  2005-10-12 19:18 struct msghdr in socket.h is wrong Sam Steingold
@ 2005-10-12 20:42 ` Corinna Vinschen
  2005-10-16  2:24   ` Sam Steingold
  0 siblings, 1 reply; 8+ messages in thread
From: Corinna Vinschen @ 2005-10-12 20:42 UTC (permalink / raw)
  To: cygwin

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 applications
using this structure should accomodate the old implementation anyway,
I don't see a good reason to change this right now.


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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: struct msghdr in socket.h is wrong
  2005-10-12 20:42 ` Corinna Vinschen
@ 2005-10-16  2:24   ` Sam Steingold
  2005-10-17  8:44     ` Corinna Vinschen
  0 siblings, 1 reply; 8+ messages in thread
From: Sam Steingold @ 2005-10-16  2:24 UTC (permalink / raw)
  To: cygwin

> * Corinna Vinschen <pbevaan-pltjva@pltjva.pbz> [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?

> 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.
if you switch to the posix msghdr, I, for one, would not have to
accomodate the old implementation.

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.mideasttruth.com/> <http://www.iris.org.il>
<http://www.jihadwatch.org/> <http://www.memri.org/> <http://ffii.org/>
Two wrongs don't make a right, but three rights make a left.

--
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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: struct msghdr in socket.h is wrong
  2005-10-16  2:24   ` Sam Steingold
@ 2005-10-17  8:44     ` Corinna Vinschen
  2005-10-17 21:34       ` Corinna Vinschen
  0 siblings, 1 reply; 8+ messages in thread
From: Corinna Vinschen @ 2005-10-17  8:44 UTC (permalink / raw)
  To: cygwin

On Oct 15 22:23, Sam Steingold wrote:
> > * Corinna Vinschen <pbevaan-pltjva@pltjva.pbz> [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.

Hint: Applications using only the first four members of this structure
will be binary compatible...


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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: struct msghdr in socket.h is wrong
  2005-10-17  8:44     ` Corinna Vinschen
@ 2005-10-17 21:34       ` Corinna Vinschen
  2005-10-21 20:19         ` Sam Steingold
  0 siblings, 1 reply; 8+ messages in thread
From: Corinna Vinschen @ 2005-10-17 21:34 UTC (permalink / raw)
  To: cygwin

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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: struct msghdr in socket.h is wrong
  2005-10-17 21:34       ` Corinna Vinschen
@ 2005-10-21 20:19         ` Sam Steingold
  2005-10-22  9:07           ` Corinna Vinschen
  0 siblings, 1 reply; 8+ messages in thread
From: Sam Steingold @ 2005-10-21 20:19 UTC (permalink / raw)
  To: cygwin

> * Corinna Vinschen <pbevaan-pltjva@pltjva.pbz> [2005-10-17 23:34:52 +0200]:
>
> Never mind, I've changed it in CVS.  Note that msg_control,
> msg_controllen and msg_flags members are still without function.

that's OK, as long as they are there.

while you are at it, two more networking functions appear AWOL:
http://www.opengroup.org/onlinepubs/007904975/functions/getaddrinfo.html
http://www.opengroup.org/onlinepubs/007904975/functions/getnameinfo.html

thanks!

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.honestreporting.com> <http://www.dhimmi.com/>
<http://truepeace.org> <http://www.openvotingconsortium.org/>
There are 3 kinds of people: those who can count and those who cannot.

--
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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: struct msghdr in socket.h is wrong
  2005-10-21 20:19         ` Sam Steingold
@ 2005-10-22  9:07           ` Corinna Vinschen
  2005-10-22 17:02             ` Corinna Vinschen
  0 siblings, 1 reply; 8+ messages in thread
From: Corinna Vinschen @ 2005-10-22  9:07 UTC (permalink / raw)
  To: cygwin

On Oct 21 16:18, Sam Steingold wrote:
> > * Corinna Vinschen <pbevaan-pltjva@pltjva.pbz> [2005-10-17 23:34:52 +0200]:
> >
> > Never mind, I've changed it in CVS.  Note that msg_control,
> > msg_controllen and msg_flags members are still without function.
> 
> that's OK, as long as they are there.
> 
> while you are at it, two more networking functions appear AWOL:
> http://www.opengroup.org/onlinepubs/007904975/functions/getaddrinfo.html
> http://www.opengroup.org/onlinepubs/007904975/functions/getnameinfo.html

No, not yet.


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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: struct msghdr in socket.h is wrong
  2005-10-22  9:07           ` Corinna Vinschen
@ 2005-10-22 17:02             ` Corinna Vinschen
  0 siblings, 0 replies; 8+ messages in thread
From: Corinna Vinschen @ 2005-10-22 17:02 UTC (permalink / raw)
  To: cygwin

On Oct 22 11:07, Corinna Vinschen wrote:
> On Oct 21 16:18, Sam Steingold wrote:
> > > * Corinna Vinschen <pbevaan-pltjva@pltjva.pbz> [2005-10-17 23:34:52 +0200]:
> > >
> > > Never mind, I've changed it in CVS.  Note that msg_control,
> > > msg_controllen and msg_flags members are still without function.
> > 
> > that's OK, as long as they are there.
> > 
> > while you are at it, two more networking functions appear AWOL:
> > http://www.opengroup.org/onlinepubs/007904975/functions/getaddrinfo.html
> > http://www.opengroup.org/onlinepubs/007904975/functions/getnameinfo.html
> 
> No, not yet.

Btw., you have a Cygwin assignment in place, AFAIR.

http://cygwin.com/acronyms/#SHTDI
http://cygwin.com/acronyms/#PTC


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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-10-22 17:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-12 19:18 struct msghdr in socket.h is wrong Sam Steingold
2005-10-12 20:42 ` Corinna Vinschen
2005-10-16  2:24   ` Sam Steingold
2005-10-17  8:44     ` Corinna Vinschen
2005-10-17 21:34       ` Corinna Vinschen
2005-10-21 20:19         ` Sam Steingold
2005-10-22  9:07           ` Corinna Vinschen
2005-10-22 17:02             ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).