use struct stat from cygwin as struct FUSE_STAT for better compatibility#88
use struct stat from cygwin as struct FUSE_STAT for better compatibility#88Liryna merged 2 commits intodokan-dev:masterfrom zzhiyi:master
Conversation
|
Hi @x1596357 , Thanks alot for the contribution ! I just wanted to ask of you could change the place of st_blksize and st_blocks for having the same memory struct than the linux struct stat ? By the way, I will change dokan fuse to become a dynamic library as you asked. |
|
Hi @Liryna, |
|
Oh ok ! Well yes, as you made it seems to be the best choice :) Dokan fuse has been changed to dynamic library: 4953160 |
use struct stat from cygwin as struct FUSE_STAT for better compatibility
|
Wiki is already updated. |
|
Perfect ! Thanks a lot ! ❤️ |
The original struct stat lacks members like st_blksize etc and uses atime/mtime/ctime, which can only have accuracy in seconds. What's more, the difference with the struct FUSE_STAT in DokanFUSE and struct stat in user program causes stack overflows. The new struct FUSE_STAT is ported from msys2 64bits, which is actually ported from cygwin 64bits. With this modification, users with msys/cygwin(64-bit)toolchains can compile their FUSE programs with DokanFUSE library directly without any more modification other than changing their header files. However, for other toolchains like MSVC,mingw and cygwin 32bits, you need to explicitly replace struct stat in your FUSE program to use struct FUSE_STAT from fuse_win.h. Because the implementation of stat.h varies from operating systems and toolchains, it's hard to find a simply way to be compatible with all of them.