patches/glibc/ports-2.10.1/550-alpha-fix-SOCK_NONBLOCK.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jan 17 23:06:02 2010 +0100 (2010-01-17)
changeset 1740 c57458bb354d
permissions -rw-r--r--
configure: do not require hg when configuring in an hg clone

When configuring in an hg clone, we need hg to compute the version string.
It can happen that users do not have Mercurial (eg. if they got a snapshot
rather that they did a full clone). In this case, we can still run, of
course, so simply fill the version string with a sufficiently explicit
value, that does not require hg. The date is a good candidate.
yann@1625
     1
2009-08-16  Aurelien Jarno  <aurelien@aurel32.net>
yann@1625
     2
yann@1625
     3
	* ports/sysdeps/unix/sysv/linux/alpha/bits/socket.h: New file based on
yann@1625
     4
	the generic version, with SOCK_NONBLOCK matching the kernel value.
yann@1625
     5
yann@1625
     6
diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/bits/socket.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/bits/socket.h
yann@1625
     7
--- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/bits/socket.h	1970-01-01 01:00:00.000000000 +0100
yann@1625
     8
+++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/bits/socket.h	2009-11-13 00:51:17.000000000 +0100
yann@1625
     9
@@ -0,0 +1,407 @@
yann@1625
    10
+/* System-specific socket constants and types.  Linux version.
yann@1625
    11
+   Copyright (C) 1991, 1992, 1994-2001, 2004, 2006, 2007, 2008, 2009
yann@1625
    12
+   Free Software Foundation, Inc.
yann@1625
    13
+   This file is part of the GNU C Library.
yann@1625
    14
+
yann@1625
    15
+   The GNU C Library is free software; you can redistribute it and/or
yann@1625
    16
+   modify it under the terms of the GNU Lesser General Public
yann@1625
    17
+   License as published by the Free Software Foundation; either
yann@1625
    18
+   version 2.1 of the License, or (at your option) any later version.
yann@1625
    19
+
yann@1625
    20
+   The GNU C Library is distributed in the hope that it will be useful,
yann@1625
    21
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
yann@1625
    22
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
yann@1625
    23
+   Lesser General Public License for more details.
yann@1625
    24
+
yann@1625
    25
+   You should have received a copy of the GNU Lesser General Public
yann@1625
    26
+   License along with the GNU C Library; if not, write to the Free
yann@1625
    27
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
yann@1625
    28
+   02111-1307 USA.  */
yann@1625
    29
+
yann@1625
    30
+#ifndef __BITS_SOCKET_H
yann@1625
    31
+#define __BITS_SOCKET_H
yann@1625
    32
+
yann@1625
    33
+#ifndef _SYS_SOCKET_H
yann@1625
    34
+# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
yann@1625
    35
+#endif
yann@1625
    36
+
yann@1625
    37
+#define	__need_size_t
yann@1625
    38
+#include <stddef.h>
yann@1625
    39
+
yann@1625
    40
+#include <sys/types.h>
yann@1625
    41
+
yann@1625
    42
+/* Type for length arguments in socket calls.  */
yann@1625
    43
+#ifndef __socklen_t_defined
yann@1625
    44
+typedef __socklen_t socklen_t;
yann@1625
    45
+# define __socklen_t_defined
yann@1625
    46
+#endif
yann@1625
    47
+
yann@1625
    48
+/* Types of sockets.  */
yann@1625
    49
+enum __socket_type
yann@1625
    50
