]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Add support for 64-bit inodes in FreeBSD 12
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:56 +0000 (11:23 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:56 +0000 (11:23 -0700)
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

open-vm-tools/AUTHORS
open-vm-tools/lib/hgfsServer/hgfsServerLinux.c

index 815b02cef046dbb5376b82197e2dbbcc2bc9c245..348ec2acd2792ecaa07317233be882186ca7737b 100644 (file)
@@ -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
index 25a35f06f6fa48d29ab2ef0d43b061d6df3c9b43..59ba5bbe4f29f5bb34a435ca542c45e2b37657da 100644 (file)
@@ -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