Skip to content

Commit 9058efa

Browse files
committed
reorg: Fill in the src/new structure
Ensure each library we provide bindings for has a home module in order to make it easier to fill things in. Where possible, I included a link to the source tree. There is also a new module `common` that contains definitions intended to be shared across multiple libraries. (backport <#4771>) (cherry picked from commit b295e78)
1 parent 7d79caa commit 9058efa

File tree

42 files changed

+272
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+272
-4
lines changed

src/new/aix/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//! IBM AIX libc.
2+
//!
3+
//! * Headers are not public
4+
//! * Manual pages: <https://www.ibm.com/docs/en/aix> (under "Technical reference" for that version)

src/new/common/bsd.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//! Interfaces common across the BSD family.

src/new/common/freebsd_like.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//! Interfaces common in FreeBSD-derived operating systems. This includes FreeBSD and DragonFlyBSD.

src/new/common/linux_like/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//! API that primarily comes from Linux but is also used other platforms (e.g. Android).

src/new/common/mod.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//! Interfaces that are common across multiple platforms
2+
//!
3+
//! We make these available everywhere but each platform must opt in to reexporting.
4+
//!
5+
//! There shouldn't be any repeated definitions or complex configuration in this module. On
6+
//! platforms that don't use common APIs it is fine to use `#[cfg(not(...))]`, but if a platform
7+
//! needs a custom definition then it should be defined in the platform-specific module.
8+
//!
9+
//! The goal is that platforms need to opt in to the definitions here, so that worst case we have
10+
//! an unused warning on untested platforms (rather than exposing incorrect API).
11+
12+
#[cfg(any(
13+
target_vendor = "apple",
14+
target_os = "dragonfly",
15+
target_os = "freebsd",
16+
target_os = "netbsd",
17+
target_os = "openbsd",
18+
))]
19+
mod bsd;
20+
21+
#[cfg(any(
22+
target_os = "android",
23+
target_os = "emscripten",
24+
target_os = "l4re",
25+
target_os = "linux",
26+
))]
27+
mod linux_like;
28+
29+
#[cfg(any(target_os = "dragonfly", target_os = "freebsd"))]
30+
mod freebsd_like;
31+
32+
#[cfg(any(target_os = "netbsd", target_os = "openbsd"))]
33+
mod netbsd_like;
34+
35+
#[cfg(any(target_os = "illumos", target_os = "solaris"))]
36+
mod solarish;
37+
38+
mod posix;

src/new/common/netbsd_like.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//! Interfaces common in NetBSD-derived operating systems. This includes NetBSD and OpenBSD.

src/new/common/posix/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//! POSIX APIs that are used by a number of platforms

src/new/common/solarish.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//! Interfaces common in solaris-derived operating systems. This includes Solaris and Illumos.

src/new/cygwin/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
//! Cygwin libc.
2+
//!
3+
//! * Headers: <https://github.com/cygwin/cygwin/tree/main/winsup/cygwin/include>

src/new/dragonfly/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//! DragonFly BSD libc.
2+
//!
3+
//! * Headers: <https://github.com/DragonFlyBSD/DragonFlyBSD>
4+
//! * Manual pages: <https://leaf.dragonflybsd.org/cgi/web-man>

0 commit comments

Comments
 (0)