unbreaks the build breakage on Darwin introduced in r11397, which
was a fix for #234064. The breakage was subsequently reported
in #253420 and #253452, which this commit fixes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11406
DebugInfo* di;
ULong di_handle;
SysRes fd;
- Int nread;
+ Int nread, oflags;
HChar buf1k[1024];
Bool debug = False;
SysRes statres;
/* Peer at the first few bytes of the file, to see if it is an ELF */
/* object file. Ignore the file if we do not have read permission. */
VG_(memset)(buf1k, 0, sizeof(buf1k));
- fd = VG_(open)( filename, VKI_O_RDONLY|VKI_O_LARGEFILE, 0 );
+ oflags = VKI_O_RDONLY;
+# if defined(VKI_O_LARGEFILE)
+ oflags |= VKI_O_LARGEFILE;
+# endif
+ fd = VG_(open)( filename, oflags, 0 );
if (sr_isError(fd)) {
if (sr_Err(fd) != VKI_EACCES) {
DebugInfo fake_di;