summaryrefslogtreecommitdiffstats
path: root/libc/sysdeps/linux/common/bits/socket.h
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common/bits/socket.h')
-rw-r--r--libc/sysdeps/linux/common/bits/socket.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/libc/sysdeps/linux/common/bits/socket.h b/libc/sysdeps/linux/common/bits/socket.h
index 2466c0cd1..2f3dc797b 100644
--- a/libc/sysdeps/linux/common/bits/socket.h
+++ b/libc/sysdeps/linux/common/bits/socket.h
@@ -1,5 +1,5 @@
/* System-specific socket constants and types. Linux version.
- Copyright (C) 1991,1992,1994-2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1991,1992,1994-2001,2004,2006 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
@@ -215,16 +215,26 @@ enum
/* Note: do not change these members to match glibc; these match the
SuSv3 spec already (e.g. msg_iovlen/msg_controllen).
http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/socket.h.html */
+/* Note: linux kernel uses __kernel_size_t (which is 8bytes on 64bit
+ platforms, and 4bytes on 32bit platforms) for msg_iovlen/msg_controllen */
struct msghdr
{
void *msg_name; /* Address to send to/receive from. */
socklen_t msg_namelen; /* Length of address data. */
struct iovec *msg_iov; /* Vector of data to send/receive into. */
+#if __WORDSIZE == 32
int msg_iovlen; /* Number of elements in the vector. */
+#else
+ size_t msg_iovlen; /* Number of elements in the vector. */
+#endif
void *msg_control; /* Ancillary data (eg BSD filedesc passing). */
+#if __WORDSIZE == 32
socklen_t msg_controllen; /* Ancillary data buffer length. */
+#else
+ size_t msg_controllen; /* Ancillary data buffer length. */
+#endif
int msg_flags; /* Flags on received message. */
};
@@ -286,13 +296,12 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
<linux/socket.h>. */
enum
{
- SCM_RIGHTS = 0x01, /* Transfer file descriptors. */
+ SCM_RIGHTS = 0x01 /* Transfer file descriptors. */
#define SCM_RIGHTS SCM_RIGHTS
#ifdef __USE_BSD
- SCM_CREDENTIALS = 0x02, /* Credentials passing. */
+ , SCM_CREDENTIALS = 0x02 /* Credentials passing. */
# define SCM_CREDENTIALS SCM_CREDENTIALS
#endif
- __SCM_CONNECT = 0x03 /* Data array is `struct scm_connect'. */
};
/* User visible structure for SCM_CREDENTIALS message */