Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent wrapping around stat/stat64 #28

Closed
GoogleCodeExporter opened this issue Apr 2, 2015 · 3 comments
Closed

Inconsistent wrapping around stat/stat64 #28

GoogleCodeExporter opened this issue Apr 2, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

10.5 added stat64, and the OpenSolaris codebase uses stat64 a lot. However, in 
10.6, stat is 
preferred.

There's an #ifdef that can support using either (according to the man page): 
_DARWIN_USE_64_BIT_INODE

There's code around some stat/stat64 methods as follows:

#if _DARWIN_FEATURE_64_BIT_INODE
                struct stat statbuf;
#else
        struct stat64 statbuf;
#endif

However, this seems to be different to the _DARWIN_USE from the man pages vs 
_DARWIN_FEATURE from the (current) code. Yet more uses __APPLE__ around such 
differentiators.

Original issue reported on code.google.com by alex.ble...@gmail.com on 20 Feb 2010 at 3:33

@GoogleCodeExporter
Copy link
Author

This affects 

./usr/src/lib/libzfs/common/libzfs_import.c
./usr/src/lib/libzfs/common/libzfs_util.c

Original comment by alex.ble...@gmail.com on 19 Jul 2010 at 11:29

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

I think something like:

#ifdef _DARWIN_FEATURE_64_BIT_INODE
#define stat64 stat
#define fstat64 fstat
#define lstat64 lstat
#endif

in the zfs_context would allow us to get rid of most of the #ifdefs, if this 
works.

Original comment by alex.ble...@gmail.com on 19 Jul 2010 at 11:52

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Pushed a fix to 
http://github.com/alblue/mac-zfs/commit/73564c331a37c997d73aee418b5ffde2901e4a7d
 - however, after compiling it with/without the feature, it seemed to work. 
Further testing is still required to see if this indeed fixes the issue, or 
whether we should define _DARWIN_FEATURE_64_BIT_INODE at the build time. (May 
address some other filesystem time related issues)

Original comment by alex.ble...@gmail.com on 20 Jul 2010 at 12:05

  • Changed state: Fixed
  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant