* include/cygwin/socket.h (struct cmsghdr): Redefine cmsg_len as type

size_t.  Add comment to explain why.
This commit is contained in:
Corinna Vinschen 2015-01-08 13:12:50 +00:00
parent 808fde520f
commit 46eb312f13
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2015-01-08 Corinna Vinschen <corinna@vinschen.de>
* include/cygwin/socket.h (struct cmsghdr): Redefine cmsg_len as type
size_t. Add comment to explain why.
2015-01-08 Corinna Vinschen <corinna@vinschen.de> 2015-01-08 Corinna Vinschen <corinna@vinschen.de>
* localtime.cc (__cygwin_gettzoffset): New function for access from * localtime.cc (__cygwin_gettzoffset): New function for access from

View File

@ -1,7 +1,7 @@
/* cygwin/socket.h /* cygwin/socket.h
Copyright 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2009, 2010, 2012, Copyright 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2009, 2010, 2012,
2013, 2014 Red Hat, Inc. 2013, 2014, 2015 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.
@ -77,7 +77,10 @@ struct msghdr
struct cmsghdr struct cmsghdr
{ {
socklen_t cmsg_len; /* Length of cmsghdr + data */ /* Amazing but true: The type of cmsg_len should be socklen_t but, just
as on Linux, the definition of the kernel is incompatible with this,
so the Windows socket headers define cmsg_len as SIZE_T. */
size_t cmsg_len; /* Length of cmsghdr + data */
int cmsg_level; /* Protocol */ int cmsg_level; /* Protocol */
int cmsg_type; /* Protocol type */ int cmsg_type; /* Protocol type */
}; };