Skip to content

Commit

Permalink
src: add O_NOATIME constant
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Trott authored and evanlucas committed May 17, 2016
1 parent 6353579 commit 37736f4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/node_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,10 @@ void DefineSystemConstants(Local<Object> target) {
NODE_DEFINE_CONSTANT(target, O_EXCL);
#endif

#ifdef O_NOATIME
NODE_DEFINE_CONSTANT(target, O_NOATIME);
#endif

#ifdef O_NOFOLLOW
NODE_DEFINE_CONSTANT(target, O_NOFOLLOW);
#endif
Expand Down
11 changes: 11 additions & 0 deletions test/parallel/test-process-constants-noatime.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'use strict';

require('../common');
const assert = require('assert');

const isLinux = process.platform === 'linux';

const O_NOATIME = process.binding('constants').O_NOATIME;
const expected = isLinux ? 0x40000 : undefined;

assert.strictEqual(O_NOATIME, expected);

0 comments on commit 37736f4

Please sign in to comment.