Skip to content

refactor liblibc into finer-grained crates #17547

Closed
@aturon

Description

@aturon

The libc crate currently provides a large set of bindings to C APIs. Some of these are cross-platform. But the crate also exports a large number of platform-specific APIs.

It was initially carefully organized according to various standards, but over time it has become a dumping ground for bindings.

As part of the runtime removal RFC we would like to refactor the crate into smaller pieces:

  • liblibc should provide fully cross-platform C APIs. This should roughly correspond to the export list currently at the top of liblibc/lib.rs, and encompasses universal C bindings.
  • libunix should provide APIs that are available for any #[cfg(unix)] platform.
  • libwindows should provide APIs that are available for any #[cfg(windows)] platform.

Ultimately, we are likely to add additional crates like liblinux to provide even more specific sets of bindings.

Due to the top-level exports in liblibc, it should be possible to do this refactoring without overly painful breakage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-FFIArea: Foreign function interface (FFI)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions