Skip to content

Commit

Permalink
Add notes about "take-charge" mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Sep 11, 2023
1 parent 0944c51 commit c41131e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
5 changes: 4 additions & 1 deletion c-gull/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
4 changes: 4 additions & 0 deletions c-scape/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c41131e

Please sign in to comment.