Compare commits

..

3 Commits

Author SHA1 Message Date
Rahul Padigela 5890c69d13 skip on windows 2023-06-20 15:40:28 -07:00
Rahul Padigela c8d5d8ba7b change conditional 2023-06-20 15:35:32 -07:00
Rahul Padigela 5a1afee140 skip install on windows 2023-06-20 15:25:27 -07:00
4 changed files with 15 additions and 20 deletions

2
.gitignore vendored
View File

@ -1,2 +0,0 @@
build
node_modules

View File

@ -7,10 +7,6 @@ fs.open('foo', 'w+', function(err, fd) {
}
ret = posixFadvise(fd, 0, 10, 4);
console.log('posixFadvise ret:', ret);
fs.close(fd, err => {
if (err) {
throw err;
}
});
console.log('posixFadvise ret: ' + ret);
fs.close(fd);
});

View File

@ -1,14 +1,11 @@
{
"name": "fcntl",
"version": "0.2.1",
"engines": {
"node": ">=10"
},
"version": "0.1.0",
"description": "fcntl wrapper for nodejs",
"main": "index.js",
"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": {
"type": "git",
@ -25,9 +22,13 @@
"url": "https://github.com/scality/node-fcntl/issues"
},
"homepage": "https://github.com/scality/node-fcntl#readme",
"gypfile": true,
"dependencies": {
"bindings": "^1.1.1",
"nan": "^2.3.2",
"node-gyp": "^8.0.0"
"nan": "^2.3.2"
},
"scripts": {
"install": "node-gyp rebuild",
"test": "echo \"Error: no test specified\" && exit 1"
}
}

View File

@ -36,10 +36,10 @@ NAN_METHOD(PosixFadvise) {
Nan::ThrowTypeError("Argument 1 Must be an Integer");
}
int fd = info[0]->Int32Value(Nan::GetCurrentContext()).FromJust();
off_t offset = (off_t) info[1]->NumberValue(Nan::GetCurrentContext()).FromJust();
off_t len = (off_t) info[2]->NumberValue(Nan::GetCurrentContext()).FromJust();
unsigned long advice = info[3]->IntegerValue(Nan::GetCurrentContext()).FromJust();
int fd = info[0]->Int32Value();
off_t offset = (off_t) info[1]->NumberValue();
off_t len = (off_t) info[2]->NumberValue();
unsigned long advice = info[3]->IntegerValue();
int res = posix_fadvise(fd, offset, len, advice);
if (res < 0) {