diff options
author | Michael Meissner <gnu@the-meissners.org> | 1996-05-24 19:05:17 +0000 |
---|---|---|
committer | Michael Meissner <gnu@the-meissners.org> | 1996-05-24 19:05:17 +0000 |
commit | 0c18e3f002e5029c8b0f05478ee9e13d1ad5a645 (patch) | |
tree | c3a640f6a45e7495f27ddc692dd5b269acb42665 /sim | |
parent | 0293d5b019a65b8fb642554d0a8716bbba5d64c7 (diff) | |
download | gdb-0c18e3f002e5029c8b0f05478ee9e13d1ad5a645.zip gdb-0c18e3f002e5029c8b0f05478ee9e13d1ad5a645.tar.gz gdb-0c18e3f002e5029c8b0f05478ee9e13d1ad5a645.tar.bz2 |
More changes for GO32 canadian cross builds
Diffstat (limited to 'sim')
-rw-r--r-- | sim/ppc/ChangeLog | 10 | ||||
-rw-r--r-- | sim/ppc/config.in | 85 | ||||
-rwxr-xr-x | sim/ppc/configure | 238 | ||||
-rw-r--r-- | sim/ppc/configure.in | 7 | ||||
-rw-r--r-- | sim/ppc/emul_netbsd.c | 108 |
5 files changed, 402 insertions, 46 deletions
diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog index 6b37e4c..df729b3 100644 --- a/sim/ppc/ChangeLog +++ b/sim/ppc/ChangeLog @@ -1,5 +1,15 @@ Fri May 24 10:08:10 1996 Michael Meissner <meissner@tiktok.cygnus.com> + * configure.in (AC_STRUCT_ST_{BLKSIZE,BLOCKS,RDEV}): Use these + macros to determine whether or not the appropriate st_<xxx> fields + exist in the stat structure. + (AC_CHECK_FUNCS): Check for all unix system calls used, except for + the real basic ones like open, read, write, etc. + * config{.in,ure}: Regenerate. + + * emul_netbsd.c: Add support for missing system calls, and/or + missing stat fields. + * hw_pal.c (WITH_STDIO): Redefine if O_NDELAY, F_GETFL, or F_SETFL are not defined. (scan_hw_pal): Do not cause syntax error if O_NDELAY, F_GETFL, or diff --git a/sim/ppc/config.in b/sim/ppc/config.in index e081c74..eb713cd 100644 --- a/sim/ppc/config.in +++ b/sim/ppc/config.in @@ -1,15 +1,88 @@ /* config.in. Generated automatically from configure.in by autoheader. */ -#ifndef CONFIG_H -#define CONFIG_H +/* Define if your struct stat has st_blksize. */ +#undef HAVE_ST_BLKSIZE + +/* Define if your struct stat has st_blocks. */ +#undef HAVE_ST_BLOCKS + +/* Define if your struct stat has st_rdev. */ +#undef HAVE_ST_RDEV + +/* Define if your struct tm has tm_zone. */ +#undef HAVE_TM_ZONE + +/* Define if you don't have tm_zone but do have the external array + tzname. */ +#undef HAVE_TZNAME + +/* Define if your <sys/time.h> declares struct tm. */ +#undef TM_IN_SYS_TIME /* Define if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN +/* Define if you have the dup function. */ +#undef HAVE_DUP + +/* Define if you have the dup2 function. */ +#undef HAVE_DUP2 + +/* Define if you have the fcntl function. */ +#undef HAVE_FCNTL + +/* Define if you have the fstat function. */ +#undef HAVE_FSTAT + +/* Define if you have the fstatfs function. */ +#undef HAVE_FSTATFS + +/* Define if you have the getdirentries function. */ +#undef HAVE_GETDIRENTRIES + +/* Define if you have the getegid function. */ +#undef HAVE_GETEGID + +/* Define if you have the geteuid function. */ +#undef HAVE_GETEUID + +/* Define if you have the getgid function. */ +#undef HAVE_GETGID + +/* Define if you have the getpid function. */ +#undef HAVE_GETPID + /* Define if you have the getrusage function. */ #undef HAVE_GETRUSAGE +/* Define if you have the gettimeofday function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define if you have the getuid function. */ +#undef HAVE_GETUID + +/* Define if you have the ioctl function. */ +#undef HAVE_IOCTL + +/* Define if you have the kill function. */ +#undef HAVE_KILL + +/* Define if you have the lseek function. */ +#undef HAVE_LSEEK + +/* Define if you have the lstat function. */ +#undef HAVE_LSTAT + +/* Define if you have the sigprocmask function. */ +#undef HAVE_SIGPROCMASK + +/* Define if you have the stat function. */ +#undef HAVE_STAT + +/* Define if you have the umask function. */ +#undef HAVE_UMASK + /* Define if you have the <dirent.h> header file. */ #undef HAVE_DIRENT_H @@ -28,6 +101,12 @@ /* Define if you have the <sys/dir.h> header file. */ #undef HAVE_SYS_DIR_H +/* Define if you have the <sys/ioctl.h> header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define if you have the <sys/mount.h> header file. */ +#undef HAVE_SYS_MOUNT_H + /* Define if you have the <sys/ndir.h> header file. */ #undef HAVE_SYS_NDIR_H @@ -48,5 +127,3 @@ /* Define if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H - -#endif diff --git a/sim/ppc/configure b/sim/ppc/configure index 703a51c..ed023a7 100755 --- a/sim/ppc/configure +++ b/sim/ppc/configure @@ -1050,7 +1050,7 @@ if test $ac_cv_c_bigendian = yes; then EOF fi - echo ac_cv_c_bigendian = $ac_cv_c_bigendian + if test $ac_cv_c_bigendian = yes; then sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN" else @@ -1495,14 +1495,217 @@ fi -for ac_func in getrusage +echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1504 "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <sys/stat.h> +int main() { return 0; } +int t() { +struct stat s; s.st_blksize; +; return 0; } +EOF +if { (eval echo configure:1513: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_struct_st_blksize=yes +else + rm -rf conftest* + ac_cv_struct_st_blksize=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6 +if test $ac_cv_struct_st_blksize = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_ST_BLKSIZE 1 +EOF + +fi + +echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1537 "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <sys/stat.h> +int main() { return 0; } +int t() { +struct stat s; s.st_blocks; +; return 0; } +EOF +if { (eval echo configure:1546: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_struct_st_blocks=yes +else + rm -rf conftest* + ac_cv_struct_st_blocks=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_struct_st_blocks" 1>&6 +if test $ac_cv_struct_st_blocks = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_ST_BLOCKS 1 +EOF + +else + LIBOBJS="$LIBOBJS fileblocks.o" +fi + +echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1572 "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <sys/stat.h> +int main() { return 0; } +int t() { +struct stat s; s.st_rdev; +; return 0; } +EOF +if { (eval echo configure:1581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_struct_st_rdev=yes +else + rm -rf conftest* + ac_cv_struct_st_rdev=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_struct_st_rdev" 1>&6 +if test $ac_cv_struct_st_rdev = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_ST_RDEV 1 +EOF + +fi + +echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1605 "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <time.h> +int main() { return 0; } +int t() { +struct tm *tp; tp->tm_sec; +; return 0; } +EOF +if { (eval echo configure:1614: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_struct_tm=time.h +else + rm -rf conftest* + ac_cv_struct_tm=sys/time.h +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_struct_tm" 1>&6 +if test $ac_cv_struct_tm = sys/time.h; then + cat >> confdefs.h <<\EOF +#define TM_IN_SYS_TIME 1 +EOF + +fi + +echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1638 "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <$ac_cv_struct_tm> +int main() { return 0; } +int t() { +struct tm tm; tm.tm_zone; +; return 0; } +EOF +if { (eval echo configure:1647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_struct_tm_zone=yes +else + rm -rf conftest* + ac_cv_struct_tm_zone=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6 +if test "$ac_cv_struct_tm_zone" = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_TM_ZONE 1 +EOF + +else + echo $ac_n "checking for tzname""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1670 "configure" +#include "confdefs.h" +#include <time.h> +#ifndef tzname /* For SGI. */ +extern char *tzname[]; /* RS6000 and others reject char **tzname. */ +#endif +int main() { return 0; } +int t() { +atoi(*tzname); +; return 0; } +EOF +if { (eval echo configure:1681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + rm -rf conftest* + ac_cv_var_tzname=yes +else + rm -rf conftest* + ac_cv_var_tzname=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_var_tzname" 1>&6 + if test $ac_cv_var_tzname = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_TZNAME 1 +EOF + + fi +fi + + +for ac_func in dup dup2 fcntl fstat fstatfs getdirentries getegid geteuid getgid getpid getrusage gettimeofday getuid ioctl kill lseek lstat sigprocmask stat umask do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1506 "configure" +#line 1709 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1524,7 +1727,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1562,13 +1765,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 1566 "configure" +#line 1769 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1572: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1775: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1577,13 +1780,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 1581 "configure" +#line 1784 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1587: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1790: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1603,7 +1806,7 @@ else fi echo "$ac_t""$CPP" 1>&6 -for ac_hdr in string.h strings.h stdlib.h time.h sys/mount.h sys/types.h sys/time.h sys/times.h unistd.h sys/resource.h +for ac_hdr in string.h strings.h stdlib.h time.h sys/mount.h sys/types.h sys/time.h sys/times.h unistd.h sys/resource.h sys/ioctl.h do ac_safe=`echo "$ac_hdr" | tr './\055' '___'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -1611,12 +1814,12 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1615 "configure" +#line 1818 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1620: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1823: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1649,7 +1852,7 @@ if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1653 "configure" +#line 1856 "configure" #include "confdefs.h" #include <sys/types.h> #include <$ac_hdr> @@ -1658,7 +1861,7 @@ int t() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:1662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1865: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -1689,7 +1892,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <<EOF -#line 1693 "configure" +#line 1896 "configure" #include "confdefs.h" int main() { return 0; } @@ -1697,7 +1900,7 @@ int t() { opendir() ; return 0; } EOF -if { (eval echo configure:1701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1724,7 +1927,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <<EOF -#line 1728 "configure" +#line 1931 "configure" #include "confdefs.h" int main() { return 0; } @@ -1732,7 +1935,7 @@ int t() { opendir() ; return 0; } EOF -if { (eval echo configure:1736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1917,6 +2120,7 @@ s%@sim_model@%$sim_model%g s%@sim_default_model@%$sim_default_model%g s%@sim_model_issue@%$sim_model_issue%g s%@sim_stdio@%$sim_stdio%g +s%@LIBOBJS@%$LIBOBJS%g s%@CPP@%$CPP%g CEOF diff --git a/sim/ppc/configure.in b/sim/ppc/configure.in index 86ebdad..f81a2cc 100644 --- a/sim/ppc/configure.in +++ b/sim/ppc/configure.in @@ -438,7 +438,12 @@ AC_SUBST(sim_default_model) AC_SUBST(sim_model_issue) AC_SUBST(sim_stdio) -AC_CHECK_FUNCS(getrusage) +AC_STRUCT_ST_BLKSIZE +AC_STRUCT_ST_BLOCKS +AC_STRUCT_ST_RDEV +AC_STRUCT_TIMEZONE + +AC_CHECK_FUNCS(dup dup2 fcntl fstat fstatfs getdirentries getegid geteuid getgid getpid getrusage gettimeofday getuid ioctl kill lseek lstat sigprocmask stat umask) AC_CHECK_HEADERS(string.h strings.h stdlib.h time.h sys/mount.h sys/types.h sys/time.h sys/times.h unistd.h sys/resource.h sys/ioctl.h) AC_HEADER_DIRENT diff --git a/sim/ppc/emul_netbsd.c b/sim/ppc/emul_netbsd.c index 9a45589..cc6fe89 100644 --- a/sim/ppc/emul_netbsd.c +++ b/sim/ppc/emul_netbsd.c @@ -95,6 +95,11 @@ int getrusage(); #include <sys/syscall.h> /* FIXME - should not be including this one */ #include <sys/sysctl.h> extern int getdirentries(int fd, char *buf, int nbytes, long *basep); +#else + +/* If this is not netbsd, don't allow fstatfs or getdirentries at this time */ +#undef HAVE_FSTATFS +#undef HAVE_GETDIRENTRIES #endif #if (BSD < 199306) /* here BSD as just a bug */ @@ -140,7 +145,6 @@ write_stat(unsigned_word addr, H2T(buf.st_nlink); H2T(buf.st_uid); H2T(buf.st_gid); - H2T(buf.st_rdev); H2T(buf.st_size); H2T(buf.st_atime); /* H2T(buf.st_spare1); */ @@ -148,8 +152,15 @@ write_stat(unsigned_word addr, /* H2T(buf.st_spare2); */ H2T(buf.st_ctime); /* H2T(buf.st_spare3); */ +#ifdef AC_STRUCT_ST_RDEV + H2T(buf.st_rdev); +#endif +#ifdef AC_STRUCT_ST_BLKSIZE H2T(buf.st_blksize); +#endif +#ifdef AC_STRUCT_ST_BLOCKS H2T(buf.st_blocks); +#endif #if WITH_NetBSD_HOST H2T(buf.st_flags); H2T(buf.st_gen); @@ -158,7 +169,7 @@ write_stat(unsigned_word addr, } -#if NetBSD +#ifdef HAVE_FSTATFS STATIC_INLINE_EMUL_NETBSD void write_statfs(unsigned_word addr, struct statfs buf, @@ -210,7 +221,7 @@ write_timezone(unsigned_word addr, } -#if WITH_NetBSD_HOST +#ifdef HAVE_GETDIRENTRIES STATIC_INLINE_EMUL_NETBSD void write_direntries(unsigned_word addr, char *buf, @@ -428,6 +439,9 @@ do_break(os_emul_data *emul, } +#ifndef HAVE_GETPID +#define do_getpid 0 +#else static void do_getpid(os_emul_data *emul, unsigned call, @@ -438,8 +452,11 @@ do_getpid(os_emul_data *emul, SYS(getpid); emul_write_status(processor, (int)getpid(), 0); } +#endif - +#ifndef HAVE_GETUID +#define do_getuid 0 +#else static void do_getuid(os_emul_data *emul, unsigned call, @@ -450,8 +467,11 @@ do_getuid(os_emul_data *emul, SYS(getuid); emul_write_status(processor, (int)getuid(), 0); } +#endif - +#ifndef HAVE_GETEUID +#define do_geteuid 0 +#else static void do_geteuid(os_emul_data *emul, unsigned call, @@ -462,8 +482,11 @@ do_geteuid(os_emul_data *emul, SYS(geteuid); emul_write_status(processor, (int)geteuid(), 0); } +#endif - +#ifndef HAVE_KILL +#define do_kill 0 +#else static void do_kill(os_emul_data *emul, unsigned call, @@ -482,8 +505,11 @@ do_kill(os_emul_data *emul, (long)cia); cpu_halt(processor, cia, was_signalled, sig); } +#endif - +#ifndef HAVE_DUP +#define do_dup 0 +#else static void do_dup(os_emul_data *emul, unsigned call, @@ -501,8 +527,11 @@ do_dup(os_emul_data *emul, SYS(dup); emul_write_status(processor, status, err); } +#endif - +#ifndef HAVE_GETEGID +#define do_getegid 0 +#else static void do_getegid(os_emul_data *emul, unsigned call, @@ -513,8 +542,11 @@ do_getegid(os_emul_data *emul, SYS(getegid); emul_write_status(processor, (int)getegid(), 0); } +#endif - +#ifndef HAVE_GETGID +#define do_getgid 0 +#else static void do_getgid(os_emul_data *emul, unsigned call, @@ -525,8 +557,11 @@ do_getgid(os_emul_data *emul, SYS(getgid); emul_write_status(processor, (int)getgid(), 0); } +#endif - +#ifndef HAVE_SIGPROCMASK +#define do_sigprocmask 0 +#else static void do_sigprocmask(os_emul_data *emul, unsigned call, @@ -545,8 +580,11 @@ do_sigprocmask(os_emul_data *emul, emul_write_status(processor, 0, 0); cpu_registers(processor)->gpr[4] = set; } +#endif - +#ifndef HAVE_IOCTL +#define do_ioctl 0 +#else static void do_ioctl(os_emul_data *emul, unsigned call, @@ -576,8 +614,11 @@ do_ioctl(os_emul_data *emul, if (WITH_TRACE && ppc_trace[trace_os_emul]) printf_filtered ("%d, 0x%x, 0x%lx", d, request, (long)argp_addr); } +#endif - +#ifndef HAVE_UMASK +#define do_umask 0 +#else static void do_umask(os_emul_data *emul, unsigned call, @@ -593,8 +634,11 @@ do_umask(os_emul_data *emul, SYS(umask); emul_write_status(processor, umask(mask), 0); } +#endif - +#ifndef HAVE_DUP2 +#define do_dup2 0 +#else static void do_dup2(os_emul_data *emul, unsigned call, @@ -613,8 +657,11 @@ do_dup2(os_emul_data *emul, SYS(dup2); emul_write_status(processor, status, err); } +#endif - +#ifndef HAVE_FCNTL +#define do_fcntl 0 +#else static void do_fcntl(os_emul_data *emul, unsigned call, @@ -634,8 +681,11 @@ do_fcntl(os_emul_data *emul, status = fcntl(fd, cmd, arg); emul_write_status(processor, status, errno); } +#endif - +#ifndef HAVE_GETTIMEOFDAY +#define do_gettimeofday 0 +#else static void do_gettimeofday(os_emul_data *emul, unsigned call, @@ -663,7 +713,7 @@ do_gettimeofday(os_emul_data *emul, write_timezone(tz_addr, tz, processor, cia); } } - +#endif #ifndef HAVE_GETRUSAGE #define do_getrusage 0 @@ -694,7 +744,7 @@ do_getrusage(os_emul_data *emul, #endif -#if !WITH_NetBSD_HOST +#ifndef HAVE_FSTATFS #define do_fstatfs 0 #else static void @@ -722,7 +772,9 @@ do_fstatfs(os_emul_data *emul, } #endif - +#ifndef HAVE_STAT +#define do_stat 0 +#else static void do_stat(os_emul_data *emul, unsigned call, @@ -742,8 +794,11 @@ do_stat(os_emul_data *emul, if (status == 0) write_stat(stat_buf_addr, buf, processor, cia); } +#endif - +#ifndef HAVE_FSTAT +#define do_fstat 0 +#else static void do_fstat(os_emul_data *emul, unsigned call, @@ -758,8 +813,11 @@ do_fstat(os_emul_data *emul, emul_write_status(processor, fstat(fd, &buf), errno); write_stat(stat_buf_addr, buf, processor, cia); } +#endif - +#ifndef HAVE_LSTAT +#define do_lstat 0 +#else static void do_lstat(os_emul_data *emul, unsigned call, @@ -776,9 +834,9 @@ do_lstat(os_emul_data *emul, emul_write_status(processor, stat(path, &buf), errno); write_stat(stat_buf_addr, buf, processor, cia); } +#endif - -#if !WITH_NetBSD_HOST +#ifndef HAVE_GETDIRENTRIES #define do_getdirentries 0 #else static void @@ -831,7 +889,9 @@ do___syscall(os_emul_data *emul, cia); } - +#ifndef HAVE_LSEEK +#define do_lseek 0 +#else static void do_lseek(os_emul_data *emul, unsigned call, @@ -852,7 +912,7 @@ do_lseek(os_emul_data *emul, emul_write_gpr64(processor, 3, status); } } - +#endif static void do___sysctl(os_emul_data *emul, |