Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
process: add O_NOATIME constant
Add O_NOATIME flag on Linux for use with `fs.open()`.

PR-URL: #6492
Fixes: #2182
  • Loading branch information
Trott committed Apr 30, 2016
commit cf4c83c8c920470f2225f0162129a009b09d2d09
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);