+{
yann@1625
    51
+  SOCK_STREAM = 1,		/* Sequenced, reliable, connection-based
yann@1625
    52
+				   byte streams.  */
yann@1625
    53
+#define SOCK_STREAM SOCK_STREAM
yann@1625
    54
+  SOCK_DGRAM = 2,		/* Connectionless, unreliable datagrams
yann@1625
    55
+				   of fixed maximum length.  */
yann@1625
    56
+#define SOCK_DGRAM SOCK_DGRAM
yann@1625
    57
+  SOCK_RAW = 3,			/* Raw protocol interface.  */
yann@1625
    58
+#define SOCK_RAW SOCK_RAW
yann@1625
    59
+  SOCK_RDM = 4,			/* Reliably-delivered messages.  */
yann@1625
    60
+#define SOCK_RDM SOCK_RDM
yann@1625
    61
+  SOCK_SEQPACKET = 5,		/* Sequenced, reliable, connection-based,
yann@1625
    62
+				   datagrams of fixed maximum length.  */
yann@1625
    63
+#define SOCK_SEQPACKET SOCK_SEQPACKET
yann@1625
    64
+  SOCK_DCCP = 6,		/* Datagram Congestion Control Protocol.  */
yann@1625
    65
+#define SOCK_DCCP SOCK_DCCP
yann@1625
    66
+  SOCK_PACKET = 10,		/* Linux specific way of getting packets
yann@1625
    67
+				   at the dev level.  For writing rarp and
yann@1625
    68
+				   other similar things on the user level. */
yann@1625
    69
+#define SOCK_PACKET SOCK_PACKET
yann@1625
    70
+
yann@1625
    71
+  /* Flags to be ORed into the type parameter of socket and socketpair and
yann@1625
    72
+     used for the flags parameter of paccept.  */
yann@1625
    73
+
yann@1625
    74
+  SOCK_CLOEXEC = 02000000,	/* Atomically set close-on-exec flag for the
yann@1625
    75
+				   new descriptor(s).  */
yann@1625
    76
+#define SOCK_CLOEXEC SOCK_CLOEXEC
yann@1625
    77
+#undef SOCK_NONBLOCK
yann@1625
    78
+  SOCK_NONBLOCK = 0x40000000	/* Atomically mark descriptor(s) as
yann@1625
    79
+				   non-blocking.  */
yann@1625
    80
+#define SOCK_NONBLOCK SOCK_NONBLOCK
yann@1625
    81
+};
yann@1625
    82
+
yann@1625
    83
+/* Protocol families.  */
yann@1625
    84
+#define	PF_UNSPEC	0	/* Unspecified.  */
yann@1625
    85
+#define	PF_LOCAL	1	/* Local to host (pipes and file-domain).  */
yann@1625
    86
+#define	PF_UNIX		PF_LOCAL /* POSIX name for PF_LOCAL.  */
yann@1625
    87
+#define	PF_FILE		PF_LOCAL /* Another non-standard name for PF_LOCAL.  */
yann@1625
    88
+#define	PF_INET		2	/* IP protocol family.  */
yann@1625
    89
+#define	PF_AX25		3	/* Amateur Radio AX.25.  */
yann@1625
    90
+#define	PF_IPX		4	/* Novell Internet Protocol.  */
yann@1625
    91
+#define	PF_APPLETALK	5	/* Appletalk DDP.  */
yann@1625
    92
+#define	PF_NETROM	6	/* Amateur radio NetROM.  */
yann@1625
    93
+#define	PF_BRIDGE	7	/* Multiprotocol bridge.  */
yann@1625
    94
+#define	PF_ATMPVC	8	/* ATM PVCs.  */
yann@1625
    95
+#define	PF_X25		9	/* Reserved for X.25 project.  */
yann@1625
    96
+#define	PF_INET6	10	/* IP version 6.  */
yann@1625
    97
+#define	PF_ROSE		11	/* Amateur Radio X.25 PLP.  */
yann@1625
    98
+#define	PF_DECnet	12	/* Reserved for DECnet project.  */
yann@1625
    99
+#define	PF_NETBEUI	13	/* Reserved for 802.2LLC project.  */
yann@1625
   100
+#define	PF_SECURITY	14	/* Security callback pseudo AF.  */
yann@1625
   101
+#define	PF_KEY		15	/* PF_KEY key management API.  */
yann@1625
   102
+#define	PF_NETLINK	16
yann@1625
   103
+#define	PF_ROUTE	PF_NETLINK /* Alias to emulate 4.4BSD.  */
yann@1625
   104
+#define	PF_PACKET	17	/* Packet family.  */
yann@1625
   105
+#define	PF_ASH		18	/* Ash.  */
yann@1625
   106
+#define	PF_ECONET	19	/* Acorn Econet.  */
yann@1625
   107
+#define	PF_ATMSVC	20	/* ATM SVCs.  */
yann@1625
   108
+#define PF_RDS		21	/* RDS sockets.  */
yann@1625
   109
+#define	PF_SNA		22	/* Linux SNA Project */
yann@1625
   110
+#define	PF_IRDA		23	/* IRDA sockets.  */
yann@1625
   111
+#define	PF_PPPOX	24	/* PPPoX sockets.  */
yann@1625
   112
+#define	PF_WANPIPE	25	/* Wanpipe API sockets.  */
yann@1625
   113
+#define PF_LLC		26	/* Linux LLC.  */
yann@1625
   114
+#define PF_CAN		29	/* Controller Area Network.  */
yann@1625
   115
+#define PF_TIPC		30	/* TIPC sockets.  */
yann@1625
   116
+#define	PF_BLUETOOTH	31	/* Bluetooth sockets.  */
yann@1625
   117
+#define	PF_IUCV		32	/* IUCV sockets.  */
yann@1625
   118
+#define PF_RXRPC	33	/* RxRPC sockets.  */
yann@1625
   119
+#define PF_ISDN		34	/* mISDN sockets.  */
yann@1625
   120
+#define PF_PHONET	35	/* Phonet sockets.  */
yann@1625
   121
+#define PF_IEEE802154	36	/* IEEE 802.15.4 sockets.  */
yann@1625
   122
+#define	PF_MAX		37	/* For now..  */
yann@1625
   123
+
yann@1625
   124
+/* Address families.  */
yann@1625
   125
+#define	AF_UNSPEC	PF_UNSPEC
yann@1625
   126
+#define	AF_LOCAL	PF_LOCAL
yann@1625
   127
+#define	AF_UNIX		PF_UNIX
yann@1625
   128
+#define	AF_FILE		PF_FILE
yann@1625
   129
+#define	AF_INET		PF_INET
yann@1625
   130
+#define	AF_AX25		PF_AX25
yann@1625
   131
+#define	AF_IPX		PF_IPX
yann@1625
   132
+#define	AF_APPLETALK	PF_APPLETALK
yann@1625
   133
+#define	AF_NETROM	PF_NETROM
yann@1625
   134
+#define	AF_BRIDGE	PF_BRIDGE
yann@1625
   135
+#define	AF_ATMPVC	PF_ATMPVC
yann@1625
   136
+#define	AF_X25		PF_X25
yann@1625
   137
+#define	AF_INET6	PF_INET6
yann@1625
   138
+#define	AF_ROSE		PF_ROSE
yann@1625
   139
+#define	AF_DECnet	PF_DECnet
yann@1625
   140
+#define	AF_NETBEUI	PF_NETBEUI
yann@1625
   141
+#define	AF_SECURITY	PF_SECURITY
yann@1625
   142
+#define	AF_KEY		PF_KEY
yann@1625
   143
+#define	AF_NETLINK	PF_NETLINK
yann@1625
   144
+#define	AF_ROUTE	PF_ROUTE
yann@1625
   145
+#define	AF_PACKET	PF_PACKET
yann@1625
   146
+#define	AF_ASH		PF_ASH
yann@1625
   147
+#define	AF_ECONET	PF_ECONET
yann@1625
   148
+#define	AF_ATMSVC	PF_ATMSVC
yann@1625
   149
+#define AF_RDS		PF_RDS
yann@1625
   150
+#define	AF_SNA		PF_SNA
yann@1625
   151
+#define	AF_IRDA		PF_IRDA
yann@1625
   152
+#define	AF_PPPOX	PF_PPPOX
yann@1625
   153
+#define	AF_WANPIPE	PF_WANPIPE
yann@1625
   154
+#define AF_LLC		PF_LLC
yann@1625
   155
+#define AF_CAN		PF_CAN
yann@1625
   156
+#define AF_TIPC		PF_TIPC
yann@1625
   157
+#define	AF_BLUETOOTH	PF_BLUETOOTH
yann@1625
   158
+#define	AF_IUCV		PF_IUCV
yann@1625
   159
