diff options
author | Eric Andersen <andersen@codepoet.org> | 2006-11-04 18:33:04 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2006-11-04 18:33:04 +0000 |
commit | 2e09dbcacee815cef140612e0e27bfbc61eeed46 (patch) | |
tree | d99d8ad3988d0d50474b482b2b33b0ca8dd48e59 /libc/sysdeps/linux/common/bits/socket.h | |
parent | 36860e64dbe0a6d294ec3b1430e7926ea0ed2fd5 (diff) |
based on a patch from Atsushi Nemoto:
There is a mismatch of struct msghdr between the kernel and libc.
In a 64-bit environment, the size of msg_namelen is 4 for all, but
the size of msg_iovlen and msg_controllen is 8 bytes for the kernel
and for glibc, but 4 bytes for uClibc. Fix size for the 64bit case.
Diffstat (limited to 'libc/sysdeps/linux/common/bits/socket.h')
-rw-r--r-- | libc/sysdeps/linux/common/bits/socket.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/common/bits/socket.h b/libc/sysdeps/linux/common/bits/socket.h index cc13c4874..2f3dc797b 100644 --- a/libc/sysdeps/linux/common/bits/socket.h +++ b/libc/sysdeps/linux/common/bits/socket.h @@ -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. */ }; |