From: Julian Seward Date: Mon, 1 Sep 2014 22:26:18 +0000 (+0000) Subject: VG_(getdents64) is only needed on Linux, and causes build problems X-Git-Tag: svn/VALGRIND_3_10_0~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=506af730365153bec6b62b1ac1b1ac3068adc23e;p=thirdparty%2Fvalgrind.git VG_(getdents64) is only needed on Linux, and causes build problems on Darwin, so make it exist only on Linux. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14421 --- diff --git a/coregrind/m_libcfile.c b/coregrind/m_libcfile.c index a019dd845a..be3240b22a 100644 --- a/coregrind/m_libcfile.c +++ b/coregrind/m_libcfile.c @@ -522,19 +522,15 @@ Int VG_(readlink) (const HChar* path, HChar* buf, UInt bufsiz) return sr_isError(res) ? -1 : sr_Res(res); } +#if defined(VGO_linux) Int VG_(getdents64) (Int fd, struct vki_dirent64 *dirp, UInt count) { -# if defined(VGO_linux) SysRes res; /* res = getdents( fd, dirp, count ); */ res = VG_(do_syscall3)(__NR_getdents64, fd, (UWord)dirp, count); return sr_isError(res) ? -1 : sr_Res(res); -# elif defined(VGO_darwin) - I_die_here; -# else -# error "Unknown OS" -# endif } +#endif /* Check accessibility of a file. Returns zero for access granted, nonzero otherwise. */ diff --git a/include/pub_tool_libcfile.h b/include/pub_tool_libcfile.h index e93e6655a8..ea50289b2d 100644 --- a/include/pub_tool_libcfile.h +++ b/include/pub_tool_libcfile.h @@ -92,7 +92,10 @@ extern Int VG_(unlink) ( const HChar* file_name ); extern SysRes VG_(poll) (struct vki_pollfd *fds, Int nfds, Int timeout); extern Int VG_(readlink)( const HChar* path, HChar* buf, UInt bufsize ); + +#if defined(VGO_linux) extern Int VG_(getdents64)( Int fd, struct vki_dirent64 *dirp, UInt count ); +#endif extern const HChar* VG_(basename)( const HChar* path ); extern const HChar* VG_(dirname) ( const HChar* path );