-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
doc: document fs.fdatasync(Sync) #5402
Conversation
Perhaps there's a reason they are not documented? @bnoordhuis @indutny @saghul any ideas? Is there any platform variability in this API that may be worth documenting? |
What exactly is this? My Mac doesn't appear to have it. (well, no |
implemented using
fdatasync(2) is:
See http://linux.die.net/man/2/fdatasync Implemented using
They all seem equivalent to me but perhaps there's some variability that would impact on publicising it. |
There's a possibility I actually want to use this on a project, so I hope we can make these public. |
IIRC they are all equivalent except for the OSX implementation, which is "stronger". Btw, should |
I pretty much copied the fs.fsync(Sync) documentation. So if we want to link, we should probably do that across the board in a separate PR. As far as I understand it, fdatasync turns into fsync if filesize or file meta data has changed. Or perhaps these days it really is the same. But as long as the syscalls are there, and it's supported by libuv, why not expose it? It's in the OS, and I'm guessing it's not likely to go anywhere. In any case, are you considering removing it from libuv? If not, I think we can document it for Node. |
Don't think so, probably just an oversight. It's been around since at least node.js v0.4.
Nope, it's supported and documented.
fdatasync() just flushes data (what you've written), not metadata (access time, modify time, etc.) Changed metadata that has an effect on data (e.g. file size) is flushed, however. Apropos F_FULLFSYNC, we use that because OS X 10.5 didn't have a fdatasync() system call. We don't support 10.5 anymore so I think we can just switch it over to the real fdatasync(). |
@@ -436,6 +436,15 @@ to the completion callback. | |||
|
|||
Synchronous fchown(2). Returns `undefined`. | |||
|
|||
## fs.fdatasync(fd, callback) | |||
|
|||
Asynchronous fdatasync(2). No arguments other than a possible exception are given |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style nit: I think this line is just over 80 columns.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
81, you're right :)
Will fix. There are more lines in this file beyond 80 chars btw, but that's for another PR.
LGTM with nit. |
AFAIS there is still no
|
There's no libc wrapper, only the system call (i.e. |
Yep, I saw that; I guess we can just use the syscall straight. |
well in that case, this lgtm, the details of how it's called on osx are a matter for libuv |
Refs: nodejs/node#5402 PR-URL: libuv#732 Reviewed-By: Ben Noordhuis <[email protected]>
The APIs are implemented but currently not documented.
21947f7
to
f5773ec
Compare
Nit addressed. |
lgtm |
The APIs are implemented but currently not documented. PR-URL: #5402 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
Thanks Ron, landed in 4578902. I did a |
Thanks for merging and thanks for the notice. I've changed my git name to "Ron Korving" so this shouldn't happen again. |
The APIs are implemented but currently not documented. PR-URL: #5402 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
The APIs are implemented but currently not documented. PR-URL: #5402 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
Is it safe to assume this should be backported? |
yep, please do @thealphanerd |
The APIs are implemented but currently not documented. PR-URL: #5402 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
The APIs are implemented but currently not documented. PR-URL: #5402 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
The APIs are implemented but currently not documented. PR-URL: #5402 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
Pull Request check-list
Please make sure to review and check all of these items:
make -j8 test
(UNIX) orvcbuild test nosign
(Windows) pass withthis change (including linting)?
test (or a benchmark) included?
existing APIs, or introduces new ones)?
NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.
Affected core subsystem(s)
fs
Description of change
The fs.fdatasync and fs.fdatasyncSync APIs are implemented,
but are currently not documented. This adds the documentation.