Crate hermit_abi
source ·Expand description
hermit-abi is small interface to call functions from the unikernel
RustyHermit.
Modules
tcplistenerprovide an interface to establish tcp socket server.tcpstreamprovide an interface to establish tcp socket client.
Structs
- A handle, identifying a socket
- A four-octet IPv4 address.
- A sixteen-octet IPv6 address.
- Priority of a thread
timespecis used byclock_gettimeto retrieve the current time
Enums
- An internetworking address.
- Internet protocol version.
Constants
- Maximum number of priorities
- The largest number
randwill return
Functions
- cause abnormal termination
- bind⚠bind a name to a socket
- Add current task to the queue of blocked tasks. After calling
block_current_task, callyield_nowto switch to another task. - Add current task to the queue of blocked tasks, but wake it when
timeoutmilliseconds have elapsed. - get current time
- close a file descriptor
- dup⚠duplicate an existing file descriptor
- exit⚠cause normal termination and return
argto the host system - If the value at address matches the expected value, park the current thread until it is either woken up with
futex_wake(returns 0) or an optional timeout elapses (returns -ETIMEDOUT). - Wake
countthreads waiting on the futex ataddress. Returns the number of threads woken up (saturates toi32::MAX). Ifcountisi32::MAX, wake up all matching waiting threads. Ifcountis negative oraddressis null, returns -EINVAL. - Determine the priority of the current thread
- determines the number of activated processors
- Determines the id of the current thread
- returns true if file descriptor
fdis a tty - join⚠join with a terminated thread
- listen for connections on a socket
- initialize the network stack
- open⚠open and possibly create a file
- poll⚠
- read⚠read from a file descriptor
- Fill
lenbytes inbufwith cryptographically secure random data. - recv⚠receive() a message from a socket
- receive() a message from a socket
- sem_destroy() frees the unnamed semaphore at the address pointed to by
sem. - sem_init() initializes the unnamed semaphore at the address pointed to by
sem. Thevalueargument specifies the initial value for the semaphore. - sem_post() increments the semaphore pointed to by
sem. If the semaphore’s value consequently becomes greater than zero, then another thread blocked in a sem_wait call will be woken up and proceed to lock the semaphore. - decrement a semaphore
- try to decrement a semaphore
- send⚠
- Determine the priority of the current thread
- shut down part of a full-duplex connection
- spawn a new thread
- spawn a new thread with user-specified stack size
- delete the file it refers to
name - suspend execution for microsecond intervals
- Wakeup task with the thread id
tid - write to a file descriptor
- yield the processor
Type Definitions
- A thread handle type