Skip to content

Initial setup of glibc source reorganization #4540

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
6 changes: 6 additions & 0 deletions src/new/glibc/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cfg_if! {
if #[cfg(target_family = "unix")] {
mod unix;
pub use unix::*;
}
}
2 changes: 2 additions & 0 deletions src/new/glibc/unix/linux/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mod net;
pub use net::*;
2 changes: 2 additions & 0 deletions src/new/glibc/unix/linux/net/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mod route;
pub use route::*;
27 changes: 27 additions & 0 deletions src/new/glibc/unix/linux/net/route.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//! Header: `sysdeps/unix/sysv/linux/net/route.h`

use crate::prelude::*;

s! {
pub struct rtentry {
pub rt_pad1: c_ulong,
pub rt_dst: crate::sockaddr,
pub rt_gateway: crate::sockaddr,
pub rt_genmask: crate::sockaddr,
pub rt_flags: c_ushort,
pub rt_pad2: c_short,
pub rt_pad3: c_ulong,
pub rt_tos: c_uchar,
pub rt_class: c_uchar,
// FIXME(1.0): private padding fields
#[cfg(target_pointer_width = "64")]
pub rt_pad4: [c_short; 3usize],
#[cfg(not(target_pointer_width = "64"))]
pub rt_pad4: c_short,
pub rt_metric: c_short,
pub rt_dev: *mut c_char,
pub rt_mtu: c_ulong,
pub rt_window: c_ulong,
pub rt_irtt: c_ushort,
}
}
6 changes: 6 additions & 0 deletions src/new/glibc/unix/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cfg_if! {
if #[cfg(target_os = "linux")] {
mod linux;
pub use linux::*;
}
}
7 changes: 7 additions & 0 deletions src/new/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ cfg_if! {
pub use linux_uapi::*;
}
}

cfg_if! {
if #[cfg(all(target_os = "linux", target_env = "gnu"))] {
mod glibc;
pub use glibc::*;
}
}
21 changes: 0 additions & 21 deletions src/unix/linux_like/linux/gnu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,27 +131,6 @@ s! {
pub nm_gid: u32,
}

pub struct rtentry {
pub rt_pad1: c_ulong,
pub rt_dst: crate::sockaddr,
pub rt_gateway: crate::sockaddr,
pub rt_genmask: crate::sockaddr,
pub rt_flags: c_ushort,
pub rt_pad2: c_short,
pub rt_pad3: c_ulong,
pub rt_tos: c_uchar,
pub rt_class: c_uchar,
#[cfg(target_pointer_width = "64")]
pub rt_pad4: [c_short; 3usize],
#[cfg(not(target_pointer_width = "64"))]
pub rt_pad4: c_short,
pub rt_metric: c_short,
pub rt_dev: *mut c_char,
pub rt_mtu: c_ulong,
pub rt_window: c_ulong,
pub rt_irtt: c_ushort,
}

pub struct ntptimeval {
pub time: crate::timeval,
pub maxerror: c_long,
Expand Down
Loading