#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
+#include "pub_core_debuglog.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcfile.h"
/* returns: 0 = success, non-0 is failure */
Int VG_(check_executable)(HChar* f)
{
-#ifdef __NR_stat64
+ /* This is something of a kludge. Really we should fix VG_(stat) to
+ do this itself, but not clear how to do it as it depends on
+ having a 'struct vki_stat64' which is different from 'struct
+ vki_stat'. */
+# if defined(VGO_linux) && defined(__NR_stat64)
struct vki_stat64 st;
SysRes res = VG_(do_syscall2)(__NR_stat64, (UWord)f, (UWord)&st);
-#else
+# else
struct vki_stat st;
- SysRes res = VG_(do_syscall2)(__NR_stat, (UWord)f, (UWord)&st);
-#endif
+ SysRes res = VG_(stat)(f, &st);
+# endif
if (res.isError) {
return res.err;
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<=(b)?(a):(b))
-#ifndef unix
-#ifndef WIN32
-extern char *farmalloc(long s);
-#define malloc(x) farmalloc(x)
-#endif
-#define FWMODE "wb"
-#else
-#define FWMODE "w"
-#endif
-
/*
Multi-dimensional fast Fourier transform