More changes for GO32 canadian cross builds

This commit is contained in:
Michael Meissner 1996-05-24 19:05:17 +00:00
parent 0293d5b019
commit 0c18e3f002
5 changed files with 402 additions and 46 deletions

View File

@ -1,5 +1,15 @@
Fri May 24 10:08:10 1996 Michael Meissner <meissner@tiktok.cygnus.com> 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 * hw_pal.c (WITH_STDIO): Redefine if O_NDELAY, F_GETFL, or F_SETFL
are not defined. are not defined.
(scan_hw_pal): Do not cause syntax error if O_NDELAY, F_GETFL, or (scan_hw_pal): Do not cause syntax error if O_NDELAY, F_GETFL, or

View File

@ -1,15 +1,88 @@
/* config.in. Generated automatically from configure.in by autoheader. */ /* config.in. Generated automatically from configure.in by autoheader. */
#ifndef CONFIG_H /* Define if your struct stat has st_blksize. */
#define CONFIG_H #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 /* Define if your processor stores words with the most significant
byte first (like Motorola and SPARC, unlike Intel and VAX). */ byte first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN #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. */ /* Define if you have the getrusage function. */
#undef HAVE_GETRUSAGE #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. */ /* Define if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H #undef HAVE_DIRENT_H
@ -28,6 +101,12 @@
/* Define if you have the <sys/dir.h> header file. */ /* Define if you have the <sys/dir.h> header file. */
#undef HAVE_SYS_DIR_H #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. */ /* Define if you have the <sys/ndir.h> header file. */
#undef HAVE_SYS_NDIR_H #undef HAVE_SYS_NDIR_H
@ -48,5 +127,3 @@
/* Define if you have the <unistd.h> header file. */ /* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H #undef HAVE_UNISTD_H
#endif

238
sim/ppc/configure vendored
View File

@ -1050,7 +1050,7 @@ if test $ac_cv_c_bigendian = yes; then
EOF EOF
fi fi
echo ac_cv_c_bigendian = $ac_cv_c_bigendian
if test $ac_cv_c_bigendian = yes; then if test $ac_cv_c_bigendian = yes; then
sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN" sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN"
else 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 do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1506 "configure" #line 1709 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */ which can conflict with char $ac_func(); below. */
@ -1524,7 +1727,7 @@ $ac_func();
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
eval "ac_cv_func_$ac_func=yes" eval "ac_cv_func_$ac_func=yes"
else else
@ -1562,13 +1765,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser, # On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. # not just through cpp.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1566 "configure" #line 1769 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <assert.h> #include <assert.h>
Syntax Error Syntax Error
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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` ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then if test -z "$ac_err"; then
: :
@ -1577,13 +1780,13 @@ else
rm -rf conftest* rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp" CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1581 "configure" #line 1784 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <assert.h> #include <assert.h>
Syntax Error Syntax Error
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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` ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then if test -z "$ac_err"; then
: :
@ -1603,7 +1806,7 @@ else
fi fi
echo "$ac_t""$CPP" 1>&6 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 do
ac_safe=`echo "$ac_hdr" | tr './\055' '___'` ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 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 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1615 "configure" #line 1818 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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` ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* 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 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1653 "configure" #line 1856 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#include <$ac_hdr> #include <$ac_hdr>
@ -1658,7 +1861,7 @@ int t() {
DIR *dirp = 0; DIR *dirp = 0;
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes" eval "ac_cv_header_dirent_$ac_safe=yes"
else else
@ -1689,7 +1892,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS" LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1693 "configure" #line 1896 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { return 0; } int main() { return 0; }
@ -1697,7 +1900,7 @@ int t() {
opendir() opendir()
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
@ -1724,7 +1927,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS" LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1728 "configure" #line 1931 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { return 0; } int main() { return 0; }
@ -1732,7 +1935,7 @@ int t() {
opendir() opendir()
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
@ -1917,6 +2120,7 @@ s%@sim_model@%$sim_model%g
s%@sim_default_model@%$sim_default_model%g s%@sim_default_model@%$sim_default_model%g
s%@sim_model_issue@%$sim_model_issue%g s%@sim_model_issue@%$sim_model_issue%g
s%@sim_stdio@%$sim_stdio%g s%@sim_stdio@%$sim_stdio%g
s%@LIBOBJS@%$LIBOBJS%g
s%@CPP@%$CPP%g s%@CPP@%$CPP%g
CEOF CEOF

View File

@ -438,7 +438,12 @@ AC_SUBST(sim_default_model)
AC_SUBST(sim_model_issue) AC_SUBST(sim_model_issue)
AC_SUBST(sim_stdio) 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_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 AC_HEADER_DIRENT

View File

@ -95,6 +95,11 @@ int getrusage();
#include <sys/syscall.h> /* FIXME - should not be including this one */ #include <sys/syscall.h> /* FIXME - should not be including this one */
#include <sys/sysctl.h> #include <sys/sysctl.h>
extern int getdirentries(int fd, char *buf, int nbytes, long *basep); 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 #endif
#if (BSD < 199306) /* here BSD as just a bug */ #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_nlink);
H2T(buf.st_uid); H2T(buf.st_uid);
H2T(buf.st_gid); H2T(buf.st_gid);
H2T(buf.st_rdev);
H2T(buf.st_size); H2T(buf.st_size);
H2T(buf.st_atime); H2T(buf.st_atime);
/* H2T(buf.st_spare1); */ /* H2T(buf.st_spare1); */
@ -148,8 +152,15 @@ write_stat(unsigned_word addr,
/* H2T(buf.st_spare2); */ /* H2T(buf.st_spare2); */
H2T(buf.st_ctime); H2T(buf.st_ctime);
/* H2T(buf.st_spare3); */ /* H2T(buf.st_spare3); */
#ifdef AC_STRUCT_ST_RDEV
H2T(buf.st_rdev);
#endif
#ifdef AC_STRUCT_ST_BLKSIZE
H2T(buf.st_blksize); H2T(buf.st_blksize);
#endif
#ifdef AC_STRUCT_ST_BLOCKS
H2T(buf.st_blocks); H2T(buf.st_blocks);
#endif
#if WITH_NetBSD_HOST #if WITH_NetBSD_HOST
H2T(buf.st_flags); H2T(buf.st_flags);
H2T(buf.st_gen); H2T(buf.st_gen);
@ -158,7 +169,7 @@ write_stat(unsigned_word addr,
} }
#if NetBSD #ifdef HAVE_FSTATFS
STATIC_INLINE_EMUL_NETBSD void STATIC_INLINE_EMUL_NETBSD void
write_statfs(unsigned_word addr, write_statfs(unsigned_word addr,
struct statfs buf, struct statfs buf,
@ -210,7 +221,7 @@ write_timezone(unsigned_word addr,
} }
#if WITH_NetBSD_HOST #ifdef HAVE_GETDIRENTRIES
STATIC_INLINE_EMUL_NETBSD void STATIC_INLINE_EMUL_NETBSD void
write_direntries(unsigned_word addr, write_direntries(unsigned_word addr,
char *buf, char *buf,
@ -428,6 +439,9 @@ do_break(os_emul_data *emul,
} }
#ifndef HAVE_GETPID
#define do_getpid 0
#else
static void static void
do_getpid(os_emul_data *emul, do_getpid(os_emul_data *emul,
unsigned call, unsigned call,
@ -438,8 +452,11 @@ do_getpid(os_emul_data *emul,
SYS(getpid); SYS(getpid);
emul_write_status(processor, (int)getpid(), 0); emul_write_status(processor, (int)getpid(), 0);
} }
#endif
#ifndef HAVE_GETUID
#define do_getuid 0
#else
static void static void
do_getuid(os_emul_data *emul, do_getuid(os_emul_data *emul,
unsigned call, unsigned call,
@ -450,8 +467,11 @@ do_getuid(os_emul_data *emul,
SYS(getuid); SYS(getuid);
emul_write_status(processor, (int)getuid(), 0); emul_write_status(processor, (int)getuid(), 0);
} }
#endif
#ifndef HAVE_GETEUID
#define do_geteuid 0
#else
static void static void
do_geteuid(os_emul_data *emul, do_geteuid(os_emul_data *emul,
unsigned call, unsigned call,
@ -462,8 +482,11 @@ do_geteuid(os_emul_data *emul,
SYS(geteuid); SYS(geteuid);
emul_write_status(processor, (int)geteuid(), 0); emul_write_status(processor, (int)geteuid(), 0);
} }
#endif
#ifndef HAVE_KILL
#define do_kill 0
#else
static void static void
do_kill(os_emul_data *emul, do_kill(os_emul_data *emul,
unsigned call, unsigned call,
@ -482,8 +505,11 @@ do_kill(os_emul_data *emul,
(long)cia); (long)cia);
cpu_halt(processor, cia, was_signalled, sig); cpu_halt(processor, cia, was_signalled, sig);
} }
#endif
#ifndef HAVE_DUP
#define do_dup 0
#else
static void static void
do_dup(os_emul_data *emul, do_dup(os_emul_data *emul,
unsigned call, unsigned call,
@ -501,8 +527,11 @@ do_dup(os_emul_data *emul,
SYS(dup); SYS(dup);
emul_write_status(processor, status, err); emul_write_status(processor, status, err);
} }
#endif
#ifndef HAVE_GETEGID
#define do_getegid 0
#else
static void static void
do_getegid(os_emul_data *emul, do_getegid(os_emul_data *emul,
unsigned call, unsigned call,
@ -513,8 +542,11 @@ do_getegid(os_emul_data *emul,
SYS(getegid); SYS(getegid);
emul_write_status(processor, (int)getegid(), 0); emul_write_status(processor, (int)getegid(), 0);
} }
#endif
#ifndef HAVE_GETGID
#define do_getgid 0
#else
static void static void
do_getgid(os_emul_data *emul, do_getgid(os_emul_data *emul,
unsigned call, unsigned call,
@ -525,8 +557,11 @@ do_getgid(os_emul_data *emul,
SYS(getgid); SYS(getgid);
emul_write_status(processor, (int)getgid(), 0); emul_write_status(processor, (int)getgid(), 0);
} }
#endif
#ifndef HAVE_SIGPROCMASK
#define do_sigprocmask 0
#else
static void static void
do_sigprocmask(os_emul_data *emul, do_sigprocmask(os_emul_data *emul,
unsigned call, unsigned call,
@ -545,8 +580,11 @@ do_sigprocmask(os_emul_data *emul,
emul_write_status(processor, 0, 0); emul_write_status(processor, 0, 0);
cpu_registers(processor)->gpr[4] = set; cpu_registers(processor)->gpr[4] = set;
} }
#endif
#ifndef HAVE_IOCTL
#define do_ioctl 0
#else
static void static void
do_ioctl(os_emul_data *emul, do_ioctl(os_emul_data *emul,
unsigned call, unsigned call,
@ -576,8 +614,11 @@ do_ioctl(os_emul_data *emul,
if (WITH_TRACE && ppc_trace[trace_os_emul]) if (WITH_TRACE && ppc_trace[trace_os_emul])
printf_filtered ("%d, 0x%x, 0x%lx", d, request, (long)argp_addr); printf_filtered ("%d, 0x%x, 0x%lx", d, request, (long)argp_addr);
} }
#endif
#ifndef HAVE_UMASK
#define do_umask 0
#else
static void static void
do_umask(os_emul_data *emul, do_umask(os_emul_data *emul,
unsigned call, unsigned call,
@ -593,8 +634,11 @@ do_umask(os_emul_data *emul,
SYS(umask); SYS(umask);
emul_write_status(processor, umask(mask), 0); emul_write_status(processor, umask(mask), 0);
} }
#endif
#ifndef HAVE_DUP2
#define do_dup2 0
#else
static void static void
do_dup2(os_emul_data *emul, do_dup2(os_emul_data *emul,
unsigned call, unsigned call,
@ -613,8 +657,11 @@ do_dup2(os_emul_data *emul,
SYS(dup2); SYS(dup2);
emul_write_status(processor, status, err); emul_write_status(processor, status, err);
} }
#endif
#ifndef HAVE_FCNTL
#define do_fcntl 0
#else
static void static void
do_fcntl(os_emul_data *emul, do_fcntl(os_emul_data *emul,
unsigned call, unsigned call,
@ -634,8 +681,11 @@ do_fcntl(os_emul_data *emul,
status = fcntl(fd, cmd, arg); status = fcntl(fd, cmd, arg);
emul_write_status(processor, status, errno); emul_write_status(processor, status, errno);
} }
#endif
#ifndef HAVE_GETTIMEOFDAY
#define do_gettimeofday 0
#else
static void static void
do_gettimeofday(os_emul_data *emul, do_gettimeofday(os_emul_data *emul,
unsigned call, unsigned call,
@ -663,7 +713,7 @@ do_gettimeofday(os_emul_data *emul,
write_timezone(tz_addr, tz, processor, cia); write_timezone(tz_addr, tz, processor, cia);
} }
} }
#endif
#ifndef HAVE_GETRUSAGE #ifndef HAVE_GETRUSAGE
#define do_getrusage 0 #define do_getrusage 0
@ -694,7 +744,7 @@ do_getrusage(os_emul_data *emul,
#endif #endif
#if !WITH_NetBSD_HOST #ifndef HAVE_FSTATFS
#define do_fstatfs 0 #define do_fstatfs 0
#else #else
static void static void
@ -722,7 +772,9 @@ do_fstatfs(os_emul_data *emul,
} }
#endif #endif
#ifndef HAVE_STAT
#define do_stat 0
#else
static void static void
do_stat(os_emul_data *emul, do_stat(os_emul_data *emul,
unsigned call, unsigned call,
@ -742,8 +794,11 @@ do_stat(os_emul_data *emul,
if (status == 0) if (status == 0)
write_stat(stat_buf_addr, buf, processor, cia); write_stat(stat_buf_addr, buf, processor, cia);
} }
#endif
#ifndef HAVE_FSTAT
#define do_fstat 0
#else
static void static void
do_fstat(os_emul_data *emul, do_fstat(os_emul_data *emul,
unsigned call, unsigned call,
@ -758,8 +813,11 @@ do_fstat(os_emul_data *emul,
emul_write_status(processor, fstat(fd, &buf), errno); emul_write_status(processor, fstat(fd, &buf), errno);
write_stat(stat_buf_addr, buf, processor, cia); write_stat(stat_buf_addr, buf, processor, cia);
} }
#endif
#ifndef HAVE_LSTAT
#define do_lstat 0
#else
static void static void
do_lstat(os_emul_data *emul, do_lstat(os_emul_data *emul,
unsigned call, unsigned call,
@ -776,9 +834,9 @@ do_lstat(os_emul_data *emul,
emul_write_status(processor, stat(path, &buf), errno); emul_write_status(processor, stat(path, &buf), errno);
write_stat(stat_buf_addr, buf, processor, cia); write_stat(stat_buf_addr, buf, processor, cia);
} }
#endif
#ifndef HAVE_GETDIRENTRIES
#if !WITH_NetBSD_HOST
#define do_getdirentries 0 #define do_getdirentries 0
#else #else
static void static void
@ -831,7 +889,9 @@ do___syscall(os_emul_data *emul,
cia); cia);
} }
#ifndef HAVE_LSEEK
#define do_lseek 0
#else
static void static void
do_lseek(os_emul_data *emul, do_lseek(os_emul_data *emul,
unsigned call, unsigned call,
@ -852,7 +912,7 @@ do_lseek(os_emul_data *emul,
emul_write_gpr64(processor, 3, status); emul_write_gpr64(processor, 3, status);
} }
} }
#endif
static void static void
do___sysctl(os_emul_data *emul, do___sysctl(os_emul_data *emul,