aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@codesourcery.com>2008-05-21 17:50:58 +0000
committerDaniel Jacobowitz <dan@codesourcery.com>2008-05-21 17:50:58 +0000
commit83d53ff1aa05f0ca0d397f01cd20eef375514f93 (patch)
tree2cee1e8315b230c313a4715276dd54e662fc559a
parent601352feab3364f14ccfc8db193bb3dbc5ad7771 (diff)
downloadglibc-83d53ff1aa05f0ca0d397f01cd20eef375514f93.tar.xz
glibc-83d53ff1aa05f0ca0d397f01cd20eef375514f93.zip
2008-05-21 Joseph Myers <joseph@codesourcery.com>
* sysdeps/unix/sysv/linux/mips/bits/socket.h: Cleanup namespace. (SOCK_DCCP): Define.
-rw-r--r--ChangeLog.mips5
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/socket.h72
2 files changed, 67 insertions, 10 deletions
diff --git a/ChangeLog.mips b/ChangeLog.mips
index 398fac9cec..8a90a3d402 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2008-05-21 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/bits/socket.h: Cleanup namespace.
+ (SOCK_DCCP): Define.
+
2008-05-01 Joseph Myers <joseph@codesourcery.com>
* sysdeps/unix/sysv/linux/mips/bits/resource.h: Define
diff --git a/sysdeps/unix/sysv/linux/mips/bits/socket.h b/sysdeps/unix/sysv/linux/mips/bits/socket.h
index 8748c0a04a..f3adf5f1a7 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, 1994-1999, 2000, 2001, 2004, 2005, 2006, 2007
+ Copyright (C) 1991, 92, 1994-1999, 2000, 2001, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -26,10 +26,8 @@
#endif
#define __need_size_t
-#define __need_NULL
#include <stddef.h>
-#include <limits.h>
#include <sys/types.h>
/* Type for length arguments in socket calls. */
@@ -54,6 +52,8 @@ enum __socket_type
SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
datagrams of fixed maximum length. */
#define SOCK_SEQPACKET SOCK_SEQPACKET
+ SOCK_DCCP = 6,
+#define SOCK_DCCP SOCK_DCCP /* Datagram Congestion Control Protocol. */
SOCK_PACKET = 10 /* Linux specific way of getting packets
at the dev level. For writing rarp and
other similar things on the user level. */
@@ -156,11 +156,7 @@ 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_aligntype unsigned long int
#define _SS_SIZE 128
#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype)))
@@ -257,7 +253,7 @@ struct cmsghdr
#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
#define CMSG_FIRSTHDR(mhdr) \
((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \
- ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
+ ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0)
#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
& (size_t) ~(sizeof (size_t) - 1))
#define CMSG_SPACE(len) (CMSG_ALIGN (len) \
@@ -301,18 +297,74 @@ enum
#endif
};
+#ifdef __USE_GNU
/* User visible structure for SCM_CREDENTIALS message */
-
struct ucred
{
pid_t pid; /* PID of sending process. */
uid_t uid; /* UID of sending process. */
gid_t gid; /* GID of sending process. */
};
+#endif
+
+/* Ugly workaround for unclean kernel headers. */
+#if !defined __USE_MISC && !defined __USE_GNU
+# ifndef FIOGETOWN
+# define __SYS_SOCKET_H_undef_FIOGETOWN
+# endif
+# ifndef FIOSETOWN
+# define __SYS_SOCKET_H_undef_FIOSETOWN
+# endif
+# ifndef SIOCATMARK
+# define __SYS_SOCKET_H_undef_SIOCATMARK
+# endif
+# ifndef SIOCGPGRP
+# define __SYS_SOCKET_H_undef_SIOCGPGRP
+# endif
+# ifndef SIOCGSTAMP
+# define __SYS_SOCKET_H_undef_SIOCGSTAMP
+# endif
+# ifndef SIOCGSTAMPNS
+# define __SYS_SOCKET_H_undef_SIOCGSTAMPNS
+# endif
+# ifndef SIOCSPGRP
+# define __SYS_SOCKET_H_undef_SIOCSPGRP
+# endif
+#endif
/* Get socket manipulation related informations from kernel headers. */
#include <asm/socket.h>
+#if !defined __USE_MISC && !defined __USE_GNU
+# ifdef __SYS_SOCKET_H_undef_FIOGETOWN
+# undef __SYS_SOCKET_H_undef_FIOGETOWN
+# undef FIOGETOWN
+# endif
+# ifdef __SYS_SOCKET_H_undef_FIOSETOWN
+# undef __SYS_SOCKET_H_undef_FIOSETOWN
+# undef FIOSETOWN
+# endif
+# ifdef __SYS_SOCKET_H_undef_SIOCATMARK
+# undef __SYS_SOCKET_H_undef_SIOCATMARK
+# undef SIOCATMARK
+# endif
+# ifdef __SYS_SOCKET_H_undef_SIOCGPGRP
+# undef __SYS_SOCKET_H_undef_SIOCGPGRP
+# undef SIOCGPGRP
+# endif
+# ifdef __SYS_SOCKET_H_undef_SIOCGSTAMP
+# undef __SYS_SOCKET_H_undef_SIOCGSTAMP
+# undef SIOCGSTAMP
+# endif
+# ifdef __SYS_SOCKET_H_undef_SIOCGSTAMPNS
+# undef __SYS_SOCKET_H_undef_SIOCGSTAMPNS
+# undef SIOCGSTAMPNS
+# endif
+# ifdef __SYS_SOCKET_H_undef_SIOCSPGRP
+# undef __SYS_SOCKET_H_undef_SIOCSPGRP
+# undef SIOCSPGRP
+# endif
+#endif
/* Structure used to manipulate the SO_LINGER option. */
struct linger