diff --git a/src/node_constants.cc b/src/node_constants.cc index 87443c95be1b6d..928502f6affca9 100644 --- a/src/node_constants.cc +++ b/src/node_constants.cc @@ -1036,6 +1036,10 @@ void DefineSystemConstants(Local 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 diff --git a/test/parallel/test-process-constants-noatime.js b/test/parallel/test-process-constants-noatime.js new file mode 100644 index 00000000000000..cf6b98f794157b --- /dev/null +++ b/test/parallel/test-process-constants-noatime.js @@ -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);