* include/cygwin/in.h: Drop including stdint.h. Move definition

of in_port_t and in_addr_t to top of file and use throughout. Use
	sa_family_t type where appropriate.
	(struct in6_addr): Change `unsigned char' to `uint8_t'.
	(struct sockaddr_in6): Add sin6_scope_id member. Add comments.
	* include/cygwin/socket.h: Include stdint.h.  Move definition of
	socklen_t to top of file.  Define sa_family_t.  Define struct
	sockaddr_storage as per SUSv3.
	* include/sys/un.h: Include cygwin/socket.h.  Use sa_family_t type.
This commit is contained in:
Corinna Vinschen
2005-12-31 13:07:43 +00:00
parent cf2af34b70
commit 1b68dd91cf
4 changed files with 51 additions and 18 deletions

View File

@ -15,11 +15,33 @@ details. */
extern "C" {
#endif /* __cplusplus */
#include <stdint.h>
#ifndef socklen_t
#define socklen_t int /* Not unsigned for backward compat. */
#endif
typedef uint16_t sa_family_t;
struct sockaddr {
unsigned short sa_family; /* address family, AF_xxx */
sa_family_t sa_family; /* address family, AF_xxx */
char sa_data[14]; /* 14 bytes of protocol address */
};
/* Definition of sockaddr_storage according to SUSv3. */
#define _SS_MAXSIZE 128 /* Maximum size. */
#define _SS_ALIGNSIZE (sizeof (int64_t))/* Desired alignment. */
#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof (sa_family_t))
#define _SS_PAD2SIZE (_SS_MAXSIZE - (sizeof (sa_family_t) \
+ _SS_PAD1SIZE + _SS_ALIGNSIZE))
struct sockaddr_storage {
sa_family_t ss_familiy;
char _ss_pad1[_SS_PAD1SIZE];
int64_t __ss_align;
char _ss_pad2[_SS_PAD2SIZE];
};
#include <asm/socket.h> /* arch-dependent defines */
#include <cygwin/sockios.h> /* the SIOCxxx I/O controls */
#include <cygwin/uio.h> /* iovec support */
@ -36,10 +58,6 @@ struct linger {
unsigned short l_linger; /* How long to linger for */
};
#ifndef socklen_t
#define socklen_t int
#endif
struct msghdr
{
void * msg_name; /* Socket name */