* Requests for all data for the open file descriptor * to be flushed to the storage device. * @param {number} fd * @param {(err?: Error) => any} callback * @returns {void}
(fd, callback)
| 1536 | * @returns {void} |
| 1537 | */ |
| 1538 | function fsync(fd, callback) { |
| 1539 | callback = makeCallback(callback); |
| 1540 | |
| 1541 | const h = vfsState.handlers; |
| 1542 | if (h !== null && vfsVoid(h.fsync(fd), callback)) return; |
| 1543 | |
| 1544 | const req = new FSReqCallback(); |
| 1545 | req.oncomplete = callback; |
| 1546 | if (permission.isEnabled()) { |
| 1547 | callback(new ERR_ACCESS_DENIED('fsync API is disabled when Permission Model is enabled.')); |
| 1548 | return; |
| 1549 | } |
| 1550 | binding.fsync(fd, req); |
| 1551 | } |
| 1552 | |
| 1553 | /** |
| 1554 | * Synchronously requests for all data for the open |
nothing calls this directly
no test coverage detected
searching dependent graphs…