add more detailed docs for realm_syscall

This commit is contained in:
zephyr
2022-04-25 00:36:59 +09:00
parent 94c66f2ba4
commit 656f4e2ffc
5 changed files with 13 additions and 3 deletions
Generated
+1 -1
View File
@@ -861,7 +861,7 @@ dependencies = [
[[package]]
name = "realm_syscall"
version = "0.1.0"
version = "0.1.1"
dependencies = [
"daemonize",
"libc",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "realm_syscall"
version = "0.1.0"
version = "0.1.1"
authors = ["zephyr <i@zephyr.moe>"]
description = "Realm's convenient syscall collections"
repository = "https://github.com/zhboner/realm/realm_syscall"
+2
View File
@@ -1,6 +1,8 @@
use std::env::current_dir;
use daemonize::Daemonize;
/// Daemonize.
///
/// Fork the process in the background,
/// disassociate from process group and the control terminal.
///
+1
View File
@@ -2,6 +2,7 @@ use std::io::{Error, Result};
use libc::{rlimit, rlim_t, RLIMIT_NOFILE};
/// Set nofile limitation.
///
/// `CAP_NET_ADMIN` privilege is required if exceeds hard limitation.
///
/// Reference:
+8 -1
View File
@@ -1,7 +1,14 @@
use std::io::Result;
use socket2::{Socket, Domain, Type};
/// Create a new socket.
/// Create a new non-blocking socket.
///
/// On unix-like platforms, [`SOCK_NONBLOCK`](libc::SOCK_NONBLOCK) and
/// [`SOCK_CLOEXEC`](libc::SOCK_CLOEXEC) are assigned
/// when creating a new socket, which saves a [`fcntl`](libc::fcntl) syscall.
///
/// On other platforms, a socket is created without extra flags
/// then set to `non_blocking`.
#[cfg(any(
target_os = "android",
target_os = "dragonfly",