summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/_fs/_fs_fdatasync.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ext/node/polyfills/_fs/_fs_fdatasync.ts')
-rw-r--r--ext/node/polyfills/_fs/_fs_fdatasync.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/node/polyfills/_fs/_fs_fdatasync.ts b/ext/node/polyfills/_fs/_fs_fdatasync.ts
new file mode 100644
index 000000000..325ac30da
--- /dev/null
+++ b/ext/node/polyfills/_fs/_fs_fdatasync.ts
@@ -0,0 +1,13 @@
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+import { CallbackWithError } from "internal:deno_node/polyfills/_fs/_fs_common.ts";
+
+export function fdatasync(
+ fd: number,
+ callback: CallbackWithError,
+) {
+ Deno.fdatasync(fd).then(() => callback(null), callback);
+}
+
+export function fdatasyncSync(fd: number) {
+ Deno.fdatasyncSync(fd);
+}