Skip to content

Commit 37736f4

Browse files
Trottevanlucas
authored andcommitted
src: add O_NOATIME constant
Add O_NOATIME flag on Linux for use with `fs.open()`. PR-URL: #6492 Fixes: #2182 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 6353579 commit 37736f4

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/node_constants.cc

+4
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,10 @@ void DefineSystemConstants(Local<Object> target) {
10361036
NODE_DEFINE_CONSTANT(target, O_EXCL);
10371037
#endif
10381038

1039+
#ifdef O_NOATIME
1040+
NODE_DEFINE_CONSTANT(target, O_NOATIME);
1041+
#endif
1042+
10391043
#ifdef O_NOFOLLOW
10401044
NODE_DEFINE_CONSTANT(target, O_NOFOLLOW);
10411045
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict';
2+
3+
require('../common');
4+
const assert = require('assert');
5+
6+
const isLinux = process.platform === 'linux';
7+
8+
const O_NOATIME = process.binding('constants').O_NOATIME;
9+
const expected = isLinux ? 0x40000 : undefined;
10+
11+
assert.strictEqual(O_NOATIME, expected);

0 commit comments

Comments
 (0)