From 450e7b988f67ea6c541ad2dc7f71dd7c3a0f4ff5 Mon Sep 17 00:00:00 2001
From: Dan Gohman
Date: Tue, 14 Jan 2025 17:11:25 -0800
Subject: [PATCH 1/2] Document the `link` function's error conditions.
Document that `link` fails if old-path doesn't exist or isn't a file,
or if new-path already exists.
---
wit/types.wit | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/wit/types.wit b/wit/types.wit
index d229a21..6ca962c 100644
--- a/wit/types.wit
+++ b/wit/types.wit
@@ -508,6 +508,10 @@ interface types {
/// Create a hard link.
///
+ /// Fails with `error-code::no-entry` if the old path does not exist,
+ /// with `error-code::exist` if the new path already exists, and
+ /// `error-code::not-permitted` if the old path is not a file.
+ ///
/// Note: This is similar to `linkat` in POSIX.
@since(version = 0.2.0)
link-at: func(
From 8dad6ca44ddc6e6a917db6d2395765792b3c4141 Mon Sep 17 00:00:00 2001
From: Dan Gohman
Date: Tue, 14 Jan 2025 17:17:45 -0800
Subject: [PATCH 2/2] Autogenerate imports.md.
---
imports.md | 3 +++
1 file changed, 3 insertions(+)
diff --git a/imports.md b/imports.md
index 03cccfb..869a4bb 100644
--- a/imports.md
+++ b/imports.md
@@ -1157,6 +1157,9 @@ WASI.
[method]descriptor.link-at: func
Create a hard link.
+Fails with error-code::no-entry if the old path does not exist,
+with error-code::exist if the new path already exists, and
+error-code::not-permitted if the old path is not a file.
Note: This is similar to linkat in POSIX.
Params