Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3835,6 +3835,9 @@ fs.watch('somedir', (eventType, filename) => {
<!-- YAML
added: v0.1.31
changes:
- version: v10.5.0
pr-url: https://github.com/nodejs/node/pull/20220
description: The `bigint` option is now supported.
- version: v7.6.0
pr-url: https://github.com/nodejs/node/pull/10739
description: The `filename` parameter can be a WHATWG `URL` object using
Expand All @@ -3843,6 +3846,7 @@ changes:

* `filename` {string|Buffer|URL}
* `options` {Object}
* `bigint` {boolean} **Default:** `false`
* `persistent` {boolean} **Default:** `true`
* `interval` {integer} **Default:** `5007`
* `listener` {Function}
Expand All @@ -3868,7 +3872,8 @@ fs.watchFile('message.text', (curr, prev) => {
});
```

These stat objects are instances of `fs.Stat`.
These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`,
the numeric values in these objects are specified as `BigInt`s.

To be notified when the file was modified, not just accessed, it is necessary
to compare `curr.mtime` and `prev.mtime`.
Expand Down
4 changes: 2 additions & 2 deletions src/node_http_common-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ NgHeader<T>::NgHeader(

template <typename T>
NgHeader<T>::NgHeader(NgHeader<T>&& other) noexcept
: token_(other.token_),
name_(std::move(other.name_)),
: name_(std::move(other.name_)),
value_(std::move(other.value_)),
token_(other.token_),
flags_(other.flags_) {
other.token_ = -1;
other.flags_ = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/node_http_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ class NgHeader : public MemoryRetainer {
inline std::string value() const;
inline size_t length() const;

void MemoryInfo(MemoryTracker* tracker) const {
void MemoryInfo(MemoryTracker* tracker) const override {
tracker->TrackField("name", name_);
tracker->TrackField("value", value_);
}
Expand Down
17 changes: 17 additions & 0 deletions test/wasi/c/link.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <assert.h>
#include <unistd.h>
#include <sys/stat.h>

#define OLD "/sandbox/input.txt"
#define NEW "/tmp/output.txt"

int main() {
struct stat st_old;
struct stat st_new;

assert(0 == stat(OLD, &st_old));
assert(0 == link(OLD, NEW));
assert(0 == stat(NEW, &st_new));
assert(st_old.st_ino == st_new.st_ino);
return 0;
}
1 change: 1 addition & 0 deletions test/wasi/test-wasi.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ if (process.argv[2] === 'wasi-child') {
runWASI({ test: 'getentropy' });
runWASI({ test: 'getrusage' });
runWASI({ test: 'gettimeofday' });
runWASI({ test: 'link' });
runWASI({ test: 'main_args' });
runWASI({ test: 'notdir' });
// runWASI({ test: 'poll' });
Expand Down
Binary file added test/wasi/wasm/link.wasm
Binary file not shown.