Skip to content

Commit

Permalink
process: 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: nodejs#6492
Fixes: nodejs#2182
  • Loading branch information
Trott committed Apr 30, 2016
1 parent bcce05d commit cf4c83c
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 cf4c83c

Please sign in to comment.