summaryrefslogtreecommitdiffstats
path: root/gl/sys_socket.in.h
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2009-05-19 22:32:10 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2009-05-19 22:32:10 (GMT)
commit50b3ff7b91e78a61aca93247bee586d6d7eb27c8 (patch)
treedb4c7eee24479ac7ee6888ce1562facf60159b71 /gl/sys_socket.in.h
parent2701ccd500e60537a8c2977a81549ff33eeaef3f (diff)
downloadmonitoring-plugins-50b3ff7b91e78a61aca93247bee586d6d7eb27c8.tar.gz
Sync with the latest Gnulib code (cb75dc5)
Signed-off-by: Holger Weiss <holger@zedat.fu-berlin.de>
Diffstat (limited to 'gl/sys_socket.in.h')
-rw-r--r--gl/sys_socket.in.h26
1 files changed, 23 insertions, 3 deletions
diff --git a/gl/sys_socket.in.h b/gl/sys_socket.in.h
index 5d9b3cd..dadd56a 100644
--- a/gl/sys_socket.in.h
+++ b/gl/sys_socket.in.h
@@ -1,6 +1,6 @@
1/* Provide a sys/socket header file for systems lacking it (read: MinGW) 1/* Provide a sys/socket header file for systems lacking it (read: MinGW)
2 and for systems where it is incomplete. 2 and for systems where it is incomplete.
3 Copyright (C) 2005-2008 Free Software Foundation, Inc. 3 Copyright (C) 2005-2009 Free Software Foundation, Inc.
4 Written by Simon Josefsson. 4 Written by Simon Josefsson.
5 5
6 This program is free software; you can redistribute it and/or modify 6 This program is free software; you can redistribute it and/or modify
@@ -43,6 +43,26 @@
43#ifndef _GL_SYS_SOCKET_H 43#ifndef _GL_SYS_SOCKET_H
44#define _GL_SYS_SOCKET_H 44#define _GL_SYS_SOCKET_H
45 45
46#if !@HAVE_STRUCT_SOCKADDR_STORAGE@
47# include <alignof.h>
48/* Code taken from glibc sysdeps/unix/sysv/linux/bits/socket.h on
49 2009-05-08, licensed under LGPLv2.1+, plus portability fixes. */
50# define __ss_aligntype unsigned long int
51# define _SS_SIZE 256
52# define _SS_PADSIZE \
53 (_SS_SIZE - ((sizeof (sa_family_t) >= alignof (__ss_aligntype) \
54 ? sizeof (sa_family_t) \
55 : alignof (__ss_aligntype)) \
56 + sizeof (__ss_aligntype)))
57
58struct sockaddr_storage
59{
60 sa_family_t ss_family; /* Address family, etc. */
61 __ss_aligntype __ss_align; /* Force desired alignment. */
62 char __ss_padding[_SS_PADSIZE];
63};
64#endif
65
46#if @HAVE_SYS_SOCKET_H@ 66#if @HAVE_SYS_SOCKET_H@
47 67
48/* A platform that has <sys/socket.h>. */ 68/* A platform that has <sys/socket.h>. */
@@ -256,7 +276,7 @@ extern int rpl_getsockname (int, struct sockaddr *, int *);
256# if @HAVE_WINSOCK2_H@ 276# if @HAVE_WINSOCK2_H@
257# undef getsockopt 277# undef getsockopt
258# define getsockopt rpl_getsockopt 278# define getsockopt rpl_getsockopt
259extern int rpl_getsockopt (int, int, int, void *, int *); 279extern int rpl_getsockopt (int, int, int, void *, socklen_t *);
260# endif 280# endif
261# elif @HAVE_WINSOCK2_H@ 281# elif @HAVE_WINSOCK2_H@
262# undef getsockopt 282# undef getsockopt
@@ -358,7 +378,7 @@ extern int rpl_sendto (int, const void *, int, int, struct sockaddr *, int);
358# if @HAVE_WINSOCK2_H@ 378# if @HAVE_WINSOCK2_H@
359# undef setsockopt 379# undef setsockopt
360# define setsockopt rpl_setsockopt 380# define setsockopt rpl_setsockopt
361extern int rpl_setsockopt (int, int, int, const void *, int); 381extern int rpl_setsockopt (int, int, int, const void *, socklen_t);
362# endif 382# endif
363# elif @HAVE_WINSOCK2_H@ 383# elif @HAVE_WINSOCK2_H@
364# undef setsockopt 384# undef setsockopt