summaryrefslogtreecommitdiff
path: root/lgl
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-04-13 15:39:43 +0200
committerSimon Josefsson <simon@josefsson.org>2008-04-13 15:39:43 +0200
commiteb270b04f38e2c0bc43d5c00c4399d34f64fda51 (patch)
treea0d02aef9c3dcdae1d0e77468886d8d40d9c867f /lgl
parentdeaa2483a18bcee9c7c227fcfc4c23e1522c20f1 (diff)
downloadgnutls-eb270b04f38e2c0bc43d5c00c4399d34f64fda51.tar.gz
Update gnulib files.
Diffstat (limited to 'lgl')
-rw-r--r--lgl/m4/sys_socket_h.m425
-rw-r--r--lgl/sys_socket.in.h27
2 files changed, 44 insertions, 8 deletions
diff --git a/lgl/m4/sys_socket_h.m4 b/lgl/m4/sys_socket_h.m4
index d9659c2d75..887cff80eb 100644
--- a/lgl/m4/sys_socket_h.m4
+++ b/lgl/m4/sys_socket_h.m4
@@ -1,5 +1,5 @@
-# sys_socket_h.m4 serial 4
-dnl Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+# sys_socket_h.m4 serial 5
+dnl Copyright (C) 2005-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -17,9 +17,28 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET],
])
if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
SYS_SOCKET_H=''
+ dnl If the shutdown function exists, <sys/socket.h> should define
+ dnl SHUT_RD, SHUT_WR, SHUT_RDWR.
+ AC_CHECK_FUNCS([shutdown])
+ if test $ac_cv_func_shutdown = yes; then
+ AC_CACHE_CHECK([whether <sys/socket.h> defines the SHUT_* macros],
+ [gl_cv_header_sys_socket_h_shut],
+ [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <sys/socket.h>]],
+ [[int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };]])],
+ [gl_cv_header_sys_socket_h_shut=yes],
+ [gl_cv_header_sys_socket_h_shut=no])
+ ])
+ if test $gl_cv_header_sys_socket_h_shut = no; then
+ SYS_SOCKET_H='sys/socket.h'
+ fi
+ fi
else
SYS_SOCKET_H='sys/socket.h'
-
+ fi
+ if test -n "$SYS_SOCKET_H"; then
+ dnl Check prerequisites of the <sys/socket.h> replacement.
gl_CHECK_NEXT_HEADERS([sys/socket.h])
if test $ac_cv_header_sys_socket_h = yes; then
HAVE_SYS_SOCKET_H=1
diff --git a/lgl/sys_socket.in.h b/lgl/sys_socket.in.h
index 35cde40b23..f6594b43fe 100644
--- a/lgl/sys_socket.in.h
+++ b/lgl/sys_socket.in.h
@@ -1,5 +1,6 @@
-/* Provide a sys/socket header file for systems lacking it (read: MinGW).
- Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+/* Provide a sys/socket header file for systems lacking it (read: MinGW)
+ and for systems where it is incomplete.
+ Copyright (C) 2005-2008 Free Software Foundation, Inc.
Written by Simon Josefsson.
This program is free software; you can redistribute it and/or modify
@@ -16,8 +17,9 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-/* This file is supposed to be used on platforms that lack <sys/socket.h>
- and on platforms where <sys/socket.h> cannot be included standalone.
+/* This file is supposed to be used on platforms that lack <sys/socket.h>,
+ on platforms where <sys/socket.h> cannot be included standalone, and on
+ platforms where <sys/socket.h> does not provide all necessary definitions.
It is intended to provide definitions and prototypes needed by an
application. */
@@ -37,7 +39,22 @@
#ifndef _GL_SYS_SOCKET_H
#define _GL_SYS_SOCKET_H
-#if !@HAVE_SYS_SOCKET_H@
+#if @HAVE_SYS_SOCKET_H@
+
+/* A platform that has <sys/socket.h>. */
+
+/* For shutdown(). */
+# if !defined SHUT_RD
+# define SHUT_RD 0
+# endif
+# if !defined SHUT_WR
+# define SHUT_WR 1
+# endif
+# if !defined SHUT_RDWR
+# define SHUT_RDWR 2
+# endif
+
+#else
/* A platform that lacks <sys/socket.h>.