Skip to content

Commit

Permalink
doc: add note about fs.close() about undefined behavior
Browse files Browse the repository at this point in the history
Add notes to fs.close and fs.closeSync() about udnefined behavior.

PR-URL: #30966
Refs: #30864
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
ronag authored and targos committed Jan 14, 2020
1 parent d676c6c commit 42ccf22
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1533,6 +1533,9 @@ changes:
Asynchronous close(2). No arguments other than a possible exception are given
to the completion callback.

Calling `fs.close()` on any file descriptor (`fd`) that is currently in use
through any other `fs` operation may lead to undefined behavior.

## `fs.closeSync(fd)`
<!-- YAML
added: v0.1.21
Expand All @@ -1542,6 +1545,9 @@ added: v0.1.21

Synchronous close(2). Returns `undefined`.

Calling `fs.closeSync()` on any file descriptor (`fd`) that is currently in use
through any other `fs` operation may lead to undefined behavior.

## `fs.constants`

* {Object}
Expand Down

0 comments on commit 42ccf22

Please sign in to comment.