From c41131e374b1a291be7c76d283cd10a5a483a970 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 11 Sep 2023 13:40:44 -0700 Subject: [PATCH] Add notes about "take-charge" mode. --- README.md | 6 +++++- c-gull/README.md | 5 ++++- c-scape/README.md | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c079713..44f7a0a 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,9 @@ c-ward has two main cargo features: "take-charge" and "coexist-with-libc". One of these must be enabled. In "take-charge" mode, c-ward takes charge of the process, handling program -startup (via origin) providing `malloc` (via c-scape), and other things. +startup (via origin) providing `malloc` (via c-scape), and other things. This +requires some additional setup; see the [c-scape-example] and [c-scape-example] +example crates for more details. In "coexist-with-libc" mode, c-ward can be used as a drop-in (partial) libc replacement, provided you're using nightly Rust. @@ -47,3 +49,5 @@ Another libc implementation is [relibc]. [c-scape]: https://crates.io/crates/c-scape [c-gull]: https://crates.io/crates/c-gull [relibc]: https://gitlab.redox-os.org/redox-os/relibc/ +[c-scape-example]: https://github.com/sunfishcode/c-ward/blob/main/example-crates/c-scape-example +[c-gull-example]: https://github.com/sunfishcode/c-ward/blob/main/example-crates/c-gull-example diff --git a/c-gull/README.md b/c-gull/README.md index 7c52cc3..0ab8148 100644 --- a/c-gull/README.md +++ b/c-gull/README.md @@ -38,7 +38,9 @@ c-gull has two main cargo features: "take-charge" and "coexist-with-libc". One of these must be enabled. In "take-charge" mode, c-gull takes charge of the process, handling program -startup (via origin) providing `malloc` (via c-scape), and other things. +startup (via origin) providing `malloc` (via c-scape), and other things. This +requires some additional setup; see the [c-gull-example] example crate for +more details. In "coexist-with-libc" mode, c-gull can be used as a drop-in (partial) libc replacement, provided you're using nightly Rust. To use it, just change your @@ -65,3 +67,4 @@ See the [libc-replacement example] for more details. [realpath-ext]: https://crates.io/crates/realpath-ext [tz-rs]: https://crates.io/crates/tz-rs [printf-compat]: https://crates.io/crates/printf-compat +[c-gull-example]: https://github.com/sunfishcode/c-ward/blob/main/example-crates/c-gull-example diff --git a/c-scape/README.md b/c-scape/README.md index 1772727..61c5f7d 100644 --- a/c-scape/README.md +++ b/c-scape/README.md @@ -19,4 +19,8 @@ allows it to be used by `std` itself. Similar to c-gull, c-scape has "take-charge" and "coexist-with-libc" modes. +"take-charge" mode requires some additional setup; see the [c-scape-example] +example crate for more details. + [c-gull]: https://crates.io/crates/c-gull +[c-scape-example]: https://github.com/sunfishcode/c-ward/blob/main/example-crates/c-scape-example