+#define AF_RXRPC	PF_RXRPC
yann@1625
   160
+#define AF_ISDN		PF_ISDN
yann@1625
   161
+#define AF_PHONET	PF_PHONET
yann@1625
   162
+#define AF_IEEE802154	PF_IEEE802154
yann@1625
   163
+#define	AF_MAX		PF_MAX
yann@1625
   164
+
yann@1625
   165
+/* Socket level values.  Others are defined in the appropriate headers.
yann@1625
   166
+
yann@1625
   167
+   XXX These definitions also should go into the appropriate headers as
yann@1625
   168
+   far as they are available.  */
yann@1625
   169
+#define SOL_RAW		255
yann@1625
   170
+#define SOL_DECNET      261
yann@1625
   171
+#define SOL_X25         262
yann@1625
   172
+#define SOL_PACKET	263
yann@1625
   173
+#define SOL_ATM		264	/* ATM layer (cell level).  */
yann@1625
   174
+#define SOL_AAL		265	/* ATM Adaption Layer (packet level).  */
yann@1625
   175
+#define SOL_IRDA	266
yann@1625
   176
+
yann@1625
   177
+/* Maximum queue length specifiable by listen.  */
yann@1625
   178
+#define SOMAXCONN	128
yann@1625
   179
+
yann@1625
   180
+/* Get the definition of the macro to define the common sockaddr members.  */
yann@1625
   181
+#include <bits/sockaddr.h>
yann@1625
   182
+
yann@1625
   183
+/* Structure describing a generic socket address.  */
yann@1625
   184
+struct sockaddr
yann@1625
   185
+  {
yann@1625
   186
+    __SOCKADDR_COMMON (sa_);	/* Common data: address family and length.  */
yann@1625
   187
+    char sa_data[14];		/* Address data.  */
yann@1625
   188
+  };
yann@1625
   189
+
yann@1625
   190
+
yann@1625
   191
+/* Structure large enough to hold any socket address (with the historical
yann@1625
   192
+   exception of AF_UNIX).  We reserve 128 bytes.  */
yann@1625
   193
+#define __ss_aligntype	unsigned long int
yann@1625
   194
+#define _SS_SIZE	128
yann@1625
   195
+#define _SS_PADSIZE	(_SS_SIZE - (2 * sizeof (__ss_aligntype)))
yann@1625
   196
+
yann@1625
   197
+struct sockaddr_storage
yann@1625
   198
+  {
yann@1625
   199
+    __SOCKADDR_COMMON (ss_);	/* Address family, etc.  */
yann@1625
   200
+    __ss_aligntype __ss_align;	/* Force desired alignment.  */
yann@1625
   201
+    char __ss_padding[_SS_PADSIZE];
yann@1625
   202
+  };
yann@1625
   203
+
yann@1625
   204
+
yann@1625
   205
+/* Bits in the FLAGS argument to `send', `recv', et al.  */
yann@1625
   206
+enum
yann@1625
   207
