aboutsummaryrefslogtreecommitdiff
path: root/gdb/common
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/common')
-rw-r--r--gdb/common/filestuff.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gdb/common/filestuff.c b/gdb/common/filestuff.c
index e7af3a5..daf96d9 100644
--- a/gdb/common/filestuff.c
+++ b/gdb/common/filestuff.c
@@ -34,10 +34,12 @@
#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
@@ -277,6 +279,8 @@ maybe_mark_cloexec (int fd)
mark_cloexec (fd);
}
+#ifdef HAVE_SOCKETS
+
/* Like maybe_mark_cloexec, but for callers that use SOCK_CLOEXEC. */
static void
@@ -286,6 +290,8 @@ socket_mark_cloexec (int fd)
mark_cloexec (fd);
}
+#endif
+
/* See filestuff.h. */
@@ -335,6 +341,7 @@ gdb_fopen_cloexec (const char *filename, const char *opentype)
return result;
}
+#ifdef HAVE_SOCKETS
/* See filestuff.h. */
int
@@ -367,6 +374,7 @@ gdb_socket_cloexec (int namespace, int style, int protocol)
return result;
}
+#endif
/* See filestuff.h. */