-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add support for QNX Neutrino to standard library #106673
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
Changes from all commits
8f41570
3ce2cd0
f1a399c
cef9d4c
a510715
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
#![stable(feature = "metadata_ext", since = "1.1.0")] | ||
|
||
use crate::fs::Metadata; | ||
use crate::sys_common::AsInner; | ||
|
||
#[stable(feature = "metadata_ext", since = "1.1.0")] | ||
pub trait MetadataExt { | ||
#[stable(feature = "metadata_ext2", since = "1.8.0")] | ||
fn st_dev(&self) -> u64; | ||
#[stable(feature = "metadata_ext2", since = "1.8.0")] | ||
fn st_ino(&self) -> u64; | ||
#[stable(feature = "metadata_ext2", since = "1.8.0")] | ||
fn st_mode(&self) -> u32; | ||
#[stable(feature = "metadata_ext2", since = "1.8.0")] | ||
fn st_nlink(&self) -> u64; | ||
#[stable(feature = "metadata_ext2", since = "1.8.0")] | ||
fn st_uid(&self) -> u32; | ||
#[stable(feature = "metadata_ext2", since = "1.8.0")] | ||
fn st_gid(&self) -> u32; | ||
#[stable(feature = "metadata_ext2", since = "1.8.0")] | ||
fn st_rdev(&self) -> u64; | ||
#[stable(feature = "metadata_ext2", since = "1.8.0")] | ||
fn st_size(&self) -> u64; | ||
#[stable(feature = "metadata_ext2", since = "1.8.0")] | ||
fn st_atime(&self) -> i64; | ||
#[stable(feature = "metadata_ext2", since = "1.8.0")] | ||
fn st_atime_nsec(&self) -> i64; | ||
#[stable(feature = "metadata_ext2", since = "1.8.0")] | ||
fn st_mtime(&self) -> i64; | ||
#[stable(feature = "metadata_ext2", since = "1.8.0")] | ||
fn st_mtime_nsec(&self) -> i64; | ||
#[stable(feature = "metadata_ext2", since = "1.8.0")] | ||
fn st_ctime(&self) -> i64; | ||
#[stable(feature = "metadata_ext2", since = "1.8.0")] | ||
fn st_ctime_nsec(&self) -> i64; | ||
#[stable(feature = "metadata_ext2", since = "1.8.0")] | ||
fn st_blksize(&self) -> u64; | ||
#[stable(feature = "metadata_ext2", since = "1.8.0")] | ||
fn st_blocks(&self) -> u64; | ||
} | ||
|
||
#[stable(feature = "metadata_ext", since = "1.1.0")] | ||
impl MetadataExt for Metadata { | ||
fn st_dev(&self) -> u64 { | ||
self.as_inner().as_inner().st_dev as u64 | ||
} | ||
fn st_ino(&self) -> u64 { | ||
self.as_inner().as_inner().st_ino as u64 | ||
} | ||
fn st_mode(&self) -> u32 { | ||
self.as_inner().as_inner().st_mode as u32 | ||
} | ||
fn st_nlink(&self) -> u64 { | ||
self.as_inner().as_inner().st_nlink as u64 | ||
} | ||
fn st_uid(&self) -> u32 { | ||
self.as_inner().as_inner().st_uid as u32 | ||
} | ||
fn st_gid(&self) -> u32 { | ||
self.as_inner().as_inner().st_gid as u32 | ||
} | ||
fn st_rdev(&self) -> u64 { | ||
self.as_inner().as_inner().st_rdev as u64 | ||
} | ||
fn st_size(&self) -> u64 { | ||
self.as_inner().as_inner().st_size as u64 | ||
} | ||
fn st_atime(&self) -> i64 { | ||
self.as_inner().as_inner().st_atim.tv_sec as i64 | ||
} | ||
fn st_atime_nsec(&self) -> i64 { | ||
self.as_inner().as_inner().st_atim.tv_nsec as i64 | ||
} | ||
fn st_mtime(&self) -> i64 { | ||
self.as_inner().as_inner().st_mtim.tv_sec as i64 | ||
} | ||
fn st_mtime_nsec(&self) -> i64 { | ||
self.as_inner().as_inner().st_mtim.tv_nsec as i64 | ||
} | ||
fn st_ctime(&self) -> i64 { | ||
self.as_inner().as_inner().st_ctim.tv_sec as i64 | ||
} | ||
fn st_ctime_nsec(&self) -> i64 { | ||
self.as_inner().as_inner().st_ctim.tv_nsec as i64 | ||
} | ||
fn st_blksize(&self) -> u64 { | ||
self.as_inner().as_inner().st_blksize as u64 | ||
} | ||
fn st_blocks(&self) -> u64 { | ||
self.as_inner().as_inner().st_blocks as u64 | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#![stable(feature = "raw_ext", since = "1.1.0")] | ||
|
||
pub mod fs; | ||
pub(super) mod raw; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#![stable(feature = "raw_ext", since = "1.1.0")] | ||
#![deprecated( | ||
since = "1.8.0", | ||
note = "these type aliases are no longer supported by \ | ||
the standard library, the `libc` crate on \ | ||
crates.io should be used instead for the correct \ | ||
definitions" | ||
)] | ||
#![allow(deprecated)] | ||
|
||
use crate::os::raw::c_int; | ||
|
||
#[stable(feature = "raw_ext", since = "1.1.0")] | ||
pub type dev_t = u32; | ||
#[stable(feature = "raw_ext", since = "1.1.0")] | ||
pub type mode_t = u32; | ||
|
||
#[stable(feature = "pthread_t", since = "1.8.0")] | ||
pub type pthread_t = c_int; | ||
|
||
#[doc(inline)] | ||
#[stable(feature = "raw_ext", since = "1.1.0")] | ||
pub use self::arch::{blkcnt_t, blksize_t, ino_t, nlink_t, off_t, time_t}; | ||
|
||
mod arch { | ||
use crate::os::raw::c_long; | ||
|
||
#[stable(feature = "raw_ext", since = "1.1.0")] | ||
pub type blkcnt_t = i64; | ||
#[stable(feature = "raw_ext", since = "1.1.0")] | ||
pub type blksize_t = i32; | ||
#[stable(feature = "raw_ext", since = "1.1.0")] | ||
pub type ino_t = u64; | ||
#[stable(feature = "raw_ext", since = "1.1.0")] | ||
pub type nlink_t = u32; | ||
#[stable(feature = "raw_ext", since = "1.1.0")] | ||
pub type off_t = i64; | ||
#[stable(feature = "raw_ext", since = "1.1.0")] | ||
pub type time_t = c_long; | ||
} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -185,6 +185,17 @@ pub mod os { | |
pub const EXE_EXTENSION: &str = ""; | ||
} | ||
|
||
#[cfg(target_os = "nto")] | ||
pub mod os { | ||
pub const FAMILY: &str = "unix"; | ||
pub const OS: &str = "nto"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, this is definitely not... a blocking "concern", or even really a concern. But it's bugging me, I gotta know... why "nto" and not "neutrino"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is best answered by @gh-tr. It is a common abbreviation for Neutrino. For example, when performing conditional compilation in $ ntox86_64-gcc -dumpmachine
x86_64-pc-nto-qnx7.1.0 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not all of our build triples use the same name for their OS name, see |
||
pub const DLL_PREFIX: &str = "lib"; | ||
pub const DLL_SUFFIX: &str = ".so"; | ||
pub const DLL_EXTENSION: &str = "so"; | ||
pub const EXE_SUFFIX: &str = ""; | ||
pub const EXE_EXTENSION: &str = ""; | ||
} | ||
|
||
#[cfg(target_os = "redox")] | ||
pub mod os { | ||
pub const FAMILY: &str = "unix"; | ||
|
Uh oh!
There was an error while loading. Please reload this page.