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 BethGriggs committed Feb 6, 2020
1 parent ceca549 commit 95eb1c2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/api/fs.md
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 95eb1c2

Please sign in to comment.