fs: Fix default params for fs.write(Sync) (backport to v6)
requested to merge github/fork/assetgraph/backport/fix/defaultParameterForFsWriteWithBuffer into v6.x-staging
(Backported from #7856 to v6.x-staging, requested by @sam-github on https://github.com/nodejs/node/pull/7856#issuecomment-303536651)
Add support for fs.write(fd, buffer, cb) and fs.write(fd, buffer, offset, cb) as documented at https://nodejs.org/api/fs.html#fs_fs_write_fd_data_position_encoding_callback and equivalently for fs.writeSync
Update docs and code comments to reflect the implementation.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines
Affected core subsystem(s)
fs