| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent af304b2 commit a814a55
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2869,6 +2869,11 @@ The following constants are meant for use with `fs.open()`. | |||
| 2869 | 2869 | <td><code>O_SYNC</code></td> | |
| 2870 | 2870 | <td>Flag indicating that the file is opened for synchronous I/O.</td> | |
| 2871 | 2871 | </tr> | |
| 2872 | + <tr> | ||
| 2873 | + <td><code>O_DSYNC</code></td> | ||
| 2874 | + <td>Flag indicating that the file is opened for synchronous I/O | ||
| 2875 | + with write operations waiting for data integrity.</td> | ||
| 2876 | + </tr> | ||
| 2872 | 2877 | <tr> | |
| 2873 | 2878 | <td><code>O_SYMLINK</code></td> | |
| 2874 | 2879 | <td>Flag indicating to open the symbolic link itself rather than the | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1085,6 +1085,11 @@ void DefineSystemConstants(Local<Object> target) { | |||
| 1085 | 1085 | NODE_DEFINE_CONSTANT(target, O_SYNC); | |
| 1086 | 1086 | #endif | |
| 1087 | 1087 | ||
| 1088 | + #ifdef O_DSYNC | ||
| 1089 | + NODE_DEFINE_CONSTANT(target, O_DSYNC); | ||
| 1090 | + #endif | ||
| 1091 | + | ||
| 1092 | + | ||
| 1088 | 1093 | #ifdef O_SYMLINK | |
| 1089 | 1094 | NODE_DEFINE_CONSTANT(target, O_SYMLINK); | |
| 1090 | 1095 | #endif | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,9 +21,8 @@ | |||
| 21 | 21 | ||
| 22 | 22 | // Flags: --expose_internals | |
| 23 | 23 | 'use strict'; | |
| 24 | - require('../common'); | ||
| 24 | + const common = require('../common'); | ||
| 25 | 25 | const assert = require('assert'); | |
| 26 | - | ||
| 27 | 26 | const fs = require('fs'); | |
| 28 | 27 | ||
| 29 | 28 | const O_APPEND = fs.constants.O_APPEND || 0; | |
@@ -32,6 +31,7 @@ const O_EXCL = fs.constants.O_EXCL || 0; | |||
| 32 | 31 | const O_RDONLY = fs.constants.O_RDONLY || 0; | |
| 33 | 32 | const O_RDWR = fs.constants.O_RDWR || 0; | |
| 34 | 33 | const O_SYNC = fs.constants.O_SYNC || 0; | |
| 34 | + const O_DSYNC = fs.constants.O_DSYNC || 0; | ||
| 35 | 35 | const O_TRUNC = fs.constants.O_TRUNC || 0; | |
| 36 | 36 | const O_WRONLY = fs.constants.O_WRONLY || 0; | |
| 37 | 37 | ||
@@ -79,6 +79,14 @@ assert.throws( | |||
| 79 | 79 | /^Error: Unknown file open flag: null$/ | |
| 80 | 80 | ); | |
| 81 | 81 | ||
| 82 | + if (common.isLinux === true) { | ||
| 83 | + const file = `${__dirname}/../fixtures/a.js`; | ||
| 84 | + | ||
| 85 | + fs.open(file, O_DSYNC, common.mustCall(function(err, fd) { | ||
| 86 | + assert.ifError(err); | ||
| 87 | + })); | ||
| 88 | + } | ||
| 89 | + | ||
| 82 | 90 | function escapeRegExp(string) { | |
| 83 | 91 | return string.replace(/[\\^$*+?.()|[\]{}]/g, '\\$&'); | |
| 84 | 92 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments