Index: sim/common/callback.c =================================================================== RCS file: /var/cvsroot/src-cvs/src/sim/common/callback.c,v retrieving revision 1.16 diff -u -p -r1.16 callback.c --- sim/common/callback.c 21 Feb 2005 21:59:54 -0000 1.16 +++ sim/common/callback.c 28 Apr 2005 15:01:39 -0000 @@ -60,6 +60,10 @@ #include #endif +#ifndef PIPE_BUF +#define PIPE_BUF 512 +#endif + /* ??? sim_cb_printf should be cb_printf, but until the callback support is broken out of the simulator directory, these are here to not require sim-utils.h. */ @@ -577,7 +581,11 @@ os_lstat (p, file, buf) struct stat *buf; { /* NOTE: hpn/2004-12-12: Same issue here as with os_fstat. */ +#ifdef HAVE_LSTAT return wrap (p, lstat (file, buf)); +#else + return wrap (p, stat (file, buf)); +#endif } static int @@ -596,7 +604,12 @@ os_ftruncate (p, fd, len) } if (result) return result; +#ifdef HAVE_FTRUNCATE result = wrap (p, ftruncate (fdmap (p, fd), len)); +#else + p->last_errno = EINVAL; + result = -1; +#endif return result; } @@ -606,7 +619,12 @@ os_truncate (p, file, len) const char *file; long len; { +#ifdef HAVE_TRUNCATE return wrap (p, truncate (file, len)); +#else + p->last_errno = EINVAL; + return -1; +#endif } static int Index: sim/common/configure.ac =================================================================== RCS file: /var/cvsroot/src-cvs/src/sim/common/configure.ac,v retrieving revision 1.2 diff -u -p -r1.2 configure.ac --- sim/common/configure.ac 14 Jan 2005 20:05:40 -0000 1.2 +++ sim/common/configure.ac 28 Apr 2005 15:02:29 -0000 @@ -37,7 +37,7 @@ AC_SUBST(TARGET_SUBDIR) # These aren't all needed yet, but will be eventually. AC_CHECK_HEADERS(stdlib.h string.h strings.h time.h sys/times.h sys/stat.h sys/mman.h) -AC_CHECK_FUNCS(mmap munmap) +AC_CHECK_FUNCS(mmap munmap lstat truncate ftruncate) SIM_CHECK_MEMBERS([[struct stat.st_dev], [struct stat.st_ino], [struct stat.st_mode], [struct stat.st_nlink], [struct stat.st_uid], [struct stat.st_gid], [struct stat.st_rdev], [struct stat.st_size],