[7/10] RFC: don't check for unistd.h

Tom Tromey
2012-11-15T19:29:33Z

unistd.h is also apparently available universally.

Tom

* configure: Rebuild.
* configure.ac: Don't check for unistd.h.
* defs.h: Update.
* tracepoint.c: Update.
* utils.c: Update.

* configure: Rebuild.
* configure.ac: Don't check for unistd.h.
* event-loop.c: Update.
* gdbreplay.c: Update.
* remote-utils.c: Update.
* server.c: Update.
---
gdb/defs.h | 2 --
gdb/gdbserver/configure | 2 +-
gdb/gdbserver/configure.ac | 1 -
gdb/gdbserver/event-loop.c | 2 --
gdb/gdbserver/gdbreplay.c | 2 --
gdb/gdbserver/remote-utils.c | 2 --
gdb/gdbserver/server.c | 2 --
gdb/tracepoint.c | 2 --
gdb/utils.c | 2 +-
9 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/gdb/defs.h b/gdb/defs.h
index 6d49d8f..3e54e27 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -51,9 +51,7 @@

#include <stddef.h>

-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif

#include <fcntl.h>

diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index a5d636a..5e7545e 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -51,7 +51,6 @@ ACX_CONFIGURE_DIR(["../gnulib"], ["build-gnulib-gdbserver"])

AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h dnl
proc_service.h sys/procfs.h thread_db.h linux/elf.h dnl
- unistd.h dnl
errno.h fcntl.h sys/file.h malloc.h dnl
sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl
netinet/tcp.h arpa/inet.h sys/wait.h wait.h sys/un.h)
diff --git a/gdb/gdbserver/event-loop.c b/gdb/gdbserver/event-loop.c
index bcc9f1b..1ec946b 100644
--- a/gdb/gdbserver/event-loop.c
+++ b/gdb/gdbserver/event-loop.c
@@ -34,9 +34,7 @@
#include <errno.h>
#endif

-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif

typedef struct gdb_event gdb_event;
typedef int (event_handler_func) (gdb_fildes_t);
diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c
index 22ae9e4..42ccf95 100644
--- a/gdb/gdbserver/gdbreplay.c
+++ b/gdb/gdbserver/gdbreplay.c
@@ -35,9 +35,7 @@
#endif
#include <stdlib.h>
#include <string.h>
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index 6f5d7ef..942a5c1 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -48,9 +48,7 @@
#include <fcntl.h>
#endif
#include <sys/time.h>
-#if HAVE_UNISTD_H
#include <unistd.h>
-#endif
#if HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index b08f1ba..427f40d 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -21,9 +21,7 @@
#include "gdbthread.h"
#include "agent.h"

-#if HAVE_UNISTD_H
#include <unistd.h>
-#endif
#include <signal.h>
#include "gdb_wait.h"

diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 57e001b..36efe83 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -61,9 +61,7 @@
/* readline defines this. */
#undef savestring

-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif

#ifndef O_LARGEFILE
#define O_LARGEFILE 0
diff --git a/gdb/utils.c b/gdb/utils.c
index 8e781fc..316cbd6 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -3225,7 +3225,7 @@ gdb_realpath (const char *filename)
pathconf()) making it impossible to pass a correctly sized buffer
to realpath() (it could always overflow). On those systems, we
skip this. */
-#if defined (HAVE_REALPATH) && defined (HAVE_UNISTD_H) && defined(HAVE_ALLOCA)
+#if defined (HAVE_REALPATH) && defined(HAVE_ALLOCA)
{
/* Find out the max path size. */
long path_max = pathconf ("/", _PC_PATH_MAX);
--
1.7.7.6