about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/bits/socket.h23
-rw-r--r--sysdeps/unix/sysv/linux/bits/socket.h19
-rw-r--r--sysdeps/unix/sysv/linux/ftime.c4
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/socket.h21
4 files changed, 63 insertions, 4 deletions
diff --git a/sysdeps/generic/bits/socket.h b/sysdeps/generic/bits/socket.h
index 480d5b592a..5eb29492b4 100644
--- a/sysdeps/generic/bits/socket.h
+++ b/sysdeps/generic/bits/socket.h
@@ -1,5 +1,5 @@
 /* System-specific socket constants and types.  Generic/4.3 BSD 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
@@ -24,6 +24,9 @@
 # error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
 #endif
 
+#include <limits.h>
+#include <bits/types.h>
+
 #define	__need_size_t
 #include <stddef.h>
 
@@ -127,6 +130,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
   {
diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
index 9733903c8b..37a9d930ff 100644
--- a/sysdeps/unix/sysv/linux/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/bits/socket.h
@@ -28,6 +28,7 @@
 #define __need_NULL
 #include <stddef.h>
 
+#include <limits.h>
 #include <sys/types.h>
 
 /* Type for length arguments in socket calls.  */
@@ -139,6 +140,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_aligntype	__uint64_t
+#else
+# define __ss_aligntype	__uint32_t
+#endif
+#define _SS_SIZE	128
+#define _SS_PADSIZE	(_SS_SIZE - (2 * sizeof (__ss_aligntype)))
+
+struct sockaddr_storage
+  {
+    __SOCKADDR_COMMON (__ss_);	/* Address family, etc.  */
+    __ss_aligntype __ss_align;	/* Force desired alignment.  */
+    char __ss_padding[_SS_PADSIZE];
+  };
+
+
 /* Bits in the FLAGS argument to `send', `recv', et al.  */
 enum
   {
diff --git a/sysdeps/unix/sysv/linux/ftime.c b/sysdeps/unix/sysv/linux/ftime.c
index e8b5e6e60b..5a5949f608 100644
--- a/sysdeps/unix/sysv/linux/ftime.c
+++ b/sysdeps/unix/sysv/linux/ftime.c
@@ -1,3 +1,3 @@
 /* Linux defines the ftime system call but doesn't actually implement
-   it.  Use the generic implementation.  */
-#include <sysdeps/generic/ftime.c>
+   it.  Use the BSD implementation.  */
+#include <sysdeps/unix/bsd/ftime.c>
diff --git a/sysdeps/unix/sysv/linux/mips/bits/socket.h b/sysdeps/unix/sysv/linux/mips/bits/socket.h
index cd85df7ef3..5dbdee419f 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 <stddef.h>
 
+#include <limits.h>
 #include <sys/types.h>
 
 /* 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
   {