From: Ulrich Drepper Date: Tue, 11 May 1999 12:07:07 +0000 (+0000) Subject: (struct sockaddr_storage): New structure; storage suitable for any X-Git-Tag: upstream/2.30~10627^2~2903 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c2d926dc86653ad0a216246efbdf8ca597dc80a;p=external%2Fglibc.git (struct sockaddr_storage): New structure; storage suitable for any socket address. --- diff --git a/sysdeps/unix/sysv/linux/mips/bits/socket.h b/sysdeps/unix/sysv/linux/mips/bits/socket.h index cd85df7..5dbdee4 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/socket.h +++ b/sysdeps/unix/sysv/linux/mips/bits/socket.h @@ -1,5 +1,5 @@ /* System-specific socket constants and types. Linux/MIPS version. - Copyright (C) 1991, 92, 94, 95, 96, 97, 98 Free Software Foundation, Inc. + Copyright (C) 1991,92,94,95,96,97,98,99 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -28,6 +28,7 @@ #define __need_NULL #include +#include #include /* Type for length arguments in socket calls. */ @@ -133,6 +134,24 @@ struct sockaddr }; +/* Structure large enough to hold any socket address (with the historical + exception of AF_UNIX). We reserve 128 bytes. */ +#if ULONG_MAX > 0xffffffff +# define __ss_align __uint64_t +#else +# define __ss_align __uint32_t +#endif +#define _SS_SIZE 128 +#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof(__ss_align))) + +struct sockaddr_storage + { + __SOCKADDR_COMMON (__ss_); /* Address family, etc. */ + __ss_align __ss_align; /* Force desired alignment. */ + char __ss_padding[_SS_PADSIZE]; + }; + + /* Bits in the FLAGS argument to `send', `recv', et al. */ enum {