From 8f4aff05d5126e0807dfabbb09036804b7a87367 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Sat, 13 Aug 2016 16:57:21 -0600 Subject: [PATCH] Cleanup docs --- src/lib.rs | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 362fb16..3781cf3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,33 +7,47 @@ //! Syscalls in Redox are often handled by userspace `schemes`. //! The essential syscalls in Redox are as follows: //! -//! ## open(path: &str, flags: usize) -> Result +//! ### Open +//! `open(path: &str, flags: usize) -> Result` +//! //! Open a file, providing a path as a `&str` and flags, defined elsewhere. //! Returns a number, known as a file descriptor, that is passed to other syscalls //! -//! ## close(file_descriptor: usize) -> Result<()> +//! ### Close +//! `close(file_descriptor: usize) -> Result<()>` +//! //! Close a file descriptor, providing the file descriptor from `open` //! Returns an error, `EBADF`, if the file descriptor was not found. //! This potential error is often ignored by userspace //! -//! ## dup(file_descriptor: usize) -> Result +//! ### Duplicate +//! `dup(file_descriptor: usize) -> Result` +//! //! Duplicate a file descriptor, providing the file descriptor from `open` //! Returns a new file descriptor, or an error //! -//! ## read(file_descriptor: usize, buffer: &mut [u8]) -> Result +//! ### Read +//! `read(file_descriptor: usize, buffer: &mut [u8]) -> Result` +//! //! Read from a file descriptor, providing the file descriptor from `open` and a mutable buffer //! Returns the number of bytes actually read, or an error //! -//! ## write(file_descriptor: usize, buffer: &[u8]) -> Result +//! ### Write +//! `write(file_descriptor: usize, buffer: &[u8]) -> Result` +//! //! Write to a file descriptor, providing the file descriptor from `open` and a const buffer //! Returns the number of bytes actually written, or an error //! -//! ## fstat(file_descriptor: usize, stat: &mut Stat) -> Result<()> +//! ### Stat +//! `fstat(file_descriptor: usize, stat: &mut Stat) -> Result<()>` +//! //! Get information from a file descriptor, providing the file descriptor from `open` //! and a mutable Stat struct, defined elsewhere. //! Returns an error if the operation failed //! -//! ## fpath(file_descriptor: usize, buffer: &mut [u8]) -> Result +//! ### Path +//! `fpath(file_descriptor: usize, buffer: &mut [u8]) -> Result` +//! //! Read the path of a file descriptor, providing the file descriptor from `open` //! and a mutable buffer. The buffer should be 4096 bytes, to ensure that the //! entire path will fit.