| 1 |
[![Build Status][travis_ci_badge]][travis_ci] [![Latest Version]][crates.io] [![docs]][docs.rs] |
| 2 |
|
| 3 |
A Rust interface to the **user-space** API of the Mach 3.0 kernel exposed in |
| 4 |
`/usr/include/mach` that underlies macOS and is linked via `libSystem` (and |
| 5 |
`libsystem_kernel`). |
| 6 |
|
| 7 |
This library does not expose the **kernel-space** API of the Mach 3.0 kernel |
| 8 |
exposed in |
| 9 |
`SDK/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/mach`. |
| 10 |
|
| 11 |
That is, if you are writing a kernel-resident device drivers or some other |
| 12 |
kernel extensions you have to use something else. The user-space kernel API is |
| 13 |
often API-incompatible with the kernel space one, and even in the cases where |
| 14 |
they match, they are sometimes ABI incompatible such that using this library |
| 15 |
would have **undefined behavior**. |
| 16 |
|
| 17 |
# Usage |
| 18 |
|
| 19 |
Add the following to your `Cargo.toml` to conditionally include mach on those |
| 20 |
platforms that support it. |
| 21 |
|
| 22 |
```toml |
| 23 |
[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies.mach] |
| 24 |
version = "0.3" |
| 25 |
``` |
| 26 |
|
| 27 |
The following crate features are available: |
| 28 |
|
| 29 |
* **deprecated** (disabled by default): exposes deprecated APIs that have been |
| 30 |
removed from the latest versions of the MacOS SDKs. The behavior of using |
| 31 |
these APIs on MacOS versions that do not support them is undefined (hopefully |
| 32 |
a linker error). |
| 33 |
|
| 34 |
# Platform support |
| 35 |
|
| 36 |
The following table describes the current CI set-up: |
| 37 |
|
| 38 |
| Target | Min. Rust | XCode | build | ctest | run | |
| 39 |
|-----------------------|-----------|---------------|-------|-------|-----| |
| 40 |
| `x86_64-apple-darwin` | 1.33.0 | 6.4 - 10.0 | ✓ | ✓ | ✓ | |
| 41 |
| `i686-apple-darwin` | 1.33.0 | 6.4 - 10.0 | ✓ | ✓ | ✓ | |
| 42 |
| `i386-apple-ios` | 1.33.0 | 6.4 - 9.4 [0] | ✓ | - | - | |
| 43 |
| `x86_64-apple-ios` | 1.33.0 | 6.4 - 10.0 | ✓ | - | - | |
| 44 |
| `armv7-apple-ios` | nightly | 6.4 - 10.0 | ✓ | - | - | |
| 45 |
| `aarch64-apple-ios` | nightly | 6.4 - 10.0 | ✓ | - | - | |
| 46 |
|
| 47 |
[0] `i386-apple-ios` is deprecated in XCode 10.0. |
| 48 |
|
| 49 |
[travis_ci]: https://travis-ci.org/fitzgen/mach |
| 50 |
[travis_ci_badge]: https://travis-ci.org/fitzgen/mach.png?branch=master |
| 51 |
[crates.io]: https://crates.io/crates/mach |
| 52 |
[Latest Version]: https://img.shields.io/crates/v/mach.svg |
| 53 |
[docs]: https://docs.rs/mach/badge.svg |
| 54 |
[docs.rs]: https://docs.rs/mach/ |
| 55 |
|