Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
Rahul Padigela | 5890c69d13 | |
Rahul Padigela | c8d5d8ba7b | |
Rahul Padigela | 5a1afee140 |
|
@ -1,2 +0,0 @@
|
||||||
build
|
|
||||||
node_modules
|
|
|
@ -7,10 +7,6 @@ fs.open('foo', 'w+', function(err, fd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = posixFadvise(fd, 0, 10, 4);
|
ret = posixFadvise(fd, 0, 10, 4);
|
||||||
console.log('posixFadvise ret:', ret);
|
console.log('posixFadvise ret: ' + ret);
|
||||||
fs.close(fd, err => {
|
fs.close(fd);
|
||||||
if (err) {
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
17
package.json
17
package.json
|
@ -1,14 +1,11 @@
|
||||||
{
|
{
|
||||||
"name": "fcntl",
|
"name": "fcntl",
|
||||||
"version": "0.2.1",
|
"version": "0.1.0",
|
||||||
"engines": {
|
|
||||||
"node": ">=10"
|
|
||||||
},
|
|
||||||
"description": "fcntl wrapper for nodejs",
|
"description": "fcntl wrapper for nodejs",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"install": "node-gyp rebuild",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"install": "node-gyp rebuild"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -25,9 +22,13 @@
|
||||||
"url": "https://github.com/scality/node-fcntl/issues"
|
"url": "https://github.com/scality/node-fcntl/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/scality/node-fcntl#readme",
|
"homepage": "https://github.com/scality/node-fcntl#readme",
|
||||||
|
"gypfile": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bindings": "^1.1.1",
|
"bindings": "^1.1.1",
|
||||||
"nan": "^2.3.2",
|
"nan": "^2.3.2"
|
||||||
"node-gyp": "^8.0.0"
|
},
|
||||||
|
"scripts": {
|
||||||
|
"install": "node-gyp rebuild",
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,10 +36,10 @@ NAN_METHOD(PosixFadvise) {
|
||||||
Nan::ThrowTypeError("Argument 1 Must be an Integer");
|
Nan::ThrowTypeError("Argument 1 Must be an Integer");
|
||||||
}
|
}
|
||||||
|
|
||||||
int fd = info[0]->Int32Value(Nan::GetCurrentContext()).FromJust();
|
int fd = info[0]->Int32Value();
|
||||||
off_t offset = (off_t) info[1]->NumberValue(Nan::GetCurrentContext()).FromJust();
|
off_t offset = (off_t) info[1]->NumberValue();
|
||||||
off_t len = (off_t) info[2]->NumberValue(Nan::GetCurrentContext()).FromJust();
|
off_t len = (off_t) info[2]->NumberValue();
|
||||||
unsigned long advice = info[3]->IntegerValue(Nan::GetCurrentContext()).FromJust();
|
unsigned long advice = info[3]->IntegerValue();
|
||||||
|
|
||||||
int res = posix_fadvise(fd, offset, len, advice);
|
int res = posix_fadvise(fd, offset, len, advice);
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
|
|
Loading…
Reference in New Issue