summaryrefslogtreecommitdiffstats
path: root/vendor/libc/src/unix/newlib/mod.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /vendor/libc/src/unix/newlib/mod.rs
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/libc/src/unix/newlib/mod.rs')
-rw-r--r--vendor/libc/src/unix/newlib/mod.rs63
1 files changed, 36 insertions, 27 deletions
diff --git a/vendor/libc/src/unix/newlib/mod.rs b/vendor/libc/src/unix/newlib/mod.rs
index ce84f1421..a572cc38b 100644
--- a/vendor/libc/src/unix/newlib/mod.rs
+++ b/vendor/libc/src/unix/newlib/mod.rs
@@ -1,13 +1,7 @@
pub type blkcnt_t = i32;
pub type blksize_t = i32;
-cfg_if! {
- if #[cfg(target_os = "vita")] {
- pub type clockid_t = ::c_uint;
- } else {
- pub type clockid_t = ::c_ulong;
- }
-}
+pub type clockid_t = ::c_ulong;
cfg_if! {
if #[cfg(any(target_os = "espidf"))] {
@@ -170,16 +164,6 @@ s! {
pub sa_flags: ::c_int,
}
- pub struct dirent {
- #[cfg(not(target_os = "vita"))]
- pub d_ino: ino_t,
- #[cfg(not(target_os = "vita"))]
- pub d_type: ::c_uchar,
- #[cfg(target_os = "vita")]
- __offset: [u8; 88],
- pub d_name: [::c_char; 256usize],
- }
-
pub struct stack_t {
pub ss_sp: *mut ::c_void,
pub ss_flags: ::c_int,
@@ -546,8 +530,16 @@ pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection
pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
-pub const TCP_NODELAY: ::c_int = 8193;
-pub const TCP_MAXSEG: ::c_int = 8194;
+cfg_if! {
+ if #[cfg(target_os = "vita")] {
+ pub const TCP_NODELAY: ::c_int = 1;
+ pub const TCP_MAXSEG: ::c_int = 2;
+ } else {
+ pub const TCP_NODELAY: ::c_int = 8193;
+ pub const TCP_MAXSEG: ::c_int = 8194;
+ }
+}
+
pub const TCP_NOPUSH: ::c_int = 4;
pub const TCP_NOOPT: ::c_int = 8;
pub const TCP_KEEPIDLE: ::c_int = 256;
@@ -561,13 +553,25 @@ cfg_if! {
pub const IP_TOS: ::c_int = 3;
}
}
-pub const IP_TTL: ::c_int = 8;
+cfg_if! {
+ if #[cfg(target_os = "vita")] {
+ pub const IP_TTL: ::c_int = 4;
+ } else {
+ pub const IP_TTL: ::c_int = 8;
+ }
+}
pub const IP_MULTICAST_IF: ::c_int = 9;
pub const IP_MULTICAST_TTL: ::c_int = 10;
pub const IP_MULTICAST_LOOP: ::c_int = 11;
-pub const IP_ADD_MEMBERSHIP: ::c_int = 11;
-pub const IP_DROP_MEMBERSHIP: ::c_int = 12;
-
+cfg_if! {
+ if #[cfg(target_os = "vita")] {
+ pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
+ pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
+ } else {
+ pub const IP_ADD_MEMBERSHIP: ::c_int = 11;
+ pub const IP_DROP_MEMBERSHIP: ::c_int = 12;
+ }
+}
pub const IPV6_UNICAST_HOPS: ::c_int = 4;
pub const IPV6_MULTICAST_IF: ::c_int = 9;
pub const IPV6_MULTICAST_HOPS: ::c_int = 10;
@@ -598,10 +602,15 @@ pub const NI_NAMEREQD: ::c_int = 4;
pub const NI_NUMERICSERV: ::c_int = 0;
pub const NI_DGRAM: ::c_int = 0;
-pub const EAI_FAMILY: ::c_int = -303;
-pub const EAI_MEMORY: ::c_int = -304;
-pub const EAI_NONAME: ::c_int = -305;
-pub const EAI_SOCKTYPE: ::c_int = -307;
+cfg_if! {
+ // Defined in vita/mod.rs for "vita"
+ if #[cfg(not(target_os = "vita"))] {
+ pub const EAI_FAMILY: ::c_int = -303;
+ pub const EAI_MEMORY: ::c_int = -304;
+ pub const EAI_NONAME: ::c_int = -305;
+ pub const EAI_SOCKTYPE: ::c_int = -307;
+ }
+}
pub const EXIT_SUCCESS: ::c_int = 0;
pub const EXIT_FAILURE: ::c_int = 1;