Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: introduce sys module #550

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nomt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ libc = "0.2.155"
criterion = { version = "0.3", optional = true }
thread_local = "1.1.8"
fs2 = "0.4.3"
cfg-if = "1.0.0"

[target.'cfg(target_os="linux")'.dependencies]
io-uring = "0.6.4"
Expand Down
1 change: 1 addition & 0 deletions nomt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ mod rw_pass_cell;
mod seek;
mod seglog;
mod store;
mod sys;

mod io;

Expand Down
1 change: 1 addition & 0 deletions nomt/src/sys/linux.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//! Linux-specific code.
1 change: 1 addition & 0 deletions nomt/src/sys/macos.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//! macOS-specific code.
13 changes: 13 additions & 0 deletions nomt/src/sys/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//! Platform-specific code.
//!
//! At the moment we only target Linux and macOS.

cfg_if::cfg_if! {
if #[cfg(target_os = "linux")] {
pub mod linux;
pub mod unix;
} else if #[cfg(target_os = "macos")] {
pub mod macos;
pub mod unix;
}
}
2 changes: 2 additions & 0 deletions nomt/src/sys/unix.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//! Common Unix definitions.