+  {
yann@1625
   208
+    MSG_OOB		= 0x01,	/* Process out-of-band data.  */
yann@1625
   209
+#define MSG_OOB		MSG_OOB
yann@1625
   210
+    MSG_PEEK		= 0x02,	/* Peek at incoming messages.  */
yann@1625
   211
+#define MSG_PEEK	MSG_PEEK
yann@1625
   212
+    MSG_DONTROUTE	= 0x04,	/* Don't use local routing.  */
yann@1625
   213
+#define MSG_DONTROUTE	MSG_DONTROUTE
yann@1625
   214
+#ifdef __USE_GNU
yann@1625
   215
+    /* DECnet uses a different name.  */
yann@1625
   216
+    MSG_TRYHARD		= MSG_DONTROUTE,
yann@1625
   217
+# define MSG_TRYHARD	MSG_DONTROUTE
yann@1625
   218
+#endif
yann@1625
   219
+    MSG_CTRUNC		= 0x08,	/* Control data lost before delivery.  */
yann@1625
   220
+#define MSG_CTRUNC	MSG_CTRUNC
yann@1625
   221
+    MSG_PROXY		= 0x10,	/* Supply or ask second address.  */
yann@1625
   222
+#define MSG_PROXY	MSG_PROXY
yann@1625
   223
+    MSG_TRUNC		= 0x20,
yann@1625
   224
+#define	MSG_TRUNC	MSG_TRUNC
yann@1625
   225
+    MSG_DONTWAIT	= 0x40, /* Nonblocking IO.  */
yann@1625
   226
+#define	MSG_DONTWAIT	MSG_DONTWAIT
yann@1625
   227
+    MSG_EOR		= 0x80, /* End of record.  */
yann@1625
   228
+#define	MSG_EOR		MSG_EOR
yann@1625
   229
+    MSG_WAITALL		= 0x100, /* Wait for a full request.  */
yann@1625
   230
+#define	MSG_WAITALL	MSG_WAITALL
yann@1625
   231
+    MSG_FIN		= 0x200,
yann@1625
   232
+#define	MSG_FIN		MSG_FIN
yann@1625
   233
+    MSG_SYN		= 0x400,
yann@1625
   234
+#define	MSG_SYN		MSG_SYN
yann@1625
   235
+    MSG_CONFIRM		= 0x800, /* Confirm path validity.  */
yann@1625
   236
+#define	MSG_CONFIRM	MSG_CONFIRM
yann@1625
   237
+    MSG_RST		= 0x1000,
yann@1625
   238
+#define	MSG_RST		MSG_RST
yann@1625
   239
+    MSG_ERRQUEUE	= 0x2000, /* Fetch message from error queue.  */
yann@1625
   240
+#define	MSG_ERRQUEUE	MSG_ERRQUEUE
yann@1625
   241
+    MSG_NOSIGNAL	= 0x4000, /* Do not generate SIGPIPE.  */
yann@1625
   242
+#define	MSG_NOSIGNAL	MSG_NOSIGNAL
yann@1625
   243
+    MSG_MORE		= 0x8000,  /* Sender will send more.  */
yann@1625
   244
+#define	MSG_MORE	MSG_MORE
yann@1625
   245
+
yann@1625
   246
+    MSG_CMSG_CLOEXEC	= 0x40000000	/* Set close_on_exit for file
yann@1625
   247
+                                           descriptor received through
yann@1625
   248
+                                           SCM_RIGHTS.  */
yann@1625
   249
+#define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC
yann@1625
   250
+  };
yann@1625
   251
+
yann@1625
   252
+
yann@1625
   253
+/* Structure describing messages sent by
yann@1625
   254
+   `sendmsg' and received by `recvmsg'.  */
yann@1625
   255
+struct msghdr
yann@1625
   256
+  {
yann@1625
   257
+    void *msg_name;		/* Address to send to/receive from.  */
yann@1625
   258
+    socklen_t msg_namelen;	/* Length of address data.  */
yann@1625
   259
+
yann@1625
   260
+    struct iovec *msg_iov;	/* Vector of data to send/receive into.  */
yann@1625
   261
+    size_t msg_iovlen;		/* Number of elements in the vector.  */
yann@1625
   262
+
yann@1625
   263
+    void *msg_control;		/* Ancillary data (eg BSD filedesc passing). */
yann@1625
   264
+    size_t msg_controllen;	/* Ancillary data buffer length.
yann@1625
   265
+				   !! The type should be socklen_t but the
yann@1625
   266
+				   definition of the kernel is incompatible
yann@1625
   267
+				   with this.  */
yann@1625
   268
+
yann@1625
   269
+    int msg_flags;		/* Flags on received message.  */
yann@1625
   270
+  };
yann@1625
   271
+
yann@1625
   272
+/* Structure used for storage of ancillary data object information.  */
yann@1625
   273
+struct cmsghdr
yann@1625
   274
+  {
yann@1625
   275
+    size_t cmsg_len;		/* Length of data in cmsg_data plus length
yann@1625
   276
+				   of cmsghdr structure.
yann@1625
   277
+				   !! The type should be socklen_t but the
yann@1625
   278
+				   definition of the kernel is incompatible
yann@1625
   279
+				   with this.  */
yann@1625
   280
+    int cmsg_level;		/* Originating protocol.  */
yann@1625
   281
+    int cmsg_type;		/* Protocol specific type.  */
yann@1625
   282
+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
yann@1625
   283
+    __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data.  */
yann@1625
   284
+#endif
yann@1625
   285
+  };
yann@1625
   286
+
yann@1625
   287
+/* Ancillary data object manipulation macros.  */
yann@1625
   288
+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
yann@1625
   289
+# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
yann@1625
   290
+#else
yann@1625
   291
+# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
yann@1625
   292
+#endif
yann@1625
   293
+#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
yann@1625
   294
+#define CMSG_FIRSTHDR(mhdr) \
yann@1625
   295
+  ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr)		      \
yann@1625
   296
+   ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0)
yann@1625
   297
+#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
yann@1625
   298
+			 & (size_t) ~(sizeof (size_t) - 1))
yann@1625
   299
+#define CMSG_SPACE(len) (CMSG_ALIGN (len) \
yann@1625
   300
+			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
yann@1625
   301
+#define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
yann@1625
   302
+
yann@1625
   303
+extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
yann@1625
   304
+				      struct cmsghdr *__cmsg) __THROW;
yann@1625
   305
+#ifdef __USE_EXTERN_INLINES
yann@1625
   306
+# ifndef _EXTERN_INLINE
yann@1625
   307
+#  define _EXTERN_INLINE __extern_inline
yann@1625
   308
+# endif
yann@1625
   309
+_EXTERN_INLINE struct cmsghdr *
yann@1625
   310
+__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
yann@1625
   311
+{
yann@1625
   312
+  if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
yann@1625
   313
+    /* The kernel header does this so there may be a reason.  */
yann@1625
   314
+    return 0;
yann@1625
   315
+
yann@1625
   316
+  __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
yann@1625
   317
+			       + CMSG_ALIGN (__cmsg->cmsg_len));
yann@1625
   318
+  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
yann@1625
   319
+					+ __mhdr->msg_controllen)
yann@1625
   320
+      || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
yann@1625
   321
+	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
yann@1625
   322
+    /* No more entries.  */
yann@1625
   323
+    return 0;
yann@1625
   324
+  return __cmsg;
yann@1625
   325
+}
yann@1625
   326
+#endif	/* Use `extern inline'.  */
yann@1625
   327
+
yann@1625
   328
+/* Socket level message types.  This must match the definitions in
yann@1625
   329
+   <linux/socket.h>.  */
yann@1625
   330
+enum
yann@1625
   331
+  {
yann@1625
   332
+    SCM_RIGHTS = 0x01		/* Transfer file descriptors.  */
yann@1625
   333
+#define SCM_RIGHTS SCM_RIGHTS
yann@1625
   334
+#ifdef __USE_GNU
yann@1625
   335
+    , SCM_CREDENTIALS = 0x02	/* Credentials passing.  */
yann@1625
   336
+# define SCM_CREDENTIALS SCM_CREDENTIALS
yann@1625
   337
+#endif
yann@1625
   338
+  };
yann@1625
   339
+
yann@1625
   340
+#ifdef __USE_GNU
yann@1625
   341
+/* User visible structure for SCM_CREDENTIALS message */
yann@1625
   342
+struct ucred
yann@1625
   343
+{
yann@1625
   344
+  pid_t pid;			/* PID of sending process.  */
yann@1625
   345
+  uid_t uid;			/* UID of sending process.  */
yann@1625
   346
+  gid_t gid;			/* GID of sending process.  */
yann@1625
   347
+};
yann@1625
   348
+#endif
yann@1625
   349
+
yann@1625
   350
+/* Ugly workaround for unclean kernel headers.  */
yann@1625
   351
+#if !defined __USE_MISC && !defined __USE_GNU
yann@1625
   352
+# ifndef FIOGETOWN
yann@1625
   353
+#  define __SYS_SOCKET_H_undef_FIOGETOWN
yann@1625
   354
+# endif
yann@1625
   355
+# ifndef FIOSETOWN
yann@1625
   356
