diff options
Diffstat (limited to 'sysdeps/unix')
-rw-r--r-- | sysdeps/unix/sysv/linux/bits/in.h | 26 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/bits/socket.h | 68 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/x86_64/bits/stat.h | 4 |
3 files changed, 76 insertions, 22 deletions
diff --git a/sysdeps/unix/sysv/linux/bits/in.h b/sysdeps/unix/sysv/linux/bits/in.h index 6880a2e636..433c033c70 100644 --- a/sysdeps/unix/sysv/linux/bits/in.h +++ b/sysdeps/unix/sysv/linux/bits/in.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1999, 2000, 2004 Free Software Foundation, Inc. +/* Copyright (C) 1991-1999, 2000, 2004, 2008 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 @@ -43,16 +43,18 @@ #define IP_ADD_SOURCE_MEMBERSHIP 39 /* ip_mreq_source: join source group */ #define IP_DROP_SOURCE_MEMBERSHIP 40 /* ip_mreq_source: leave source group */ #define IP_MSFILTER 41 -#define MCAST_JOIN_GROUP 42 /* group_req: join any-source group */ -#define MCAST_BLOCK_SOURCE 43 /* group_source_req: block from given group */ -#define MCAST_UNBLOCK_SOURCE 44 /* group_source_req: unblock from given group*/ -#define MCAST_LEAVE_GROUP 45 /* group_req: leave any-source group */ -#define MCAST_JOIN_SOURCE_GROUP 46 /* group_source_req: join source-spec gr */ -#define MCAST_LEAVE_SOURCE_GROUP 47 /* group_source_req: leave source-spec gr*/ -#define MCAST_MSFILTER 48 - -#define MCAST_EXCLUDE 0 -#define MCAST_INCLUDE 1 +#if defined __USE_MISC || defined __USE_GNU +# define MCAST_JOIN_GROUP 42 /* group_req: join any-source group */ +# define MCAST_BLOCK_SOURCE 43 /* group_source_req: block from given group */ +# define MCAST_UNBLOCK_SOURCE 44 /* group_source_req: unblock from given group*/ +# define MCAST_LEAVE_GROUP 45 /* group_req: leave any-source group */ +# define MCAST_JOIN_SOURCE_GROUP 46 /* group_source_req: join source-spec gr */ +# define MCAST_LEAVE_SOURCE_GROUP 47 /* group_source_req: leave source-spec gr*/ +# define MCAST_MSFILTER 48 + +# define MCAST_EXCLUDE 0 +# define MCAST_INCLUDE 1 +#endif #define IP_ROUTER_ALERT 5 /* bool */ #define IP_PKTINFO 8 /* bool */ @@ -76,6 +78,7 @@ #define IP_DEFAULT_MULTICAST_LOOP 1 #define IP_MAX_MEMBERSHIPS 20 +#if defined __USE_MISC || defined __USE_GNU /* Structure used to describe IP options for IP_OPTIONS and IP_RETOPTS. The `ip_dst' field is used for the first-hop gateway when using a source route (this gets put into the header proper). */ @@ -100,6 +103,7 @@ struct in_pktinfo struct in_addr ipi_spec_dst; /* Routing destination address */ struct in_addr ipi_addr; /* Header destination address */ }; +#endif /* Options for use with `getsockopt' and `setsockopt' at the IPv6 level. The first word in the comment at the right is the data type used; diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h index 11bb607d0d..ceb60133e3 100644 --- a/sysdeps/unix/sysv/linux/bits/socket.h +++ b/sysdeps/unix/sysv/linux/bits/socket.h @@ -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. */ @@ -156,11 +154,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))) @@ -263,7 +257,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) \ @@ -307,18 +301,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 diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/stat.h b/sysdeps/unix/sysv/linux/x86_64/bits/stat.h index add2c8eca3..286c1a2a02 100644 --- a/sysdeps/unix/sysv/linux/x86_64/bits/stat.h +++ b/sysdeps/unix/sysv/linux/x86_64/bits/stat.h @@ -61,7 +61,7 @@ struct stat __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ #if __WORDSIZE == 64 - int pad0; + int __pad0; #endif __dev_t st_rdev; /* Device number, if device. */ #if __WORDSIZE == 32 @@ -129,7 +129,7 @@ struct stat64 __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ #if __WORDSIZE == 64 - int pad0; + int __pad0; __dev_t st_rdev; /* Device number, if device. */ __off_t st_size; /* Size of file, in bytes. */ #else |