File tree Expand file tree Collapse file tree 7 files changed +71
-22
lines changed
unix/linux_like/linux/gnu Expand file tree Collapse file tree 7 files changed +71
-22
lines changed Original file line number Diff line number Diff line change 22//!
33//! * Headers: <https://sourceware.org/git/?p=glibc.git> (official)
44//! * Headers: <https://github.com/bminor/glibc> (mirror)
5+ //!
6+ //! This module structure is modeled after glibc's source tree. Its build system selects headers
7+ //! from different locations based on the platform, which we mimic here with reexports.
8+
9+ /// Source directory: `posix/`
10+ ///
11+ /// <https://github.com/bminor/glibc/tree/master/posix>
12+ mod posix {
13+ pub ( crate ) mod unistd;
14+ }
15+
16+ /// Source directory: `sysdeps/`
17+ ///
18+ /// <https://github.com/bminor/glibc/tree/master/sysdeps>
19+ mod sysdeps {
20+ #[ cfg( target_family = "unix" ) ]
21+ pub ( crate ) mod unix;
22+ }
523
6- pub ( crate ) mod unistd;
24+ pub ( crate ) use posix:: * ;
25+ #[ cfg( target_os = "linux" ) ]
26+ pub ( crate ) use sysdeps:: unix:: linux:: * ;
Original file line number Diff line number Diff line change 11//! Header: `unistd.h`
2+ //!
3+ //! <https://github.com/bminor/glibc/blob/master/posix/unistd.h>
24
35pub use crate :: new:: common:: posix:: unistd:: {
46 STDERR_FILENO ,
Original file line number Diff line number Diff line change 1+ //! Source directory: `sysdeps/unix/sysv/linux` (the `sysv` is flattened).
2+ //!
3+ //! <https://github.com/bminor/glibc/tree/master/sysdeps/unix/sysv/linux>
4+
5+ /// Directory: `net/`
6+ ///
7+ /// Source directory: `sysdeps/unix/sysv/linux/net`
8+ pub ( crate ) mod net {
9+ pub ( crate ) mod route;
10+ }
Original file line number Diff line number Diff line change 1+ //! Header: `net/route.h`
2+ //!
3+ //! Source header: `sysdeps/unix/sysv/linux/net/route.h`
4+ //! <https://github.com/bminor/glibc/blob/master/sysdeps/unix/sysv/linux/net/route.h>
5+
6+ use crate :: prelude:: * ;
7+
8+ s ! {
9+ pub struct rtentry {
10+ pub rt_pad1: c_ulong,
11+ pub rt_dst: crate :: sockaddr,
12+ pub rt_gateway: crate :: sockaddr,
13+ pub rt_genmask: crate :: sockaddr,
14+ pub rt_flags: c_ushort,
15+ pub rt_pad2: c_short,
16+ pub rt_pad3: c_ulong,
17+ pub rt_tos: c_uchar,
18+ pub rt_class: c_uchar,
19+ // FIXME(1.0): private padding fields
20+ #[ cfg( target_pointer_width = "64" ) ]
21+ pub rt_pad4: [ c_short; 3usize ] ,
22+ #[ cfg( not( target_pointer_width = "64" ) ) ]
23+ pub rt_pad4: c_short,
24+ pub rt_metric: c_short,
25+ pub rt_dev: * mut c_char,
26+ pub rt_mtu: c_ulong,
27+ pub rt_window: c_ulong,
28+ pub rt_irtt: c_ushort,
29+ }
30+ }
Original file line number Diff line number Diff line change 1+ //! Source directory: `sysdeps/unix/`
2+ //!
3+ //! <https://github.com/bminor/glibc/tree/master/sysdeps/unix>
4+
5+ #[ cfg( target_os = "linux" ) ]
6+ pub ( crate ) mod linux;
Original file line number Diff line number Diff line change @@ -177,6 +177,8 @@ cfg_if! {
177177 pub use linux:: can:: raw:: * ;
178178 pub use linux:: can:: * ;
179179 pub use linux:: keyctl:: * ;
180+ #[ cfg( target_env = "gnu" ) ]
181+ pub use net:: route:: * ;
180182 } else if #[ cfg( target_vendor = "apple" ) ] {
181183 pub use signal:: * ;
182184 }
Original file line number Diff line number Diff line change @@ -131,27 +131,6 @@ s! {
131131 pub nm_gid: u32 ,
132132 }
133133
134- pub struct rtentry {
135- pub rt_pad1: c_ulong,
136- pub rt_dst: crate :: sockaddr,
137- pub rt_gateway: crate :: sockaddr,
138- pub rt_genmask: crate :: sockaddr,
139- pub rt_flags: c_ushort,
140- pub rt_pad2: c_short,
141- pub rt_pad3: c_ulong,
142- pub rt_tos: c_uchar,
143- pub rt_class: c_uchar,
144- #[ cfg( target_pointer_width = "64" ) ]
145- pub rt_pad4: [ c_short; 3usize ] ,
146- #[ cfg( not( target_pointer_width = "64" ) ) ]
147- pub rt_pad4: c_short,
148- pub rt_metric: c_short,
149- pub rt_dev: * mut c_char,
150- pub rt_mtu: c_ulong,
151- pub rt_window: c_ulong,
152- pub rt_irtt: c_ushort,
153- }
154-
155134 pub struct ntptimeval {
156135 pub time: crate :: timeval,
157136 pub maxerror: c_long,
You can’t perform that action at this time.
0 commit comments