+#  define __SYS_SOCKET_H_undef_FIOSETOWN
yann@1625
   357
+# endif
yann@1625
   358
+# ifndef SIOCATMARK
yann@1625
   359
+#  define __SYS_SOCKET_H_undef_SIOCATMARK
yann@1625
   360
+# endif
yann@1625
   361
+# ifndef SIOCGPGRP
yann@1625
   362
+#  define __SYS_SOCKET_H_undef_SIOCGPGRP
yann@1625
   363
+# endif
yann@1625
   364
+# ifndef SIOCGSTAMP
yann@1625
   365
+#  define __SYS_SOCKET_H_undef_SIOCGSTAMP
yann@1625
   366
+# endif
yann@1625
   367
+# ifndef SIOCGSTAMPNS
yann@1625
   368
+#  define __SYS_SOCKET_H_undef_SIOCGSTAMPNS
yann@1625
   369
+# endif
yann@1625
   370
+# ifndef SIOCSPGRP
yann@1625
   371
+#  define __SYS_SOCKET_H_undef_SIOCSPGRP
yann@1625
   372
+# endif
yann@1625
   373
+#endif
yann@1625
   374
+
yann@1625
   375
+/* Get socket manipulation related informations from kernel headers.  */
yann@1625
   376
+#include <asm/socket.h>
yann@1625
   377
+
yann@1625
   378
+#if !defined __USE_MISC && !defined __USE_GNU
yann@1625
   379
+# ifdef __SYS_SOCKET_H_undef_FIOGETOWN
yann@1625
   380
+#  undef __SYS_SOCKET_H_undef_FIOGETOWN
yann@1625
   381
+#  undef FIOGETOWN
yann@1625
   382
+# endif
yann@1625
   383
+# ifdef __SYS_SOCKET_H_undef_FIOSETOWN
yann@1625
   384
+#  undef __SYS_SOCKET_H_undef_FIOSETOWN
yann@1625
   385
+#  undef FIOSETOWN
yann@1625
   386
+# endif
yann@1625
   387
+# ifdef __SYS_SOCKET_H_undef_SIOCATMARK
yann@1625
   388
+#  undef __SYS_SOCKET_H_undef_SIOCATMARK
yann@1625
   389
+#  undef SIOCATMARK
yann@1625
   390
+# endif
yann@1625
   391
+# ifdef __SYS_SOCKET_H_undef_SIOCGPGRP
yann@1625
   392
+#  undef __SYS_SOCKET_H_undef_SIOCGPGRP
yann@1625
   393
+#  undef SIOCGPGRP
yann@1625
   394
+# endif
yann@1625
   395
+# ifdef __SYS_SOCKET_H_undef_SIOCGSTAMP
yann@1625
   396
+#  undef __SYS_SOCKET_H_undef_SIOCGSTAMP
yann@1625
   397
+#  undef SIOCGSTAMP
yann@1625
   398
+# endif
yann@1625
   399
+# ifdef __SYS_SOCKET_H_undef_SIOCGSTAMPNS
yann@1625
   400
+#  undef __SYS_SOCKET_H_undef_SIOCGSTAMPNS
yann@1625
   401
+#  undef SIOCGSTAMPNS
yann@1625
   402
+# endif
yann@1625
   403
+# ifdef __SYS_SOCKET_H_undef_SIOCSPGRP
yann@1625
   404
+#  undef __SYS_SOCKET_H_undef_SIOCSPGRP
yann@1625
   405
+#  undef SIOCSPGRP
yann@1625
   406
+# endif
yann@1625
   407
+#endif
yann@1625
   408
+
yann@1625
   409
+/* Structure used to manipulate the SO_LINGER option.  */
yann@1625
   410
+struct linger
yann@1625
   411
+  {
yann@1625
   412
+    int l_onoff;		/* Nonzero to linger on close.  */
yann@1625
   413
+    int l_linger;		/* Time to linger.  */
yann@1625
   414
+  };
yann@1625
   415
+
yann@1625
   416
+#endif	/* bits/socket.h */
yann@1625
   417
diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/bits/socket.h glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/bits/socket.h