summaryrefslogtreecommitdiffstats
path: root/vendor/hermit-abi
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
commit9918693037dce8aa4bb6f08741b6812923486c18 (patch)
tree21d2b40bec7e6a7ea664acee056eb3d08e15a1cf /vendor/hermit-abi
parentReleasing progress-linux version 1.75.0+dfsg1-5~progress7.99u1. (diff)
downloadrustc-9918693037dce8aa4bb6f08741b6812923486c18.tar.xz
rustc-9918693037dce8aa4bb6f08741b6812923486c18.zip
Merging upstream version 1.76.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.toml4
-rw-r--r--vendor/hermit-abi/README.md6
-rw-r--r--vendor/hermit-abi/src/lib.rs89
4 files changed, 93 insertions, 8 deletions
diff --git a/vendor/hermit-abi/.cargo-checksum.json b/vendor/hermit-abi/.cargo-checksum.json
index a1c698bca..52bfa75c9 100644
--- a/vendor/hermit-abi/.cargo-checksum.json
+++ b/vendor/hermit-abi/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"Cargo.toml":"1e9a64af07914259270103fbf03bbb686a0a3f36a6b10bb9ae05fe84ffaba5b6","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"322fadd63e558e5a10caf980cbedf83ac1546ba40fd992f54492e21ce54205af","src/errno.rs":"1c0680ead2ddf26b12d34bd7fa3e1dab386df761d6ac1901889ece26682dc465","src/lib.rs":"3d053b92d0e3d6ac3c94c0911106dd68c6e5f9ad253f704b6b5e1a7cf4a70d92","src/tcplistener.rs":"1fb1c0c232d4f24afb6cff63a7541d00029b7159da8d25b2eb257dff078940a0","src/tcpstream.rs":"fce8a598c6331b82e40982eda079d758be324b8941bf76f1031cea8d01632823"},"package":"443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b"} \ No newline at end of file
+{"files":{"Cargo.toml":"2fdd312de10adc759afb2008d22aa716f275f7ac82b517cafd2adfcf62fb4f14","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"d18b009fb1ac087d121ce82ea4a0f557d63b8641f4be4316ad105b00bf85867d","src/errno.rs":"1c0680ead2ddf26b12d34bd7fa3e1dab386df761d6ac1901889ece26682dc465","src/lib.rs":"ce3e2dc736b3d369a80de2645ed5bb10779c236b5ad12e17d7e257d73780aada","src/tcplistener.rs":"1fb1c0c232d4f24afb6cff63a7541d00029b7159da8d25b2eb257dff078940a0","src/tcpstream.rs":"fce8a598c6331b82e40982eda079d758be324b8941bf76f1031cea8d01632823"},"package":"d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7"} \ No newline at end of file
diff --git a/vendor/hermit-abi/Cargo.toml b/vendor/hermit-abi/Cargo.toml
index b2a137767..b0c3a354c 100644
--- a/vendor/hermit-abi/Cargo.toml
+++ b/vendor/hermit-abi/Cargo.toml
@@ -12,7 +12,7 @@
[package]
edition = "2021"
name = "hermit-abi"
-version = "0.3.2"
+version = "0.3.3"
authors = ["Stefan Lankes"]
description = "Hermit system calls definitions."
readme = "README.md"
@@ -22,7 +22,7 @@ keywords = [
]
categories = ["os"]
license = "MIT OR Apache-2.0"
-repository = "https://github.com/hermitcore/rusty-hermit"
+repository = "https://github.com/hermitcore/hermit-rs"
[dependencies.alloc]
version = "1.0.0"
diff --git a/vendor/hermit-abi/README.md b/vendor/hermit-abi/README.md
index c75bfda0d..983c038b7 100644
--- a/vendor/hermit-abi/README.md
+++ b/vendor/hermit-abi/README.md
@@ -1,12 +1,12 @@
# hermit-abi
[![Crates.io](https://img.shields.io/crates/v/hermit-abi.svg)](https://crates.io/crates/hermit-abi)
-[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://hermitcore.github.io/rusty-hermit/hermit_abi/)
+[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://hermitcore.github.io/hermit-rs/hermit_abi/)
[![License](https://img.shields.io/crates/l/hermit-abi.svg)](https://img.shields.io/crates/l/hermit-abi.svg)
-This is small interface to call functions from the unikernel [RustyHermit](https://github.com/hermitcore/libhermit-rs).
+This is small interface to call functions from the [Hermit kernel](https://github.com/hermitcore/kernel).
-Please read the README of [RustyHermit](https://github.com/hermitcore/libhermit-rs) for more information.
+Please read the README of the [Hermit kernel](https://github.com/hermitcore/kernel) for more information.
## License
diff --git a/vendor/hermit-abi/src/lib.rs b/vendor/hermit-abi/src/lib.rs
index 29a928e2b..0521b2bad 100644
--- a/vendor/hermit-abi/src/lib.rs
+++ b/vendor/hermit-abi/src/lib.rs
@@ -1,5 +1,5 @@
-//! `hermit-abi` is small interface to call functions from the unikernel
-//! [RustyHermit](https://github.com/hermitcore/libhermit-rs).
+//! `hermit-abi` is small interface to call functions from the
+//! [Hermit unikernel](https://github.com/hermitcore/kernel).
#![no_std]
#![allow(nonstandard_style)]
@@ -252,6 +252,58 @@ pub struct pollfd {
pub revents: i16, /* events returned */
}
+#[repr(C)]
+pub struct dirent {
+ pub d_ino: u64,
+ pub d_off: u64,
+ pub d_namelen: u32,
+ pub d_type: u32,
+ pub d_name: [u8; 0],
+}
+
+#[repr(C)]
+#[derive(Copy, Clone, Debug)]
+pub enum DirectoryEntry {
+ Invalid(i32),
+ Valid(*const dirent),
+}
+
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct stat {
+ pub st_dev: u64,
+ pub st_ino: u64,
+ pub st_nlink: u64,
+ pub st_mode: u32,
+ pub st_uid: u32,
+ pub st_gid: u32,
+ pub st_rdev: u64,
+ pub st_size: i64,
+ pub st_blksize: i64,
+ pub st_blocks: i64,
+ pub st_atime: i64,
+ pub st_atime_nsec: i64,
+ pub st_mtime: i64,
+ pub st_mtime_nsec: i64,
+ pub st_ctime: i64,
+ pub st_ctime_nsec: i64,
+}
+
+pub const DT_UNKNOWN: u32 = 0;
+pub const DT_FIFO: u32 = 1;
+pub const DT_CHR: u32 = 2;
+pub const DT_DIR: u32 = 4;
+pub const DT_BLK: u32 = 6;
+pub const DT_REG: u32 = 8;
+pub const DT_LNK: u32 = 10;
+pub const DT_SOCK: u32 = 12;
+pub const DT_WHT: u32 = 14;
+
+pub const S_IFDIR: u32 = 16384;
+pub const S_IFREG: u32 = 32768;
+pub const S_IFLNK: u32 = 40960;
+pub const S_IFMT: u32 = 61440;
+
// sysmbols, which are part of the library operating system
extern "C" {
/// If the value at address matches the expected value, park the current thread until it is either
@@ -409,10 +461,32 @@ extern "C" {
#[link_name = "sys_open"]
pub fn open(name: *const i8, flags: i32, mode: i32) -> i32;
+ /// open a directory
+ ///
+ /// The opendir() system call opens the directory specified by `name`.
+ #[link_name = "sys_opendir"]
+ pub fn opendir(name: *const i8) -> i32;
+
/// delete the file it refers to `name`
#[link_name = "sys_unlink"]
pub fn unlink(name: *const i8) -> i32;
+ /// remove directory it refers to `name`
+ #[link_name = "sys_rmdir"]
+ pub fn rmdir(name: *const i8) -> i32;
+
+ /// stat
+ #[link_name = "sys_stat"]
+ pub fn stat(name: *const i8, stat: *mut stat) -> i32;
+
+ /// lstat
+ #[link_name = "sys_lstat"]
+ pub fn lstat(name: *const i8, stat: *mut stat) -> i32;
+
+ /// fstat
+ #[link_name = "sys_fstat"]
+ pub fn fstat(fd: i32, stat: *mut stat) -> i32;
+
/// determines the number of activated processors
#[link_name = "sys_get_processor_count"]
pub fn get_processor_count() -> usize;
@@ -485,6 +559,17 @@ extern "C" {
#[link_name = "sys_read"]
pub fn read(fd: i32, buf: *mut u8, len: usize) -> isize;
+ /// 'readdir' returns a pointer to a dirent structure
+ /// representing the next directory entry in the directory stream
+ /// pointed to by the file descriptor
+ #[link_name = "sys_readdir"]
+ pub fn readdir(fd: i32) -> DirectoryEntry;
+
+ /// 'mkdir' attempts to create a directory,
+ /// it returns 0 on success and -1 on error
+ #[link_name = "sys_mkdir"]
+ pub fn mkdir(name: *const i8, mode: u32) -> i32;
+
/// Fill `len` bytes in `buf` with cryptographically secure random data.
///
/// Returns either the number of bytes written to buf (a positive value) or