2013-05-23 Pedro Alves <palves@redhat.com>
+ * common/filestuff.c [USE_WIN32API]: Define HAVE_SOCKETS.
+ [HAVE_SYS_SOCKET_H]: Define HAVE_SOCKETS.
+ (socket_mark_cloexec, gdb_socketpair_cloexec, gdb_socket_cloexec):
+ Only define if HAVE_SOCKETS is defined.
+ * configure.ac: Check for sys/socket.h.
+ * config.in, configure: Regenerate.
+
+2013-05-23 Pedro Alves <palves@redhat.com>
+
* dwarf2read.c (create_dwp_hash_table, create_dwo_in_dwp)
(open_and_init_dwp_file): Use %s/pulongest instead of %u for
printing uint32_t variables.
#ifdef USE_WIN32API
#include <winsock2.h>
#include <windows.h>
-#else
+#define HAVE_SOCKETS 1
+#elif defined HAVE_SYS_SOCKET_H
#include <sys/socket.h>
/* Define HAVE_F_GETFD if we plan to use F_GETFD. */
#define HAVE_F_GETFD F_GETFD
+#define HAVE_SOCKETS 1
#endif
#ifdef HAVE_SYS_RESOURCE_H
mark_cloexec (fd);
}
+#ifdef HAVE_SOCKETS
+
/* Like maybe_mark_cloexec, but for callers that use SOCK_CLOEXEC. */
static void
mark_cloexec (fd);
}
+#endif
+
\f
/* See filestuff.h. */
return result;
}
+#ifdef HAVE_SOCKETS
/* See filestuff.h. */
int
return result;
}
+#endif
/* See filestuff.h. */
/* Define to 1 if you have the <sys/select.h> header file. */
#undef HAVE_SYS_SELECT_H
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
fi
# elf_hp.h is for HP/UX 64-bit shared library support.
-for ac_header in nlist.h machine/reg.h poll.h sys/poll.h proc_service.h \
+for ac_header in nlist.h machine/reg.h poll.h sys/poll.h sys/socket.h proc_service.h \
thread_db.h signal.h stddef.h \
stdlib.h string.h memory.h strings.h sys/fault.h \
sys/file.h sys/filio.h sys/ioctl.h sys/param.h \
AC_HEADER_DIRENT
AC_HEADER_STDC
# elf_hp.h is for HP/UX 64-bit shared library support.
-AC_CHECK_HEADERS([nlist.h machine/reg.h poll.h sys/poll.h proc_service.h \
+AC_CHECK_HEADERS([nlist.h machine/reg.h poll.h sys/poll.h sys/socket.h proc_service.h \
thread_db.h signal.h stddef.h \
stdlib.h string.h memory.h strings.h sys/fault.h \
sys/file.h sys/filio.h sys/ioctl.h sys/param.h \