diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/libc/src/unix/newlib | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/libc/src/unix/newlib')
-rw-r--r-- | vendor/libc/src/unix/newlib/mod.rs | 44 | ||||
-rw-r--r-- | vendor/libc/src/unix/newlib/vita/mod.rs | 68 |
2 files changed, 83 insertions, 29 deletions
diff --git a/vendor/libc/src/unix/newlib/mod.rs b/vendor/libc/src/unix/newlib/mod.rs index d46844268..ce84f1421 100644 --- a/vendor/libc/src/unix/newlib/mod.rs +++ b/vendor/libc/src/unix/newlib/mod.rs @@ -1,12 +1,23 @@ pub type blkcnt_t = i32; pub type blksize_t = i32; -pub type clockid_t = ::c_ulong; cfg_if! { - if #[cfg(target_os = "espidf")] { + if #[cfg(target_os = "vita")] { + pub type clockid_t = ::c_uint; + } else { + pub type clockid_t = ::c_ulong; + } +} + +cfg_if! { + if #[cfg(any(target_os = "espidf"))] { pub type dev_t = ::c_short; pub type ino_t = ::c_ushort; pub type off_t = ::c_long; + } else if #[cfg(any(target_os = "vita"))] { + pub type dev_t = ::c_short; + pub type ino_t = ::c_ushort; + pub type off_t = ::c_int; } else { pub type dev_t = u32; pub type ino_t = u32; @@ -160,8 +171,12 @@ s! { } 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], } @@ -219,12 +234,11 @@ s! { } pub struct pthread_attr_t { // Unverified - __size: [u64; 7] + __size: [u8; __SIZEOF_PTHREAD_ATTR_T] } pub struct pthread_rwlockattr_t { // Unverified - __lockkind: ::c_int, - __pshared: ::c_int, + __size: [u8; __SIZEOF_PTHREAD_RWLOCKATTR_T] } } @@ -241,6 +255,7 @@ align_const! { }; } pub const NCCS: usize = 32; + cfg_if! { if #[cfg(target_os = "espidf")] { const __PTHREAD_INITIALIZER_BYTE: u8 = 0xff; @@ -251,6 +266,17 @@ cfg_if! { pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 8; pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 4; pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 12; + pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; + } else if #[cfg(target_os = "vita")] { + const __PTHREAD_INITIALIZER_BYTE: u8 = 0xff; + pub const __SIZEOF_PTHREAD_ATTR_T: usize = 4; + pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 4; + pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; + pub const __SIZEOF_PTHREAD_COND_T: usize = 4; + pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; + pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 4; + pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 4; + pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 4; } else { const __PTHREAD_INITIALIZER_BYTE: u8 = 0; pub const __SIZEOF_PTHREAD_ATTR_T: usize = 56; @@ -260,9 +286,10 @@ cfg_if! { pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; + pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; } } -pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; + pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4; pub const __PTHREAD_MUTEX_HAVE_PREV: usize = 1; pub const __PTHREAD_RWLOCK_INT_FLAGS_SHARED: usize = 1; @@ -273,6 +300,8 @@ pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2; cfg_if! { if #[cfg(any(target_os = "horizon", target_os = "espidf"))] { pub const FD_SETSIZE: usize = 64; + } else if #[cfg(target_os = "vita")] { + pub const FD_SETSIZE: usize = 256; } else { pub const FD_SETSIZE: usize = 1024; } @@ -498,8 +527,7 @@ pub const SOCK_CLOEXEC: ::c_int = O_CLOEXEC; pub const INET_ADDRSTRLEN: ::c_int = 16; -// https://github. -// com/bminor/newlib/blob/master/newlib/libc/sys/linux/include/net/if.h#L121 +// https://github.com/bminor/newlib/blob/HEAD/newlib/libc/sys/linux/include/net/if.h#L121 pub const IFF_UP: ::c_int = 0x1; // interface is up pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging diff --git a/vendor/libc/src/unix/newlib/vita/mod.rs b/vendor/libc/src/unix/newlib/vita/mod.rs index 801a408b9..6e2e4d3eb 100644 --- a/vendor/libc/src/unix/newlib/vita/mod.rs +++ b/vendor/libc/src/unix/newlib/vita/mod.rs @@ -6,68 +6,96 @@ pub type wchar_t = u32; pub type c_long = i32; pub type c_ulong = u32; +pub type sigset_t = ::c_ulong; + s! { pub struct sockaddr { + pub sa_len: u8, pub sa_family: ::sa_family_t, pub sa_data: [::c_char; 14], } pub struct sockaddr_in6 { + pub sin6_len: u8, pub sin6_family: ::sa_family_t, pub sin6_port: ::in_port_t, pub sin6_flowinfo: u32, pub sin6_addr: ::in6_addr, + pub sin6_vport: ::in_port_t, pub sin6_scope_id: u32, } pub struct sockaddr_in { + pub sin_len: u8, pub sin_family: ::sa_family_t, pub sin_port: ::in_port_t, pub sin_addr: ::in_addr, - pub sin_zero: [u8; 8], + pub sin_vport: ::in_port_t, + pub sin_zero: [u8; 6], } pub struct sockaddr_un { - pub sun_len: ::c_uchar, pub sun_family: ::sa_family_t, - pub sun_path: [::c_char; 104usize], + pub sun_path: [::c_char; 108usize], } pub struct sockaddr_storage { + pub ss_len: u8, pub ss_family: ::sa_family_t, - pub __ss_padding: [u8; 26], + pub __ss_pad1: [u8; 4], + pub __ss_align: i64, + pub __ss_pad2: [u8; 4], } - pub struct sched_param { pub sched_priority: ::c_int, } + + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_atime: ::time_t, + pub st_mtime: ::time_t, + pub st_ctime: ::time_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_spare4: [::c_long; 2usize], + } } pub const AF_UNIX: ::c_int = 1; -pub const AF_INET6: ::c_int = 23; +pub const AF_INET6: ::c_int = 24; -pub const FIONBIO: ::c_ulong = 0x8004667e; +pub const FIONBIO: ::c_ulong = 1; -pub const POLLIN: ::c_short = 1; -pub const POLLPRI: ::c_short = 2; -pub const POLLOUT: ::c_short = 4; -pub const POLLERR: ::c_short = 8; -pub const POLLHUP: ::c_short = 16; -pub const POLLNVAL: ::c_short = 32; +pub const POLLIN: ::c_short = 0x0001; +pub const POLLPRI: ::c_short = POLLIN; +pub const POLLOUT: ::c_short = 0x0004; +pub const POLLERR: ::c_short = 0x0008; +pub const POLLHUP: ::c_short = 0x0010; +pub const POLLNVAL: ::c_short = 0x0020; pub const RTLD_DEFAULT: *mut ::c_void = 0 as *mut ::c_void; pub const SOL_SOCKET: ::c_int = 0xffff; +pub const SO_NONBLOCK: ::c_int = 0x1100; pub const MSG_OOB: ::c_int = 0x1; pub const MSG_PEEK: ::c_int = 0x2; pub const MSG_DONTROUTE: ::c_int = 0x4; -pub const MSG_WAITALL: ::c_int = 0x8; -pub const MSG_DONTWAIT: ::c_int = 0x10; -pub const MSG_NOSIGNAL: ::c_int = 0x20; -pub const MSG_TRUNC: ::c_int = 0x0100; -pub const MSG_CTRUNC: ::c_int = 0x0200; +pub const MSG_EOR: ::c_int = 0x8; +pub const MSG_TRUNC: ::c_int = 0x10; +pub const MSG_CTRUNC: ::c_int = 0x20; +pub const MSG_WAITALL: ::c_int = 0x40; +pub const MSG_DONTWAIT: ::c_int = 0x80; +pub const MSG_BCAST: ::c_int = 0x100; +pub const MSG_MCAST: ::c_int = 0x200; pub const UTIME_OMIT: c_long = -1; pub const AT_FDCWD: ::c_int = -2; @@ -111,7 +139,7 @@ pub const EAI_OVERFLOW: ::c_int = -12; pub const _SC_PAGESIZE: ::c_int = 8; pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 51; -pub const PTHREAD_STACK_MIN: ::size_t = 200; +pub const PTHREAD_STACK_MIN: ::size_t = 32 * 1024; extern "C" { pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; @@ -171,5 +199,3 @@ extern "C" { pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int; } - -pub use crate::unix::newlib::generic::{sigset_t, stat}; |