* Closes a file descriptor asynchronously. * @param {number} fd The file descriptor * @param {Function} callback Callback (err)
(fd, callback)
| 801 | * @param {Function} callback Callback (err) |
| 802 | */ |
| 803 | close(fd, callback) { |
| 804 | const vfd = getVirtualFd(fd); |
| 805 | if (!vfd) { |
| 806 | process.nextTick(callback, createEBADF('close')); |
| 807 | return; |
| 808 | } |
| 809 | |
| 810 | vfd.entry.close() |
| 811 | .then(() => { |
| 812 | closeVirtualFd(fd); |
| 813 | callback(null); |
| 814 | }, (err) => callback(err)); |
| 815 | } |
| 816 | |
| 817 | /** |
| 818 | * Reads from a file descriptor asynchronously. |
nothing calls this directly
no test coverage detected