Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

WIP: uv_fs_[fl]stat should support subsecond resolution #739

Closed
wants to merge 1 commit into from

Conversation

tjfontaine
Copy link
Contributor

This adds uv_stat_t with a consistent interface across platforms, and on platforms where it's supported ->st_mtim.tv_nsec will be populated

currently only for unix, and doesn't check if we're on a platform where it's not supported.

uv_timespec_t st_atim;
uv_timespec_t st_mtim;
uv_timespec_t st_ctim;
#if defined(__POSIX__)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop the conditional and zero the values on Windows?

Most of the fields in this struct should probably be unsigned long or uint64_t. st_dev and st_rdev, for example, are 64 bits on 64 bits Linux. (Though it's up for debate how plausible it is to have over 2^32 devices.)

@tjfontaine
Copy link
Contributor Author

I've updated this, with the suggested changes, there's also a version that needs to be reviewed by @piscisaureus which must offend his taste, because it offends mine

dst->st_mtim.tv_nsec = src->st_mtimespec.tv_nsec;
dst->st_ctim.tv_sec = src->st_ctimespec.tv_sec;
dst->st_ctim.tv_nsec = src->st_ctimespec.tv_nsec;
#elif defined(_POSIX_C_SOURCE) /* TODO this isn't entirely accurate */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#elif defined(_BSD_SOURCE) || defined(_SVID_SOURCE)?

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

Successfully merging this pull request may close these issues.

3 participants