summaryrefslogtreecommitdiffstats
path: root/vendor/hermit-abi
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:29 +0000
commit631cd5845e8de329d0e227aaa707d7ea228b8f8f (patch)
treea1b87c8f8cad01cf18f7c5f57a08f102771ed303 /vendor/hermit-abi
parentAdding debian version 1.69.0+dfsg1-1. (diff)
downloadrustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.tar.xz
rustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/hermit-abi')
-rw-r--r--vendor/hermit-abi/.cargo-checksum.json2
-rw-r--r--vendor/hermit-abi/Cargo.toml13
-rw-r--r--vendor/hermit-abi/src/net.rs232
-rw-r--r--vendor/hermit-abi/src/net_old.rs302
4 files changed, 3 insertions, 546 deletions
diff --git a/vendor/hermit-abi/.cargo-checksum.json b/vendor/hermit-abi/.cargo-checksum.json
index cf3c5dd1a..3ccd7931e 100644
--- a/vendor/hermit-abi/.cargo-checksum.json
+++ b/vendor/hermit-abi/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"Cargo.toml":"4ffc8dbf9b604af97a6da408705aab39a38ad95c89f617b7edba629f4e759456","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"322fadd63e558e5a10caf980cbedf83ac1546ba40fd992f54492e21ce54205af","src/errno.rs":"1c0680ead2ddf26b12d34bd7fa3e1dab386df761d6ac1901889ece26682dc465","src/lib.rs":"f4a52715b97d947e3768368c3d8882d0d049a89e01600c4de396f3ffcc7911b9","src/net.rs":"b0c15011336f9469859ff537a1803c004b0f41c81a967d97dbaff5bb75c71f14","src/net_old.rs":"6cec0b9b50a0602848df05ea64e3fa7cf63be4ea40a634f64211e4a5463068f3","src/tcplistener.rs":"1fb1c0c232d4f24afb6cff63a7541d00029b7159da8d25b2eb257dff078940a0","src/tcpstream.rs":"fce8a598c6331b82e40982eda079d758be324b8941bf76f1031cea8d01632823"},"package":"856b5cb0902c2b6d65d5fd97dfa30f9b70c7538e770b98eab5ed52d8db923e01"} \ No newline at end of file
+{"files":{"Cargo.toml":"6fdf8fefd46c33cc6492ca69c19c9f49f0704401f3b1aaf0b3fbdbb828d2ddcf","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"322fadd63e558e5a10caf980cbedf83ac1546ba40fd992f54492e21ce54205af","src/errno.rs":"1c0680ead2ddf26b12d34bd7fa3e1dab386df761d6ac1901889ece26682dc465","src/lib.rs":"f4a52715b97d947e3768368c3d8882d0d049a89e01600c4de396f3ffcc7911b9","src/tcplistener.rs":"1fb1c0c232d4f24afb6cff63a7541d00029b7159da8d25b2eb257dff078940a0","src/tcpstream.rs":"fce8a598c6331b82e40982eda079d758be324b8941bf76f1031cea8d01632823"},"package":"fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286"} \ No newline at end of file
diff --git a/vendor/hermit-abi/Cargo.toml b/vendor/hermit-abi/Cargo.toml
index 30bb616ed..6ec8e2aa7 100644
--- a/vendor/hermit-abi/Cargo.toml
+++ b/vendor/hermit-abi/Cargo.toml
@@ -12,13 +12,9 @@
[package]
edition = "2021"
name = "hermit-abi"
-version = "0.3.0"
+version = "0.3.1"
authors = ["Stefan Lankes"]
-description = """
-hermit-abi is small interface to call functions from the unikernel RustyHermit.
-It is used to build the target `x86_64-unknown-hermit`.
-"""
-documentation = "https://hermitcore.github.io/rusty-hermit/hermit_abi"
+description = "Hermit system calls definitions."
readme = "README.md"
keywords = [
"unikernel",
@@ -29,10 +25,6 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/hermitcore/rusty-hermit"
resolver = "1"
-[package.metadata.docs.rs]
-features = ["docs"]
-default-target = "x86_64-unknown-hermit"
-
[dependencies.alloc]
version = "1.0.0"
optional = true
@@ -49,7 +41,6 @@ package = "rustc-std-workspace-core"
[features]
default = []
-docs = []
rustc-dep-of-std = [
"core",
"alloc",
diff --git a/vendor/hermit-abi/src/net.rs b/vendor/hermit-abi/src/net.rs
deleted file mode 100644
index 05ee2ca58..000000000
--- a/vendor/hermit-abi/src/net.rs
+++ /dev/null
@@ -1,232 +0,0 @@
-#![allow(nonstandard_style)]
-
-pub const AF_INET: i32 = 0;
-pub const AF_INET6: i32 = 1;
-pub const IPPROTO_IP: i32 = 0;
-pub const IPPROTO_IPV6: i32 = 41;
-pub const IPPROTO_TCP: i32 = 6;
-pub const IPV6_ADD_MEMBERSHIP: i32 = 12;
-pub const IPV6_DROP_MEMBERSHIP: i32 = 13;
-pub const IPV6_MULTICAST_LOOP: i32 = 19;
-pub const IPV6_V6ONLY: i32 = 27;
-pub const IP_TTL: i32 = 2;
-pub const IP_MULTICAST_TTL: i32 = 5;
-pub const IP_MULTICAST_LOOP: i32 = 7;
-pub const IP_ADD_MEMBERSHIP: i32 = 3;
-pub const IP_DROP_MEMBERSHIP: i32 = 4;
-pub const SHUT_RD: i32 = 0;
-pub const SHUT_RDWR: i32 = 2;
-pub const SHUT_WR: i32 = 1;
-pub const SOCK_DGRAM: i32 = 2;
-pub const SOCK_STREAM: i32 = 1;
-pub const SOL_SOCKET: i32 = 4095;
-pub const SO_BROADCAST: i32 = 32;
-pub const SO_ERROR: i32 = 4103;
-pub const SO_RCVTIMEO: i32 = 4102;
-pub const SO_REUSEADDR: i32 = 4;
-pub const SO_SNDTIMEO: i32 = 4101;
-pub const SO_LINGER: i32 = 128;
-pub const TCP_NODELAY: i32 = 1;
-pub const MSG_PEEK: i32 = 1;
-pub const FIONBIO: i32 = 0x8008667eu32 as i32;
-pub const EAI_NONAME: i32 = -2200;
-pub const EAI_SERVICE: i32 = -2201;
-pub const EAI_FAIL: i32 = -2202;
-pub const EAI_MEMORY: i32 = -2203;
-pub const EAI_FAMILY: i32 = -2204;
-pub type sa_family_t = u8;
-pub type socklen_t = u32;
-pub type in_addr_t = u32;
-pub type in_port_t = u16;
-pub type nfds_t = usize;
-
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct in_addr {
- pub s_addr: u32,
-}
-
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct in6_addr {
- pub s6_addr: [u8; 16],
-}
-
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct sockaddr {
- pub sa_len: u8,
- pub sa_family: sa_family_t,
- pub sa_data: [u8; 14],
-}
-
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-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],
-}
-
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct sockaddr_in6 {
- pub sin6_family: sa_family_t,
- pub sin6_port: in_port_t,
- pub sin6_addr: in6_addr,
- pub sin6_flowinfo: u32,
- pub sin6_scope_id: u32,
-}
-
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ip_mreq {
- pub imr_multiaddr: in_addr,
- pub imr_interface: in_addr,
-}
-
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ipv6_mreq {
- pub ipv6mr_multiaddr: in6_addr,
- pub ipv6mr_interface: u32,
-}
-
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct addrinfo {
- pub ai_flags: i32,
- pub ai_family: i32,
- pub ai_socktype: i32,
- pub ai_protocol: i32,
- pub ai_addrlen: socklen_t,
- pub ai_addr: *mut sockaddr,
- pub ai_canonname: *mut u8,
- pub ai_next: *mut addrinfo,
-}
-
-extern "C" {
- #[link_name = "sys_accept"]
- pub fn accept(s: i32, addr: *mut sockaddr, addrlen: *mut socklen_t) -> i32;
-
- #[link_name = "sys_bind"]
- pub fn bind(s: i32, name: *const sockaddr, namelen: socklen_t) -> i32;
-
- #[link_name = "sys_connect"]
- pub fn connect(s: i32, name: *const sockaddr, namelen: socklen_t) -> i32;
-
- #[link_name = "sys_close"]
- pub fn close(s: i32) -> i32;
-
- #[link_name = "sys_dup"]
- pub fn dup(s: i32) -> i32;
-
- #[link_name = "sys:getpeername"]
- pub fn getpeername(s: i32, name: *mut sockaddr, namelen: *mut socklen_t) -> i32;
-
- #[link_name = "sys_getsockname"]
- pub fn getsockname(s: i32, name: *mut sockaddr, namelen: *mut socklen_t) -> i32;
-
- #[link_name = "sys_getsockopt"]
- pub fn getsockopt(
- s: i32,
- level: i32,
- optname: i32,
- optval: *mut c_void,
- optlen: *mut socklen_t,
- ) -> i32;
-
- #[link_name = "sys_setsockopt"]
- pub fn setsockopt(
- s: i32,
- level: i32,
- optname: i32,
- optval: *const c_void,
- optlen: socklen_t,
- ) -> i32;
-
- #[link_name = "sys_ioctl"]
- pub fn ioctl(s: i32, cmd: c_long, argp: *mut c_void) -> i32;
-
- #[link_name = "sys_listen"]
- pub fn listen(s: i32, backlog: c_int) -> i32;
-
- #[link_name = "sys_poll"]
- pub fn pollfd(fds: *mut pollfd, nfds: nfds_t, timeout: i32);
-
- #[link_name = "sys_recv"]
- pub fn recv(s: c_int, mem: *mut c_void, len: size_t, flags: c_int) -> isize;
-
- #[link_name = "sys_read"]
- pub fn read(s: c_int, mem: *mut c_void, len: size_t) -> isize;
-
- #[link_name = "sys_readv"]
- pub fn readv(s: c_int, bufs: *const iovec, bufcnt: c_int) -> isize;
-
- #[link_name = "sys_recvfrom"]
- pub fn recvfrom(
- s: c_int,
- mem: *mut c_void,
- len: size_t,
- flags: c_int,
- from: *mut sockaddr,
- fromlen: *mut socklen_t,
- ) -> isize;
-
- #[link_name = "sys_send"]
- pub fn send(s: i32, mem: *const c_void, len: usize, flags: i32) -> isize;
-
- #[link_name = "sys_sendmsg"]
- pub fn sendmsg(s: c_int, message: *const msghdr, flags: c_int) -> isize;
-
- #[link_name = "sys_sendto"]
- pub fn sendto(
- s: c_int,
- mem: *const c_void,
- len: size_t,
- flags: c_int,
- to: *const sockaddr,
- tolen: socklen_t,
- ) -> ssize_t;
-
- #[link_name = "sys_shutdown"]
- pub fn shutdown(s: i32, how: i32) -> i32;
-
- #[link_name = "sys_socket"]
- pub fn socket(domain: i32, type_: i32, protocol: i32) -> i32;
-
- #[link_name = "sys_write"]
- pub fn write(s: c_int, mem: *const c_void, len: size_t) -> ssize_t;
-
- #[link_name = "sys_writev"]
- pub fn writev(s: c_int, bufs: *const iovec, bufcnt: c_int) -> ssize_t;
-
- #[link_name = "sys_freeaddrinfo"]
- pub fn freeaddrinfo(ai: *mut addrinfo);
-
- #[link_name = "sys_getaddrinfo"]
- pub fn getaddrinfo(
- nodename: *const u8,
- servname: *const u8,
- hints: *const addrinfo,
- res: *mut *mut addrinfo,
- ) -> i32;
-
- #[link_name = "sys_select"]
- pub fn select(
- maxfdp1: i32,
- readset: *mut fd_set,
- writeset: *mut fd_set,
- exceptset: *mut fd_set,
- timeout: *mut timeval,
- ) -> i32;
-
- #[link_name = "sys_pool"]
- pub fn poll(
- fds: *mut pollfd,
- nfds: nfds_t,
- timeout: i32
- ) -> i32;
-}
diff --git a/vendor/hermit-abi/src/net_old.rs b/vendor/hermit-abi/src/net_old.rs
deleted file mode 100644
index 93bfd55f0..000000000
--- a/vendor/hermit-abi/src/net_old.rs
+++ /dev/null
@@ -1,302 +0,0 @@
-#![allow(nonstandard_style)]
-use crate::errno::EINVAL;
-use crate::FileDescriptor;
-use libc::{c_char, c_int, c_uint, c_void, size_t, ssize_t};
-
-extern "C" {
- fn sys_hermit_socket(domain: i32, type_: i32, protocol: i32) -> FileDescriptor;
- fn sys_hermit_accept(
- s: FileDescriptor,
- addr: *mut sockaddr,
- addrlen: *mut socklen_t,
- ) -> FileDescriptor;
- fn sys_hermit_bind(s: FileDescriptor, name: *const sockaddr, namelen: socklen_t) -> i32;
- fn sys_hermit_listen(s: FileDescriptor, backlog: i32) -> i32;
- fn sys_hermit_shutdown(s: FileDescriptor, how: i32) -> i32;
- fn sys_hermit_getpeername(
- s: FileDescriptor,
- name: *mut sockaddr,
- namelen: *mut socklen_t,
- ) -> i32;
- fn sys_hermit_getsockname(
- s: FileDescriptor,
- name: *mut sockaddr,
- namelen: *mut socklen_t,
- ) -> i32;
- fn sys_hermit_getsockopt(
- s: FileDescriptor,
- level: i32,
- optname: i32,
- optval: *mut c_void,
- optlen: *const socklen_t,
- ) -> i32;
- fn sys_hermit_setsockopt(
- s: FileDescriptor,
- level: i32,
- optname: i32,
- optval: *const c_void,
- optlen: socklen_t,
- ) -> i32;
- fn sys_hermit_connect(s: FileDescriptor, name: *const sockaddr, namelen: socklen_t) -> i32;
- fn sys_hermit_getaddrinfo(
- nodename: *const c_char,
- servname: *const i8,
- hints: *const addrinfo,
- res: *mut *mut addrinfo,
- ) -> i32;
-}
-
-pub const AF_INET: i32 = 10;
-pub const AF_INET6: i32 = 2;
-pub const IPPROTO_IP: i32 = 0;
-pub const IPPROTO_IPV6: i32 = 41;
-pub const IPPROTO_TCP: i32 = 6;
-pub const IPV6_ADD_MEMBERSHIP: i32 = 12;
-pub const IPV6_DROP_MEMBERSHIP: i32 = 13;
-pub const IPV6_MULTICAST_LOOP: i32 = 19;
-pub const IPV6_V6ONLY: i32 = 27;
-pub const IP_TTL: i32 = 2;
-pub const IP_MULTICAST_TTL: i32 = 5;
-pub const IP_MULTICAST_LOOP: i32 = 7;
-pub const IP_ADD_MEMBERSHIP: i32 = 3;
-pub const IP_DROP_MEMBERSHIP: i32 = 4;
-pub const SHUT_READ: i32 = 0;
-pub const SHUT_WRITE: i32 = 1;
-pub const SHUT_BOTH: i32 = 2;
-pub const SOCK_DGRAM: i32 = 2;
-pub const SOCK_STREAM: i32 = 1;
-pub const SOL_SOCKET: i32 = 4095;
-pub const SO_BROADCAST: i32 = 32;
-pub const SO_ERROR: i32 = 4103;
-pub const SO_RCVTIMEO: i32 = 4102;
-pub const SO_REUSEADDR: i32 = 4;
-pub const SO_SNDTIMEO: i32 = 4101;
-pub const SO_LINGER: i32 = 128;
-pub const TCP_NODELAY: i32 = 1;
-pub const MSG_PEEK: i32 = 1;
-
-pub type sa_family_t = u8;
-pub type socklen_t = usize;
-pub type in_addr_t = u32;
-pub type in_port_t = u16;
-
-#[derive(Debug, Copy, Clone)]
-#[repr(C)]
-pub struct in_addr {
- pub s_addr: u32,
-}
-
-#[derive(Debug, Copy, Clone)]
-#[repr(C)]
-pub struct in6_addr {
- pub s6_addr: [u8; 16],
-}
-
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct sockaddr {
- pub sa_len: u8,
- pub sa_family: sa_family_t,
- pub sa_data: [u8; 14usize],
-}
-
-#[derive(Copy, Clone)]
-#[repr(C)]
-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_scope_id: u32,
-}
-
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-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; 8usize],
-}
-
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct iovec {
- pub iov_base: *mut c_void,
- pub iov_len: usize,
-}
-
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ip_mreq {
- pub imr_multiaddr: in_addr,
- pub imr_interface: in_addr,
-}
-
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ipv6_mreq {
- pub ipv6mr_multiaddr: in6_addr,
- pub ipv6mr_interface: c_uint,
-}
-
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct msghdr {
- pub msg_name: *mut c_void,
- pub msg_namelen: socklen_t,
- pub msg_iov: *mut iovec,
- pub msg_iovlen: c_int,
- pub msg_control: *mut c_void,
- pub msg_controllen: socklen_t,
- pub msg_flags: c_int,
-}
-
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct sockaddr_storage {
- pub s2_len: u8,
- pub ss_family: sa_family_t,
- pub s2_data1: [c_char; 2usize],
- pub s2_data2: [u32; 3usize],
-}
-
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct addrinfo {
- pub ai_flags: c_int,
- pub ai_family: c_int,
- pub ai_socktype: c_int,
- pub ai_protocol: c_int,
- pub ai_addrlen: socklen_t,
- pub ai_addr: *mut sockaddr,
- pub ai_canonname: *mut c_char,
- pub ai_next: *mut addrinfo,
-}
-
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct linger {
- pub l_onoff: i32,
- pub l_linger: i32,
-}
-
-#[inline]
-pub unsafe fn socket(domain: c_int, type_: c_int, protocol: c_int) -> FileDescriptor {
- sys_hermit_socket(domain, type_, protocol)
-}
-
-#[inline]
-pub unsafe fn accept(
- s: FileDescriptor,
- addr: *mut sockaddr,
- addrlen: *mut socklen_t,
-) -> FileDescriptor {
- sys_hermit_accept(s, addr, addrlen)
-}
-
-#[inline]
-pub unsafe fn bind(s: FileDescriptor, name: *const sockaddr, namelen: socklen_t) -> i32 {
- sys_hermit_bind(s, name, namelen)
-}
-
-#[inline]
-pub unsafe fn shutdown(s: FileDescriptor, how: c_int) -> i32 {
- sys_hermit_shutdown(s, how)
-}
-
-#[inline]
-pub unsafe fn getpeername(s: FileDescriptor, name: *mut sockaddr, namelen: *mut socklen_t) -> i32 {
- sys_hermit_getpeername(s, name, namelen)
-}
-
-#[inline]
-pub unsafe fn getsockname(s: FileDescriptor, name: *mut sockaddr, namelen: *mut socklen_t) -> i32 {
- sys_hermit_getsockname(s, name, namelen)
-}
-
-#[inline]
-pub unsafe fn getsockopt(
- s: FileDescriptor,
- level: c_int,
- optname: c_int,
- optval: *mut c_void,
- optlen: *const socklen_t,
-) -> i32 {
- sys_hermit_getsockopt(s, level, optname, optval, optlen)
-}
-
-#[inline]
-pub unsafe fn setsockopt(
- s: FileDescriptor,
- level: c_int,
- optname: c_int,
- optval: *const c_void,
- optlen: socklen_t,
-) -> i32 {
- sys_hermit_setsockopt(s, level, optname, optval, optlen)
-}
-
-#[inline]
-pub unsafe fn connect(s: FileDescriptor, name: *const sockaddr, namelen: socklen_t) -> i32 {
- sys_hermit_connect(s, name, namelen)
-}
-
-#[inline]
-pub unsafe fn listen(s: FileDescriptor, backlog: c_int) -> i32 {
- sys_hermit_listen(s, backlog)
-}
-
-#[inline]
-pub unsafe fn recv(s: FileDescriptor, mem: *mut c_void, len: size_t, flags: c_int) -> ssize_t {
- (-EINVAL).try_into().unwrap()
-}
-
-#[inline]
-pub unsafe fn recvfrom(
- s: FileDescriptor,
- mem: *mut c_void,
- len: size_t,
- flags: c_int,
- from: *mut sockaddr,
- fromlen: *mut socklen_t,
-) -> ssize_t {
- (-EINVAL).try_into().unwrap()
-}
-
-#[inline]
-pub unsafe fn send(s: FileDescriptor, mem: *const c_void, len: size_t, flags: c_int) -> ssize_t {
- (-EINVAL).try_into().unwrap()
-}
-
-#[inline]
-pub unsafe fn sendmsg(s: FileDescriptor, message: *const msghdr, flags: c_int) -> ssize_t {
- (-EINVAL).try_into().unwrap()
-}
-
-#[inline]
-pub unsafe fn sendto(
- s: FileDescriptor,
- mem: *const c_void,
- len: size_t,
- flags: c_int,
- to: *const sockaddr,
- tolen: socklen_t,
-) -> ssize_t {
- (-EINVAL).try_into().unwrap()
-}
-
-#[inline]
-pub unsafe fn freeaddrinfo(ai: *mut addrinfo) {}
-
-#[inline]
-pub unsafe fn getaddrinfo(
- nodename: *const c_char,
- servname: *const c_char,
- hints: *const addrinfo,
- res: *mut *mut addrinfo,
-) -> i32 {
- sys_hermit_getaddrinfo(nodename, servname, hints, res)
-}