From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1521) id 2EC5C3856975; Mon, 16 Jan 2023 09:47:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2EC5C3856975 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673862451; bh=0DHFR3gPb2yCeP8ak0ds1Mtj9Skq7T0EL8f4XDYKvTk=; h=From:To:Subject:Date:From; b=NYpR38TkvrjPW/7zMKqKB7wXVKpmAM6BjSq3Fq6oMYbo5J8g8fILjmnsyRkaKjDQE yZj6b48tJlavGSpl3e71gCB0gbCyyD6T9nZiLJ11eFAdRNi61If8NX9ODkpLb+Mlda pqGo8taWMZ7913mTeTZerFT4AO8Tp4ckgrn63xGo= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Frysinger To: gdb-cvs@sourceware.org Subject: [binutils-gdb] sim: formally assume unistd.h always exists (via gnulib) X-Act-Checkin: binutils-gdb X-Git-Author: Mike Frysinger X-Git-Refname: refs/heads/master X-Git-Oldrev: e9bf6a4a20798cd495b2833112482ebc55bc5982 X-Git-Newrev: 4cd7de783bc72cc1f44fe989e7a0c7feb10532d5 Message-Id: <20230116094731.2EC5C3856975@sourceware.org> Date: Mon, 16 Jan 2023 09:47:31 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D4cd7de783bc7= 2cc1f44fe989e7a0c7feb10532d5 commit 4cd7de783bc72cc1f44fe989e7a0c7feb10532d5 Author: Mike Frysinger Date: Mon Jan 16 04:35:48 2023 -0500 sim: formally assume unistd.h always exists (via gnulib) =20 We have many uses of unistd.h that are unprotected by HAVE_UNISTD_H, so this is more formalizing the reality that we require this header. Since we switched to gnulib, it guarantees that a unistd.h exists for us to include, so we're doubly OK. Diff: --- sim/arm/armos.c | 3 --- sim/common/callback.c | 2 -- sim/common/dv-pal.c | 2 -- sim/common/dv-sockser.c | 2 -- sim/common/nrun.c | 2 -- sim/common/sim-io.c | 2 -- sim/common/sim-memopt.c | 2 -- sim/common/syscall.c | 2 -- sim/configure | 7 ++----- sim/cr16/simops.c | 2 -- sim/cris/dv-rv.c | 2 -- sim/cris/rvdummy.c | 3 --- sim/cris/traps.c | 2 -- sim/d10v/simops.c | 2 -- sim/m4/sim_ac_platform.m4 | 3 ++- sim/m68hc11/emulos.c | 2 -- sim/mn10300/op_utils.c | 2 -- sim/ppc/emul_bugapi.c | 2 -- sim/ppc/emul_chirp.c | 2 -- sim/ppc/emul_netbsd.c | 2 -- sim/ppc/emul_unix.c | 2 -- sim/ppc/hw_com.c | 2 -- sim/ppc/hw_disk.c | 3 --- sim/ppc/hw_pal.c | 2 -- sim/ppc/main.c | 2 -- sim/ppc/mon.c | 2 -- sim/ppc/table.c | 2 -- sim/rl78/main.c | 2 -- sim/rx/main.c | 2 -- sim/sh/interp.c | 2 -- sim/v850/simops.c | 2 -- 31 files changed, 4 insertions(+), 67 deletions(-) diff --git a/sim/arm/armos.c b/sim/arm/armos.c index a8ef7e4a82d..9cf238ac8e2 100644 --- a/sim/arm/armos.c +++ b/sim/arm/armos.c @@ -31,10 +31,7 @@ #include #include #include - -#ifdef HAVE_UNISTD_H #include /* For SEEK_SET etc. */ -#endif =20 #include "armdefs.h" #include "armos.h" diff --git a/sim/common/callback.c b/sim/common/callback.c index ff14a111b65..306e95e866d 100644 --- a/sim/common/callback.c +++ b/sim/common/callback.c @@ -34,9 +34,7 @@ #include #include #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include =20 diff --git a/sim/common/dv-pal.c b/sim/common/dv-pal.c index 56692c1dcb8..25f8c683e29 100644 --- a/sim/common/dv-pal.c +++ b/sim/common/dv-pal.c @@ -24,9 +24,7 @@ =20 #include #include -#ifdef HAVE_UNISTD_H #include -#endif =20 #include "sim-main.h" #include "hw-main.h" diff --git a/sim/common/dv-sockser.c b/sim/common/dv-sockser.c index fba2775f2e8..698cab83920 100644 --- a/sim/common/dv-sockser.c +++ b/sim/common/dv-sockser.c @@ -29,9 +29,7 @@ along with this program. If not, see . */ #include #include #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include #include diff --git a/sim/common/nrun.c b/sim/common/nrun.c index 4c011627bb8..2ebf8a12716 100644 --- a/sim/common/nrun.c +++ b/sim/common/nrun.c @@ -21,10 +21,8 @@ along with this program. If not, see . */ #include /* For strsignal. */ #include -#ifdef HAVE_UNISTD_H /* For chdir. */ #include -#endif =20 #include "bfd.h" #include "environ.h" diff --git a/sim/common/sim-io.c b/sim/common/sim-io.c index f126c9622ae..fc0d42faf11 100644 --- a/sim/common/sim-io.c +++ b/sim/common/sim-io.c @@ -29,9 +29,7 @@ #include #include #include -#if HAVE_UNISTD_H #include -#endif =20 #undef open =20 diff --git a/sim/common/sim-memopt.c b/sim/common/sim-memopt.c index 2d1b96b7889..2e5016c52ab 100644 --- a/sim/common/sim-memopt.c +++ b/sim/common/sim-memopt.c @@ -26,9 +26,7 @@ along with this program. If not, see . */ #endif #include #include -#ifdef HAVE_UNISTD_H #include -#endif #ifdef HAVE_SYS_MMAN_H #include #endif diff --git a/sim/common/syscall.c b/sim/common/syscall.c index f65f616a231..96033db84c3 100644 --- a/sim/common/syscall.c +++ b/sim/common/syscall.c @@ -33,9 +33,7 @@ #include #include #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include =20 diff --git a/sim/configure b/sim/configure index c1333fc9880..104751477c7 100755 --- a/sim/configure +++ b/sim/configure @@ -2797,7 +2797,6 @@ as_fn_append ac_header_list " dlfcn.h" as_fn_append ac_header_list " fcntl.h" as_fn_append ac_header_list " fpu_control.h" as_fn_append ac_header_list " termios.h" -as_fn_append ac_header_list " unistd.h" as_fn_append ac_header_list " utime.h" as_fn_append ac_header_list " linux/if_tun.h" as_fn_append ac_header_list " linux/mii.h" @@ -5265,8 +5264,6 @@ done =20 =20 =20 - - =20 =20 =20 @@ -12289,7 +12286,7 @@ else lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 lt_status=3D$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12292 "configure" +#line 12289 "configure" #include "confdefs.h" =20 #if HAVE_DLFCN_H @@ -12395,7 +12392,7 @@ else lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 lt_status=3D$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12398 "configure" +#line 12395 "configure" #include "confdefs.h" =20 #if HAVE_DLFCN_H diff --git a/sim/cr16/simops.c b/sim/cr16/simops.c index e652b8153f8..73420a7e0c6 100644 --- a/sim/cr16/simops.c +++ b/sim/cr16/simops.c @@ -24,9 +24,7 @@ #include #include #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include #include diff --git a/sim/cris/dv-rv.c b/sim/cris/dv-rv.c index 6caa4dd3443..9142b88f7d7 100644 --- a/sim/cris/dv-rv.c +++ b/sim/cris/dv-rv.c @@ -29,9 +29,7 @@ #include #include #include -#ifdef HAVE_UNISTD_H #include -#endif #include #ifdef HAVE_SYS_TYPES_H #include diff --git a/sim/cris/rvdummy.c b/sim/cris/rvdummy.c index a263ee3c0ff..91a7ddc8a8d 100644 --- a/sim/cris/rvdummy.c +++ b/sim/cris/rvdummy.c @@ -36,10 +36,7 @@ main (int argc, char *argv[]) #include "libiberty.h" =20 #include - -#ifdef HAVE_UNISTD_H #include -#endif #include #include #ifdef HAVE_SYS_TYPES_H diff --git a/sim/cris/traps.c b/sim/cris/traps.c index afcb3480840..f5f169f1c81 100644 --- a/sim/cris/traps.c +++ b/sim/cris/traps.c @@ -32,9 +32,7 @@ along with this program. If not, see . */ #include #include #include -#ifdef HAVE_UNISTD_H #include -#endif #ifdef HAVE_FCNTL_H #include #endif diff --git a/sim/d10v/simops.c b/sim/d10v/simops.c index 96ed29f6abe..bc7806cc278 100644 --- a/sim/d10v/simops.c +++ b/sim/d10v/simops.c @@ -5,9 +5,7 @@ #include #include #include -#ifdef HAVE_UNISTD_H #include -#endif #include =20 #include "bfd.h" diff --git a/sim/m4/sim_ac_platform.m4 b/sim/m4/sim_ac_platform.m4 index 6356a80e16f..665c1bd7866 100644 --- a/sim/m4/sim_ac_platform.m4 +++ b/sim/m4/sim_ac_platform.m4 @@ -18,12 +18,12 @@ AC_DEFUN([SIM_AC_PLATFORM], [dnl dnl Check for common headers. dnl NB: You can assume C11 headers exist. +dnl NB: We use gnulib from ../gnulib/, so we don't probe headers it provid= es. AC_CHECK_HEADERS_ONCE(m4_flatten([ dlfcn.h fcntl.h fpu_control.h termios.h - unistd.h utime.h linux/if_tun.h linux/mii.h @@ -46,6 +46,7 @@ AC_CHECK_HEADERS_ONCE(m4_flatten([ ])) AC_HEADER_DIRENT =20 +dnl NB: We use gnulib from ../gnulib/, so we don't probe functions it prov= ides. AC_CHECK_FUNCS_ONCE(m4_flatten([ __setfpucw access diff --git a/sim/m68hc11/emulos.c b/sim/m68hc11/emulos.c index 50d27534634..fcf9cc1b5e5 100644 --- a/sim/m68hc11/emulos.c +++ b/sim/m68hc11/emulos.c @@ -21,9 +21,7 @@ along with this program. If not, see . */ #include "defs.h" =20 #include "sim-main.h" -#ifdef HAVE_UNISTD_H #include -#endif =20 #include "m68hc11-sim.h" =20 diff --git a/sim/mn10300/op_utils.c b/sim/mn10300/op_utils.c index b29b803d8e7..7e035f43259 100644 --- a/sim/mn10300/op_utils.c +++ b/sim/mn10300/op_utils.c @@ -3,9 +3,7 @@ =20 #include #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include #include diff --git a/sim/ppc/emul_bugapi.c b/sim/ppc/emul_bugapi.c index f4eed443d8b..067e40691e2 100644 --- a/sim/ppc/emul_bugapi.c +++ b/sim/ppc/emul_bugapi.c @@ -27,9 +27,7 @@ #include "emul_generic.h" #include "emul_bugapi.h" =20 -#ifdef HAVE_UNISTD_H #include -#endif #include #include =20 diff --git a/sim/ppc/emul_chirp.c b/sim/ppc/emul_chirp.c index 116f3732ac7..c064a28a7c6 100644 --- a/sim/ppc/emul_chirp.c +++ b/sim/ppc/emul_chirp.c @@ -28,9 +28,7 @@ #include "emul_chirp.h" =20 #include -#ifdef HAVE_UNISTD_H #include -#endif =20 #ifndef STATIC_INLINE_EMUL_CHIRP #define STATIC_INLINE_EMUL_CHIRP STATIC_INLINE diff --git a/sim/ppc/emul_netbsd.c b/sim/ppc/emul_netbsd.c index a8bfd27610e..51f8e98ae32 100644 --- a/sim/ppc/emul_netbsd.c +++ b/sim/ppc/emul_netbsd.c @@ -72,10 +72,8 @@ int getrusage(); # endif #endif =20 -#ifdef HAVE_UNISTD_H #undef MAXPATHLEN /* sys/param.h might define this also */ #include -#endif =20 #include =20 diff --git a/sim/ppc/emul_unix.c b/sim/ppc/emul_unix.c index 1d8b7814ffc..2872d236bf3 100644 --- a/sim/ppc/emul_unix.c +++ b/sim/ppc/emul_unix.c @@ -115,10 +115,8 @@ int getrusage(); # endif #endif =20 -#ifdef HAVE_UNISTD_H #undef MAXPATHLEN /* sys/param.h might define this also */ #include -#endif =20 #include #include diff --git a/sim/ppc/hw_com.c b/sim/ppc/hw_com.c index 4ffd73203f4..768d1ca6a3c 100644 --- a/sim/ppc/hw_com.c +++ b/sim/ppc/hw_com.c @@ -28,9 +28,7 @@ #include "device_table.h" =20 #include -#ifdef HAVE_UNISTD_H #include -#endif #include =20 /* DEVICE diff --git a/sim/ppc/hw_disk.c b/sim/ppc/hw_disk.c index 3a825202784..54a11f62827 100644 --- a/sim/ppc/hw_disk.c +++ b/sim/ppc/hw_disk.c @@ -26,10 +26,7 @@ #include "pk.h" =20 #include - -#ifdef HAVE_UNISTD_H #include -#endif =20 #ifndef SEEK_SET #define SEEK_SET 0 diff --git a/sim/ppc/hw_pal.c b/sim/ppc/hw_pal.c index 8b077099369..f8585084b37 100644 --- a/sim/ppc/hw_pal.c +++ b/sim/ppc/hw_pal.c @@ -30,9 +30,7 @@ #include "cpu.h" =20 #include -#ifdef HAVE_UNISTD_H #include -#endif #include =20 =20 diff --git a/sim/ppc/main.c b/sim/ppc/main.c index 83b629ec14a..aa1c85e0af9 100644 --- a/sim/ppc/main.c +++ b/sim/ppc/main.c @@ -36,9 +36,7 @@ #include "sim/sim.h" =20 #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include =20 diff --git a/sim/ppc/mon.c b/sim/ppc/mon.c index 4e29ec99879..8ab42af8458 100644 --- a/sim/ppc/mon.c +++ b/sim/ppc/mon.c @@ -26,9 +26,7 @@ #include =20 #include -#ifdef HAVE_UNISTD_H #include -#endif #include #ifdef HAVE_SYS_TYPES_H #include diff --git a/sim/ppc/table.c b/sim/ppc/table.c index 6399bdaddcb..da169675958 100644 --- a/sim/ppc/table.c +++ b/sim/ppc/table.c @@ -29,9 +29,7 @@ #include "lf.h" #include "table.h" =20 -#ifdef HAVE_UNISTD_H #include -#endif #include =20 typedef struct _open_table open_table; diff --git a/sim/rl78/main.c b/sim/rl78/main.c index 7c250f7172c..1eafa3392ea 100644 --- a/sim/rl78/main.c +++ b/sim/rl78/main.c @@ -25,9 +25,7 @@ #include #include #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include #include diff --git a/sim/rx/main.c b/sim/rx/main.c index e404446dd70..13d0c473e74 100644 --- a/sim/rx/main.c +++ b/sim/rx/main.c @@ -24,9 +24,7 @@ along with this program. If not, see . */ #include #include #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include #include diff --git a/sim/sh/interp.c b/sim/sh/interp.c index 5a90cd2cf74..5e0e8c47569 100644 --- a/sim/sh/interp.c +++ b/sim/sh/interp.c @@ -25,9 +25,7 @@ #include #include #include -#ifdef HAVE_UNISTD_H #include -#endif #ifdef HAVE_MMAP #include # ifndef MAP_FAILED diff --git a/sim/v850/simops.c b/sim/v850/simops.c index 69db8aaaa53..326745efcb2 100644 --- a/sim/v850/simops.c +++ b/sim/v850/simops.c @@ -12,9 +12,7 @@ #include #endif #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include