From: Oliver Kurth Date: Fri, 15 Sep 2017 18:23:56 +0000 (-0700) Subject: Add support for 64-bit inodes in FreeBSD 12 X-Git-Tag: stable-10.2.0~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f94e2468307d13b9d70938e1ad817bceeb2e2b2;p=thirdparty%2Fopen-vm-tools.git Add support for 64-bit inodes in FreeBSD 12 FreeBSD 12 is switching to 64-bit inodes which will cause some ABI breakage in user code. This fix modifies the getdirentries() syscall used in hgfsServerLinux.c for that FBSD 12 64-bit inodes. The fix was provided by Josh Paetzel in open-vm-tools pull request https://github.com/vmware/open-vm-tools/pull/190 --- diff --git a/open-vm-tools/AUTHORS b/open-vm-tools/AUTHORS index 815b02cef..348ec2acd 100644 --- a/open-vm-tools/AUTHORS +++ b/open-vm-tools/AUTHORS @@ -7,3 +7,6 @@ Steve Wills Correct __IS_FREEBSD__ macro in vm_basic_defs.h (clang) Bernd Zeimetz Fix gcc6 build issues in linuxDeployment.c file. - https://github.com/vmware/open-vm-tools/pull/107 + +Josh Paetzel Add support for 64-bit inodes in FreeBSD 12 + - https://github.com/vmware/open-vm-tools/pull/190 diff --git a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c index 25a35f06f..59ba5bbe4 100644 --- a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c +++ b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c @@ -177,11 +177,17 @@ getdents_linux(unsigned int fd, } # define getdents getdents_linux #elif defined(__FreeBSD__) -#define getdents(fd, dirp, count) \ +#if defined(__INO64) +typedef off_t BASEPTYPE; +#else +typedef long BASEPTYPE; +#endif +#define getdents_freebsd(fd, dirp, count) \ ({ \ - long basep; \ + BASEPTYPE basep; \ getdirentries(fd, dirp, count, &basep); \ }) +# define getdents getdents_freebsd #elif defined(__APPLE__) static INLINE int getdents_apple(DIR *fd, // IN