hermit-abi 0.1.18

hermit-abi is small interface to call functions from the unikernel RustyHermit. It is used to build the target `x86_64-unknown-hermit`.
1
2
3
4
5
6
7
8
9
10
11
12
13
//! `tcplistener` provide an interface to establish tcp socket server.

use crate::{Handle, IpAddress};

extern "Rust" {
	fn sys_tcp_listener_accept(port: u16) -> Result<(Handle, IpAddress, u16), ()>;
}

/// Wait for connection at specified address.
#[inline(always)]
pub fn accept(port: u16) -> Result<(Handle, IpAddress, u16), ()> {
	unsafe { sys_tcp_listener_accept(port) }
}