aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Makefile.in2
-rw-r--r--aclocal.m41
-rwxr-xr-xconfigure96
-rw-r--r--configure.in1
-rw-r--r--lib/Makefile.in19
-rw-r--r--lib/gnulib.mk2
-rw-r--r--m4/gl-comp.m44
-rw-r--r--m4/socklen.m477
-rw-r--r--src/ChangeLog8
-rw-r--r--src/config.in6
-rw-r--r--src/process.c13
12 files changed, 205 insertions, 30 deletions
diff --git a/ChangeLog b/ChangeLog
index fdde50669b5..8928b2aceeb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
12011-03-17 Paul Eggert <eggert@cs.ucla.edu>
2
3 * Makefile.in (GNULIB_MODULES): Add socklen.
4 * configure.in: Do not check for sys/socket.h, since socklen does that.
5 * m4/socklen.m4: New automatically-generated file, from gnulib.
6
12011-03-13 Paul Eggert <eggert@cs.ucla.edu> 72011-03-13 Paul Eggert <eggert@cs.ucla.edu>
2 8
3 Update for gnulib. 9 Update for gnulib.
diff --git a/Makefile.in b/Makefile.in
index 19267f82121..bc8ae5a9589 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -332,7 +332,7 @@ DOS_gnulib_comp.m4 = gl-comp.m4
332# as per $(gnulib_srcdir)/DEPENDENCIES. 332# as per $(gnulib_srcdir)/DEPENDENCIES.
333GNULIB_MODULES = \ 333GNULIB_MODULES = \
334 crypto/md5 dtoastr filemode getloadavg getopt-gnu \ 334 crypto/md5 dtoastr filemode getloadavg getopt-gnu \
335 ignore-value intprops lstat mktime readlink strftime symlink sys_stat 335 ignore-value intprops lstat mktime readlink socklen strftime symlink sys_stat
336GNULIB_TOOL_FLAGS = \ 336GNULIB_TOOL_FLAGS = \
337 --import --no-changelog --no-vc-files --makefile-name=gnulib.mk 337 --import --no-changelog --no-vc-files --makefile-name=gnulib.mk
338sync-from-gnulib: $(gnulib_srcdir) 338sync-from-gnulib: $(gnulib_srcdir)
diff --git a/aclocal.m4 b/aclocal.m4
index 1536f3b48b5..9bd85a88bbe 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -999,6 +999,7 @@ m4_include([m4/md5.m4])
999m4_include([m4/mktime.m4]) 999m4_include([m4/mktime.m4])
1000m4_include([m4/multiarch.m4]) 1000m4_include([m4/multiarch.m4])
1001m4_include([m4/readlink.m4]) 1001m4_include([m4/readlink.m4])
1002m4_include([m4/socklen.m4])
1002m4_include([m4/st_dm_mode.m4]) 1003m4_include([m4/st_dm_mode.m4])
1003m4_include([m4/stat.m4]) 1004m4_include([m4/stat.m4])
1004m4_include([m4/stdbool.m4]) 1005m4_include([m4/stdbool.m4])
diff --git a/configure b/configure
index 57ecd9d52eb..e51bb0c1a57 100755
--- a/configure
+++ b/configure
@@ -2960,6 +2960,7 @@ as_fn_append ac_header_list " getopt.h"
2960as_fn_append ac_func_list " lstat" 2960as_fn_append ac_func_list " lstat"
2961as_fn_append ac_func_list " alarm" 2961as_fn_append ac_func_list " alarm"
2962as_fn_append ac_func_list " readlink" 2962as_fn_append ac_func_list " readlink"
2963as_fn_append ac_header_list " sys/socket.h"
2963as_fn_append ac_header_list " wchar.h" 2964as_fn_append ac_header_list " wchar.h"
2964as_fn_append ac_header_list " stdint.h" 2965as_fn_append ac_header_list " stdint.h"
2965as_fn_append ac_func_list " tzset" 2966as_fn_append ac_func_list " tzset"
@@ -6141,6 +6142,7 @@ $as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
6141 # Code from module mktime: 6142 # Code from module mktime:
6142 # Code from module multiarch: 6143 # Code from module multiarch:
6143 # Code from module readlink: 6144 # Code from module readlink:
6145 # Code from module socklen:
6144 # Code from module stat: 6146 # Code from module stat:
6145 # Code from module stdbool: 6147 # Code from module stdbool:
6146 # Code from module stddef: 6148 # Code from module stddef:
@@ -7966,18 +7968,6 @@ $as_echo "#define NO_MATHERR 1" >>confdefs.h
7966 7968
7967fi 7969fi
7968 7970
7969for ac_header in sys/socket.h
7970do :
7971 ac_fn_c_check_header_mongrel "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default"
7972if test "x$ac_cv_header_sys_socket_h" = xyes; then :
7973 cat >>confdefs.h <<_ACEOF
7974#define HAVE_SYS_SOCKET_H 1
7975_ACEOF
7976
7977fi
7978
7979done
7980
7981for ac_header in net/if.h 7971for ac_header in net/if.h
7982do : 7972do :
7983 ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "$ac_includes_default 7973 ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "$ac_includes_default
@@ -14784,6 +14774,24 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14784 14774
14785 14775
14786 14776
14777
14778
14779
14780 if test $ac_cv_header_sys_socket_h = no; then
14781 for ac_header in ws2tcpip.h
14782do :
14783 ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default"
14784if test "x$ac_cv_header_ws2tcpip_h" = xyes; then :
14785 cat >>confdefs.h <<_ACEOF
14786#define HAVE_WS2TCPIP_H 1
14787_ACEOF
14788
14789fi
14790
14791done
14792
14793 fi
14794
14787{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 14795{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
14788$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } 14796$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
14789if ${ac_cv_header_stdbool_h+:} false; then : 14797if ${ac_cv_header_stdbool_h+:} false; then :
@@ -16356,6 +16364,70 @@ $as_echo "#define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h
16356 16364
16357 16365
16358 16366
16367 # Code from module socklen:
16368 ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "
16369/* <sys/types.h> is not needed according to POSIX, but the
16370 <sys/socket.h> in i386-unknown-freebsd4.10 and
16371 powerpc-apple-darwin5.5 required it. */
16372#include <sys/types.h>
16373#if HAVE_SYS_SOCKET_H
16374# include <sys/socket.h>
16375#elif HAVE_WS2TCPIP_H
16376# include <ws2tcpip.h>
16377#endif
16378
16379"
16380if test "x$ac_cv_type_socklen_t" = xyes; then :
16381
16382else
16383 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5
16384$as_echo_n "checking for socklen_t equivalent... " >&6; }
16385 if ${gl_cv_socklen_t_equiv+:} false; then :
16386 $as_echo_n "(cached) " >&6
16387else
16388 # Systems have either "struct sockaddr *" or
16389 # "void *" as the second argument to getpeername
16390 gl_cv_socklen_t_equiv=
16391 for arg2 in "struct sockaddr" void; do
16392 for t in int size_t "unsigned int" "long int" "unsigned long int"; do
16393 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16394/* end confdefs.h. */
16395#include <sys/types.h>
16396 #include <sys/socket.h>
16397
16398 int getpeername (int, $arg2 *, $t *);
16399int
16400main ()
16401{
16402$t len;
16403 getpeername (0, 0, &len);
16404 ;
16405 return 0;
16406}
16407_ACEOF
16408if ac_fn_c_try_compile "$LINENO"; then :
16409 gl_cv_socklen_t_equiv="$t"
16410fi
16411rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16412 test "$gl_cv_socklen_t_equiv" != "" && break
16413 done
16414 test "$gl_cv_socklen_t_equiv" != "" && break
16415 done
16416
16417fi
16418
16419 if test "$gl_cv_socklen_t_equiv" = ""; then
16420 as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5
16421 fi
16422 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5
16423$as_echo "$gl_cv_socklen_t_equiv" >&6; }
16424
16425cat >>confdefs.h <<_ACEOF
16426#define socklen_t $gl_cv_socklen_t_equiv
16427_ACEOF
16428
16429fi
16430
16359 # Code from module stat: 16431 # Code from module stat:
16360 16432
16361 16433
diff --git a/configure.in b/configure.in
index 086a7e12d67..11b7ad4db05 100644
--- a/configure.in
+++ b/configure.in
@@ -1265,7 +1265,6 @@ if test $emacs_cv_struct_exception != yes; then
1265 AC_DEFINE(NO_MATHERR, 1, [Define to 1 if you don't have struct exception in math.h.]) 1265 AC_DEFINE(NO_MATHERR, 1, [Define to 1 if you don't have struct exception in math.h.])
1266fi 1266fi
1267 1267
1268AC_CHECK_HEADERS(sys/socket.h)
1269AC_CHECK_HEADERS(net/if.h, , , [AC_INCLUDES_DEFAULT 1268AC_CHECK_HEADERS(net/if.h, , , [AC_INCLUDES_DEFAULT
1270#if HAVE_SYS_SOCKET_H 1269#if HAVE_SYS_SOCKET_H
1271#include <sys/socket.h> 1270#include <sys/socket.h>
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 502b3dbb927..8be57520014 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -24,7 +24,7 @@
24# the same distribution terms as the rest of that program. 24# the same distribution terms as the rest of that program.
25# 25#
26# Generated by gnulib-tool. 26# Generated by gnulib-tool.
27# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink strftime symlink sys_stat 27# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink socklen strftime symlink sys_stat
28 28
29VPATH = @srcdir@ 29VPATH = @srcdir@
30pkgdatadir = $(datadir)/@PACKAGE@ 30pkgdatadir = $(datadir)/@PACKAGE@
@@ -57,14 +57,15 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
57 $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/longlong.m4 \ 57 $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/longlong.m4 \
58 $(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/md5.m4 \ 58 $(top_srcdir)/m4/lstat.m4 $(top_srcdir)/m4/md5.m4 \
59 $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/multiarch.m4 \ 59 $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/multiarch.m4 \
60 $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/st_dm_mode.m4 \ 60 $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/socklen.m4 \
61 $(top_srcdir)/m4/stat.m4 $(top_srcdir)/m4/stdbool.m4 \ 61 $(top_srcdir)/m4/st_dm_mode.m4 $(top_srcdir)/m4/stat.m4 \
62 $(top_srcdir)/m4/stddef_h.m4 $(top_srcdir)/m4/stdint.m4 \ 62 $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
63 $(top_srcdir)/m4/stdlib_h.m4 $(top_srcdir)/m4/strftime.m4 \ 63 $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdlib_h.m4 \
64 $(top_srcdir)/m4/symlink.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ 64 $(top_srcdir)/m4/strftime.m4 $(top_srcdir)/m4/symlink.m4 \
65 $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \ 65 $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/time_h.m4 \
66 $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/unistd_h.m4 \ 66 $(top_srcdir)/m4/time_r.m4 $(top_srcdir)/m4/tm_gmtoff.m4 \
67 $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/configure.in 67 $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/wchar_t.m4 \
68 $(top_srcdir)/configure.in
68am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 69am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
69 $(ACLOCAL_M4) 70 $(ACLOCAL_M4)
70mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs 71mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff --git a/lib/gnulib.mk b/lib/gnulib.mk
index cd6a1d00c15..369b7a48732 100644
--- a/lib/gnulib.mk
+++ b/lib/gnulib.mk
@@ -9,7 +9,7 @@
9# the same distribution terms as the rest of that program. 9# the same distribution terms as the rest of that program.
10# 10#
11# Generated by gnulib-tool. 11# Generated by gnulib-tool.
12# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink strftime symlink sys_stat 12# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink socklen strftime symlink sys_stat
13 13
14 14
15MOSTLYCLEANFILES += core *.stackdump 15MOSTLYCLEANFILES += core *.stackdump
diff --git a/m4/gl-comp.m4 b/m4/gl-comp.m4
index 8bf5a64a5f9..7f8b5a79070 100644
--- a/m4/gl-comp.m4
+++ b/m4/gl-comp.m4
@@ -45,6 +45,7 @@ AC_DEFUN([gl_EARLY],
45 # Code from module mktime: 45 # Code from module mktime:
46 # Code from module multiarch: 46 # Code from module multiarch:
47 # Code from module readlink: 47 # Code from module readlink:
48 # Code from module socklen:
48 # Code from module stat: 49 # Code from module stat:
49 # Code from module stdbool: 50 # Code from module stdbool:
50 # Code from module stddef: 51 # Code from module stddef:
@@ -111,6 +112,8 @@ AC_DEFUN([gl_INIT],
111 # Code from module readlink: 112 # Code from module readlink:
112 gl_FUNC_READLINK 113 gl_FUNC_READLINK
113 gl_UNISTD_MODULE_INDICATOR([readlink]) 114 gl_UNISTD_MODULE_INDICATOR([readlink])
115 # Code from module socklen:
116 gl_TYPE_SOCKLEN_T
114 # Code from module stat: 117 # Code from module stat:
115 gl_FUNC_STAT 118 gl_FUNC_STAT
116 gl_SYS_STAT_MODULE_INDICATOR([stat]) 119 gl_SYS_STAT_MODULE_INDICATOR([stat])
@@ -327,6 +330,7 @@ AC_DEFUN([gl_FILE_LIST], [
327 m4/mktime.m4 330 m4/mktime.m4
328 m4/multiarch.m4 331 m4/multiarch.m4
329 m4/readlink.m4 332 m4/readlink.m4
333 m4/socklen.m4
330 m4/st_dm_mode.m4 334 m4/st_dm_mode.m4
331 m4/stat.m4 335 m4/stat.m4
332 m4/stdbool.m4 336 m4/stdbool.m4
diff --git a/m4/socklen.m4 b/m4/socklen.m4
new file mode 100644
index 00000000000..44751544485
--- /dev/null
+++ b/m4/socklen.m4
@@ -0,0 +1,77 @@
1# socklen.m4 serial 10
2dnl Copyright (C) 2005-2007, 2009-2011 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Albert Chin, Windows fixes from Simon Josefsson.
8
9dnl Check for socklen_t: historically on BSD it is an int, and in
10dnl POSIX 1g it is a type of its own, but some platforms use different
11dnl types for the argument to getsockopt, getpeername, etc.:
12dnl HP-UX 10.20, IRIX 6.5, OSF/1 4.0, Interix 3.5, BeOS.
13dnl So we have to test to find something that will work.
14
15AC_DEFUN([gl_TYPE_SOCKLEN_T],
16 [AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])dnl
17 AC_CHECK_TYPE([socklen_t], ,
18 [AC_MSG_CHECKING([for socklen_t equivalent])
19 AC_CACHE_VAL([gl_cv_socklen_t_equiv],
20 [# Systems have either "struct sockaddr *" or
21 # "void *" as the second argument to getpeername
22 gl_cv_socklen_t_equiv=
23 for arg2 in "struct sockaddr" void; do
24 for t in int size_t "unsigned int" "long int" "unsigned long int"; do
25 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
26 [[#include <sys/types.h>
27 #include <sys/socket.h>
28
29 int getpeername (int, $arg2 *, $t *);]],
30 [[$t len;
31 getpeername (0, 0, &len);]])],
32 [gl_cv_socklen_t_equiv="$t"])
33 test "$gl_cv_socklen_t_equiv" != "" && break
34 done
35 test "$gl_cv_socklen_t_equiv" != "" && break
36 done
37 ])
38 if test "$gl_cv_socklen_t_equiv" = ""; then
39 AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
40 fi
41 AC_MSG_RESULT([$gl_cv_socklen_t_equiv])
42 AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv],
43 [type to use in place of socklen_t if not defined])],
44 [gl_SOCKET_HEADERS])])
45
46dnl On mingw32, socklen_t is in ws2tcpip.h ('int'), so we try to find
47dnl it there too. But on Cygwin, wc2tcpip.h must not be included. Users
48dnl of this module should use the same include pattern as gl_SOCKET_HEADERS.
49dnl When you change this macro, keep also in sync:
50dnl - gl_CHECK_SOCKET_HEADERS,
51dnl - the Include section of modules/socklen.
52AC_DEFUN([gl_SOCKET_HEADERS],
53[
54/* <sys/types.h> is not needed according to POSIX, but the
55 <sys/socket.h> in i386-unknown-freebsd4.10 and
56 powerpc-apple-darwin5.5 required it. */
57#include <sys/types.h>
58#if HAVE_SYS_SOCKET_H
59# include <sys/socket.h>
60#elif HAVE_WS2TCPIP_H
61# include <ws2tcpip.h>
62#endif
63])
64
65dnl Tests for the existence of the header for socket facilities.
66dnl Defines the C macros HAVE_SYS_SOCKET_H, HAVE_WS2TCPIP_H.
67dnl This macro must match gl_SOCKET_HEADERS.
68AC_DEFUN([gl_CHECK_SOCKET_HEADERS],
69 [AC_CHECK_HEADERS_ONCE([sys/socket.h])
70 if test $ac_cv_header_sys_socket_h = no; then
71 dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
72 dnl the check for those headers unconditional; yet cygwin reports
73 dnl that the headers are present but cannot be compiled (since on
74 dnl cygwin, all socket information should come from sys/socket.h).
75 AC_CHECK_HEADERS([ws2tcpip.h])
76 fi
77 ])
diff --git a/src/ChangeLog b/src/ChangeLog
index 744d3ef53f0..0b2a0d44c5f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,13 @@
12011-03-20 Paul Eggert <eggert@cs.ucla.edu> 12011-03-20 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * process.c (Fmake_network_process): Use socklen_t, not int,
4 where POSIX says socklen_t is required in portable programs.
5 This fixes a porting bug on hosts like 64-bit HP-UX, where
6 socklen_t is wider than int (Bug#8277).
7 (Fmake_network_process, server_accept_connection):
8 (wait_reading_process_output, read_process_output):
9 Likewise.
10
3 * process.c: Rename or move locals to avoid shadowing. 11 * process.c: Rename or move locals to avoid shadowing.
4 (list_processes_1, Fmake_network_process): 12 (list_processes_1, Fmake_network_process):
5 (read_process_output_error_handler, exec_sentinel_error_handler): 13 (read_process_output_error_handler, exec_sentinel_error_handler):
diff --git a/src/config.in b/src/config.in
index fbd3ee9338d..b24aacd4e54 100644
--- a/src/config.in
+++ b/src/config.in
@@ -833,6 +833,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
833/* Define to 1 if `vfork' works. */ 833/* Define to 1 if `vfork' works. */
834#undef HAVE_WORKING_VFORK 834#undef HAVE_WORKING_VFORK
835 835
836/* Define to 1 if you have the <ws2tcpip.h> header file. */
837#undef HAVE_WS2TCPIP_H
838
836/* Define to 1 if you want to use version 11 of X windows. Otherwise, Emacs 839/* Define to 1 if you want to use version 11 of X windows. Otherwise, Emacs
837 expects to use version 10. */ 840 expects to use version 10. */
838#undef HAVE_X11 841#undef HAVE_X11
@@ -1209,6 +1212,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
1209/* Define to `unsigned int' if <sys/types.h> does not define. */ 1212/* Define to `unsigned int' if <sys/types.h> does not define. */
1210#undef size_t 1213#undef size_t
1211 1214
1215/* type to use in place of socklen_t if not defined */
1216#undef socklen_t
1217
1212/* Define to any substitute for sys_siglist. */ 1218/* Define to any substitute for sys_siglist. */
1213#undef sys_siglist 1219#undef sys_siglist
1214 1220
diff --git a/src/process.c b/src/process.c
index 5ee731a5bd3..4a7202388bf 100644
--- a/src/process.c
+++ b/src/process.c
@@ -3461,7 +3461,7 @@ usage: (make-network-process &rest ARGS) */)
3461 if (EQ (service, Qt)) 3461 if (EQ (service, Qt))
3462 { 3462 {
3463 struct sockaddr_in sa1; 3463 struct sockaddr_in sa1;
3464 int len1 = sizeof (sa1); 3464 socklen_t len1 = sizeof (sa1);
3465 if (getsockname (s, (struct sockaddr *)&sa1, &len1) == 0) 3465 if (getsockname (s, (struct sockaddr *)&sa1, &len1) == 0)
3466 { 3466 {
3467 ((struct sockaddr_in *)(lres->ai_addr))->sin_port = sa1.sin_port; 3467 ((struct sockaddr_in *)(lres->ai_addr))->sin_port = sa1.sin_port;
@@ -3508,7 +3508,8 @@ usage: (make-network-process &rest ARGS) */)
3508 /* Unlike most other syscalls connect() cannot be called 3508 /* Unlike most other syscalls connect() cannot be called
3509 again. (That would return EALREADY.) The proper way to 3509 again. (That would return EALREADY.) The proper way to
3510 wait for completion is select(). */ 3510 wait for completion is select(). */
3511 int sc, len; 3511 int sc;
3512 socklen_t len;
3512 SELECT_TYPE fdset; 3513 SELECT_TYPE fdset;
3513 retry_select: 3514 retry_select:
3514 FD_ZERO (&fdset); 3515 FD_ZERO (&fdset);
@@ -3581,7 +3582,7 @@ usage: (make-network-process &rest ARGS) */)
3581 if (!is_server) 3582 if (!is_server)
3582 { 3583 {
3583 struct sockaddr_in sa1; 3584 struct sockaddr_in sa1;
3584 int len1 = sizeof (sa1); 3585 socklen_t len1 = sizeof (sa1);
3585 if (getsockname (s, (struct sockaddr *)&sa1, &len1) == 0) 3586 if (getsockname (s, (struct sockaddr *)&sa1, &len1) == 0)
3586 contact = Fplist_put (contact, QClocal, 3587 contact = Fplist_put (contact, QClocal,
3587 conv_sockaddr_to_lisp ((struct sockaddr *)&sa1, len1)); 3588 conv_sockaddr_to_lisp ((struct sockaddr *)&sa1, len1));
@@ -4186,7 +4187,7 @@ server_accept_connection (Lisp_Object server, int channel)
4186 struct sockaddr_un un; 4187 struct sockaddr_un un;
4187#endif 4188#endif
4188 } saddr; 4189 } saddr;
4189 int len = sizeof saddr; 4190 socklen_t len = sizeof saddr;
4190 4191
4191 s = accept (channel, &saddr.sa, &len); 4192 s = accept (channel, &saddr.sa, &len);
4192 4193
@@ -5051,7 +5052,7 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd,
5051 /* getsockopt(,,SO_ERROR,,) is said to hang on some systems. 5052 /* getsockopt(,,SO_ERROR,,) is said to hang on some systems.
5052 So only use it on systems where it is known to work. */ 5053 So only use it on systems where it is known to work. */
5053 { 5054 {
5054 int xlen = sizeof (xerrno); 5055 socklen_t xlen = sizeof (xerrno);
5055 if (getsockopt (channel, SOL_SOCKET, SO_ERROR, &xerrno, &xlen)) 5056 if (getsockopt (channel, SOL_SOCKET, SO_ERROR, &xerrno, &xlen))
5056 xerrno = errno; 5057 xerrno = errno;
5057 } 5058 }
@@ -5163,7 +5164,7 @@ read_process_output (Lisp_Object proc, register int channel)
5163 /* We have a working select, so proc_buffered_char is always -1. */ 5164 /* We have a working select, so proc_buffered_char is always -1. */
5164 if (DATAGRAM_CHAN_P (channel)) 5165 if (DATAGRAM_CHAN_P (channel))
5165 { 5166 {
5166 int len = datagram_address[channel].len; 5167 socklen_t len = datagram_address[channel].len;
5167 nbytes = recvfrom (channel, chars + carryover, readmax, 5168 nbytes = recvfrom (channel, chars + carryover, readmax,
5168 0, datagram_address[channel].sa, &len); 5169 0, datagram_address[channel].sa, &len);
5169 } 5170 }